Want to statically allocate an ethn interface
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. Thanks for any suggestions. |
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? |
Thanks again for your reply.
I didn't know that I could preempt the 'automatic' module loading done elsewhere. Yes please could you transfer this thread to the Slack Forum. |
Several options for you in Slackware -
|
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. Thanks again. |
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. |
Quote:
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... Eric |
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). Thanks for any further clarification. |
I would think that the only reasons why your interfaces don't have the same name at all times, are:
Eric |
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.
Bit of a mystery it seems. Thanks Eric for all your help |
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) 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. |
I think that accounts for it - did what you suggested, then rebooted several times and ethn didn't vary on reboot.
Thanks ppd - mystery solved. |
yes, thats useful.
|
All times are GMT -5. The time now is 11:43 PM. |