SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I configure my wireless card in /etc/rc.d/rc.inet1.conf on a specific interface, currently eth1, but the interface number (eth0, eth1) changes at every boot, sometimes assigning eth0 to the wireless card, sometimes to the ethernet card, so the wireless doesn't work (ping returns Destination Host Unreachable). But it works once I reconfigure the ethernet name.
I believe these interfaces are assigned on the basis of the order in which the kernel loads the drivers. So I have tried to discover ways to control that order. I have discovered that if a driver
is NOT loaded as a module, then one can use the 'ether' and 'reserve' command' in lilo-conf to
to control the allocation of the interface name.
However, both my ethernet and wireless drivers are loaded as modules - the ethernet driver is handled automatically, whereas I do an explicit modprobe in rc.modules for the wireless driver (IPW2200). It would be nice to leave them as modules and find another way to control the allocation of ethn interface names.
I am using Slackware 2.6.13.2.
Make sure one module loads before the other, everytime..
I have compiled my built in NIC into the kernel so it's up first, then the hotplugging takes care of the rest.
There must be a place to auto load modules at boot in Slack, or you can cobble up a script in rc.d to do it.
modprobe 8139too
sleep 3
modprobe via-rhine
sleep 3
modprobe wlan0
Thanks for your reply, but as I said above I don't call modprobe for the ethernet card, since the driver was already installed, it is handled automatically. I only call modprobe explicitly for the ipw2200 driver (which I had to download) - so I cannot 'order' them in rc.modules.
Your system has a boot order..
I am suggesting you get the ethernet card module loaded before it is "automatically" loaded. This should place it first and make sure it's eth0.
Now having said that, I haven't used Slack so I can't recommend where to do this.
Would you like to ask in the Slack Forum?
Or should I move this thread there for you?
Create a file named /etc/rc.d/rc.netdevice and make in executable: chmod +x /etc/rc.d/rc.netdevice . Add this line to that file:
Code:
/sbin/modprobe your_network_interface
where you of course enter the driver for your own wired interface, like e100, or 8139too.
Slackware will load that module before all others, and this interface will become eth0.
Add this line to [B]/etc/modprobe.conf[/B or /etc/modules.conf:
Code:
alias eth0 your_network_interface
This will also have the effect that you connect eth0 to your interface.
Thanks for that. The first option worked, however, I'd already tried the second option, which doesn't work for me.
So that I can understand better, I wonder if you or someone might answer the following:
1. Since the ethn interfaces allocated to the ethernet and wireless devices change every time I reboot, I assume the order in which the modules are loaded changes. Is this because the modules are loaded in different threads so timing of the loading can vary?
2.Where then is the 'automatic' loading of modules like my ethernet module done - it's not in rc.modules.
It's done by the hotplug system, which runs with /etc/rc.d/rc.hotplug file.
Another way to solve the "problem" of the net cards being swapped is by blacklisting the modules on /etc/hotplug/blacklist so they won't be automatically loaded, and modprobe them in rc.modules with the order you want.
Originally posted by liutabme 1. Since the ethn interfaces allocated to the ethernet and wireless devices change every time I reboot, I assume the order in which the modules are loaded changes. Is this because the modules are loaded in different threads so timing of the loading can vary?
2.Where then is the 'automatic' loading of modules like my ethernet module done - it's not in rc.modules.
Indeed, the hotplug system loads any modules for the hardware it detects, that are not already loaded by Slackware's init scripts.
Before hotplug runs, the rc.modules script is executed which loads several modules, and executes the /etc/rc.d/rc.netdevice script that I hinted about in an earlier post.
Also before running the hotplug script, Slackware will run the script /etc/rc.d/rc.inet1. This script will configure any network interface that is already present - either because you loaded it's module in rc.modules or rc.netdevice or because you defined an alias for it in /etc/modules.conf (/etc/modprobe.conf for 2.6 kernels).
The hotplug system will run last and configure all remaining interfaces that it detects and for which you provided configuration information in rc.inet1.conf and/or rc.wireless.conf .
So, you do have control over what device gets what interface name, because you can control the order in which the modules for the various network devices get loaded.
Of course, all of this has no effect at all if your network devices are compiled into the Linux kernel instead of being compiled as modules...
Thank you for your very complete reply - that has clarified much.
Yes I realise I do have control over the order, and hence which interface is allocated.
There remains the issue, however, that before I made the above changes, on successive reboots, when nothing had been changed in the configuration to change the order of loading, different ethn interfaces were allocated. So what was responsible then?
Maybe I've missed the point of what has been said. Sorry if I have. But it seems to me that if different ethn interfaces are allocated without any configuration changing, and if the allocation depends on the order of loading (or something else) , then there has to be something affecting that order (like threads for example).
I would think that the only reasons why your interfaces don't have the same name at all times, are:
Your wireless card is PCMCIA and it is not always inserted while booting
More than one process is detecting and configuring network interfaces. This should never happen in a default Slackware box. It can happen if you reverse the order of starting rc.hotplug and rc.inet1 in rc.M - or if perhaps you put an ampersand & after the call to any of those scripts in rc.M. Or perhaps you added stuff in rc.local that interferes?
I don't think these possibilities can account for it - I've not touched rc.M, and my wireless card is internal to the laptop (mini PCI). As for rc.local I've only added a line to select the 'ondemand' frequency scaling governor.
The backgrounding '&' of a process is not the sole cause of timing issues. sleep 3 is found in a number of rc.xxx scripts and on my laptop is a must for the pcmcia card to be found and then properly configured. To test, try reverting your scripts to the way they were, change rc.hotplug section as shown,
Code:
start|restart|status)
sleep 3 #added this
for RC in /etc/hotplug/*.rc
do
$RC $1
done
touch /var/lock/subsys/hotplug
sleep 3 #added this
;;
then see if the eth# continues vary on reboot.
ppd
ps as hotplug can take awhile to start with; the extra sleep statements will make booting that much worse so un-revert above changes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.