You are not logged in.

#1 2008-04-19 02:20:23

deconstrained
Member
Registered: 2008-03-31
Posts: 49

multiple interfaces and devices - ending the confusion?

Hello,

I recently went through a bit of a conundrum with my onboard ethernet that was caused by a sudden switch of roles between eth1, formerly my primary onboard, and eth0, formerly my PCI chipset (my workstation shares its internet connection with other computers).

Now that the confusion is over, and I have edited all of my network config files to reflect this change, I was wondering: is there any possible way to bind a device, i.e. by specifying its module, to a given interface, so that every time at boot up, physical hardware device X will be eth0 and physical hardware device Y will be eth1, etc?

Thank you.

Offline

#2 2008-04-19 02:37:43

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: multiple interfaces and devices - ending the confusion?

This used to work:

/etc/modprobe.conf

alias eth0 myethermodule
alias eth1 otherethermodule

But looks like in 2.6 there's a better way of doing it with udev, so you bind a interface name to a MAC address directly:

/etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x10de:0x0057 (sky1)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:b6:f2:66:a5:9a", NAME="eth0"
# PCI device 0x1969:0x1048 (atl1)

SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:e0:a6:1f:63:6a", NAME="eth1"

Last edited by freakcode (2008-04-19 02:40:59)

Offline

#3 2008-04-19 03:16:47

deconstrained
Member
Registered: 2008-03-31
Posts: 49

Re: multiple interfaces and devices - ending the confusion?

Awesome, thanks!

Last edited by deconstrained (2008-04-19 03:19:49)

Offline

#4 2008-04-19 13:57:59

carlocci
Member
From: Padova - Italy
Registered: 2008-02-12
Posts: 368

Re: multiple interfaces and devices - ending the confusion?

Or you can specify the order in which the modules are loaded in your rc.conf

Offline

#5 2008-04-19 22:45:20

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: multiple interfaces and devices - ending the confusion?

Or easier... pacman -S netcfg, modify the default /etc/iftab, and set net-rename to start on boot.

Offline

#6 2008-04-21 02:31:58

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: multiple interfaces and devices - ending the confusion?

iphitus wrote:

Or easier... pacman -S netcfg, modify the default /etc/iftab, and set net-rename to start on boot.

Does that work only with Arch (I mean, the netcfg is a Arch thingie right)?

Offline

#7 2008-04-21 07:41:41

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: multiple interfaces and devices - ending the confusion?

freakcode wrote:
iphitus wrote:

Or easier... pacman -S netcfg, modify the default /etc/iftab, and set net-rename to start on boot.

Does that work only with Arch (I mean, the netcfg is a Arch thingie right)?

I think it uses ifrename which exists on most distributions.

Offline

#8 2008-04-21 09:09:08

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: multiple interfaces and devices - ending the confusion?

brain0 wrote:
freakcode wrote:
iphitus wrote:

Or easier... pacman -S netcfg, modify the default /etc/iftab, and set net-rename to start on boot.

Does that work only with Arch (I mean, the netcfg is a Arch thingie right)?

I think it uses ifrename which exists on most distributions.

Yup, just ifrename and iftab

Offline

#9 2008-04-22 01:47:25

freakcode
Member
From: São Paulo - Brazil
Registered: 2007-11-03
Posts: 410
Website

Re: multiple interfaces and devices - ending the confusion?

Oh, good then. I tried to give a general Linux solution for the problem, as I guess a lot of people will hit the forums from Google and the like. So, it's good to know that the netcfg scripts can work on another distros too.

Offline

Board footer

Powered by FluxBB