Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Order of network device assignments changed on boot. [solved
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Thu Dec 01, 2005 1:45 am    Post subject: Order of network device assignments changed on boot. [solved Reply with quote

Hi All,

I have three network devices:

1. Wired eth0
2. WiFi eth1
3. Wired eth2 (via usb->ethernet adapter (ADSL modem))

eth0 and eth1 are part of a bridge br0.

My problem is that sometimes on boot eth1 and eth2 assignment gets swapped. i.e eth2 becomes the
Wifi and eth1 the ADSL modem. I have to reboot several times to get the assignments I want.

How can I ensure the order above.

(I have net.br0 and net.eth2 at boot run-level)

Thanks,
Bernard.
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....


Last edited by ebike on Wed Dec 14, 2005 7:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Fri Dec 02, 2005 9:48 pm    Post subject: Reply with quote

Bump ... Anyone? :cry:
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Mon Dec 05, 2005 8:14 pm    Post subject: Reply with quote

Bumpity bump....

I have found several suggestions elsewhere:

1. adding aliases for the interface modules in /etc/moudules.d/aliases
2. Using udev to do the same.

I have tried #1. to no avail and I have no idea how to do assign a driver to an interface name in udev.
Maybe someone can come up with a rule for me??

I'm feeling all alone on this issue ... :cry:
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Wed Dec 07, 2005 6:46 am    Post subject: Reply with quote

Ok, I'm going to have to help myself here, .. and hopefully others 8O .

I have made a file called /etc/udev/rules.d/20-network.rules which contains:
Code:

KERNEL="eth*", SYSFS{address}=="00:11:2f:b6:73:42", NAME="lan"
KERNEL="eth*", SYSFS{address}=="00:a0:c5:7f:17:6a", NAME="wifi"
KERNEL="eth*", SYSFS{address}=="00:50:fc:bc:be:94", NAME="adsl"


That should give me a lan,wifi and adsl device that I can start by making the appropriate
sym link to net.lo (eg net.lan) and start these instead of the net.eth* ones.

Ifconfig should then show these interfaces. I will also have to modify /etc/conf.d/net to use the new names.

I will try this soon and post results. Anyone see any problems with this please let me know.
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Thu Dec 08, 2005 9:25 pm    Post subject: Reply with quote

Well I tried it with partial results:

The "lan" and "adsl" interfaces come up ok, but the "wifi" does not. On looking in
/sys/class/net I see that the old device eth* is still there and hasn't been renamed.

If I reload the driver for my wifi card (prism54) and then run udevstart, I get the wifi interface ok.

It looks like the prism54 module is not being loaded before udev starts.!!
Does anyone know how to ensure the module gets loaded early enough?
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Sun Dec 11, 2005 7:22 pm    Post subject: Reply with quote

Come on people ... :? 184 views and no one has any comments at all??

At least if you haven't got an answer, please let me know if you have similar issues ....
someone must have found this issue, there must me someone with multiple network interfaces out there, that would have
struck this problem, I can't be the only one out there ....
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Sun Dec 11, 2005 7:29 pm    Post subject: Reply with quote

I didn't think the network interfaces used /dev/ device nodes, so your udev rules wouldn't help

Your best best is probably forcing the same module load order everytime by adding the modules for each into /etc/modules.autoload/kernel-2.6. This way you know which module will be loaded first and assigned eth0, then the second, eth1, etc.
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Mon Dec 12, 2005 2:21 am    Post subject: Reply with quote

Yay at last , someone lives on planet Gentoo, thanks for the reply HeadRush.

You don't need a /dev node for udev assignments, just an entry made by sysfs to /sys/class/etc etc
the udev howto gives an example of re-naming network devices this way.. it should work.

I will try the module load order you suggest, but this assumes that modules.autoload is used before hotplug/coldplug, and I don't know if
this is so .... can anyone confirm?

Cheers,
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
widan
Veteran
Veteran


Joined: 07 Jun 2005
Posts: 1512
Location: Paris, France

PostPosted: Mon Dec 12, 2005 2:35 am    Post subject: Reply with quote

ebike wrote:
I will try the module load order you suggest, but this assumes that modules.autoload is used before hotplug/coldplug, and I don't know if this is so .... can anyone confirm?

Modules in modules.autoload.d are handled by the "modules" init script, and that script will always run before hotplug and coldplug (because those last two depend on the modules script).
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Mon Dec 12, 2005 7:15 pm    Post subject: Reply with quote

Great, thanks widan, I will try this tonight.

Now if only I can solve why 2.6.14 has issues with hostname, where 2.6.11 is ok??
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Mon Dec 12, 2005 7:40 pm    Post subject: Reply with quote

ebike wrote:
Great, thanks widan, I will try this tonight.

Now if only I can solve why 2.6.14 has issues with hostname, where 2.6.11 is ok??

Oh ya, give Widan the credit. :P

Can you explain the hostname issue more. Are you sure this wasn't to do with a change in baselayout?
(New method of specifying hostname)
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Tue Dec 13, 2005 12:55 am    Post subject: Reply with quote

... and all credit to Headrush .. your the man! 8)

The hostname issue is that on boot I get a hostname resolve issue (not sure of the exact error message, .. and I'm away from my box
at present )

What were the changes in baselayout, i.e what is the new method of specifying hostname, was it the simple move from
/etc/hostname to /etc/conf.d/hostname?, or was there syntax changes as well?

Thanks.
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Tue Dec 13, 2005 4:26 am    Post subject: Reply with quote

ebike wrote:
What were the changes in baselayout, i.e what is the new method of specifying hostname, was it the simple move from
/etc/hostname to /etc/conf.d/hostname?

Yes. remove /etc/hostname if it exists and add hostname and domainname to a runlevel.
(Don't know if it matters, but mine are in boot)
Code:
rc-update add domainname boot
rc-update add hostname boot
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Tue Dec 13, 2005 7:15 pm    Post subject: Reply with quote

Yep did all that.

Hunting around the forum, looks like I might have to add host and domain to /etc/hosts..
For example, my hostname is "mythtv" and domain is "homenetwork", so I have to add:

Code:
127.0.0.1 mythtv.homenetwork mythtv localhost.localdomain localhost


instead of :

Code:
 127.0.0.1 localhost

_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
ebike
Guru
Guru


Joined: 07 Dec 2002
Posts: 384
Location: Christchurch, New Zealand

PostPosted: Wed Dec 14, 2005 7:41 pm    Post subject: Reply with quote

Ok some results:

1. On the hostname/domainname issue, it looks like the only thing I had to do was set NISDOMAIN="homenetwork", that solved that issue. I did
not have to alter my /etc/hosts file as per my previous post.

2. On the network device assignments, the load order of the modules did indeed fix my problem ... thanks guys.

I will mark this thread as solved.
_________________
--
Politicians are like nappies (Diapers), you need to change them often, and for the same reason ....
Back to top
View user's profile Send private message
Headrush
Watchman
Watchman


Joined: 06 Nov 2003
Posts: 5597
Location: Bizarro World

PostPosted: Wed Dec 14, 2005 9:27 pm    Post subject: Reply with quote

ebike wrote:
Ok some results:

1. On the hostname/domainname issue, it looks like the only thing I had to do was set NISDOMAIN="homenetwork", that solved that issue. I did
not have to alter my /etc/hosts file as per my previous post.

2. On the network device assignments, the load order of the modules did indeed fix my problem ... thanks guys.

I will mark this thread as solved.

Hmmm. Maybe you should post the following:
Code:
cat /etc/host.conf | grep order

I don't think you should have to do that for a "normal" home type setup.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum