public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number
@ 2006-10-26 15:01 Claudinei Matos
  2006-10-26 16:31 ` Daniel da Veiga
  0 siblings, 1 reply; 5+ messages in thread
From: Claudinei Matos @ 2006-10-26 15:01 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

Hi guys,

I'm changing my third network card (a 3c905cx) with a 3c905B one. Well, the
drivers are the same and the slot used is also the same.
My machine has other two NICs, one onboard (via-rhine) and a old realtek
8029 10/10 (ne2k-pci).
On my /etc/modules.d/aliases I have the 3 lines below:

alias eth0 via-rhine
alias eth1 ne2k-pci
alias eth2 3c59x

and it works very well setting each device to the right eth interface until
I'd start to change the NICs, sometimes it does not work but shuting down
and powering up the machine again used to solve.
now, since I'd changed the NICs, every time I boot up my machine the third
device (3com) is associated with eth3 and eth2 does not have any device
associated.
my dmesg says that the interface eth2 was associated with the ne2k-pci but
ifconfig tells that eth1 is ne2k-pci and eth3 (which doesn't appear at dmesg
log) is the 3com one.

ti01 myers # ifconfig eth3 up
ti01 myers # ifconfig|grep eth
eth0      Link encap:Ethernet  HWaddr 00:50:8D:84:A8:4F
eth1      Link encap:Ethernet  HWaddr 00:C0:DF:EA:D6:49
eth3      Link encap:Ethernet  HWaddr 00:50:04:6E:9C:AB

ti01 myers # dmesg|grep eth
eth0: VIA Rhine II at 0xec061000, 00:50:8d:84:a8:4f, IRQ 193.
eth0: MII PHY found at address 1, status 0x786d advertising 05e1 Link 45e1.
eth2: RealTek RTL-8029 found at 0xa400, IRQ 209, 00:C0:DF:EA:D6:49.
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

ti01 myers # dmesg|grep 3Com
0000:00:0a.0: 3Com PCI 3c905B Cyclone 100baseTx at ffffc20000228000.

Well, I do not have any idea about how to fix it or what may be wrong since
it is supposed to just setup /etc/modules.d/aliases and run modules-update
to generate /etc/modules.conf.
One extra information is that booting in single mode (init=/bin/bash) the
interface order is ok. Could it be a udev problem?

Thanks for the help,


-- 
Claudinei Matos
<claudineimatos@gmail.com>
55-21-81980605

[-- Attachment #2: Type: text/html, Size: 2167 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number
  2006-10-26 15:01 [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number Claudinei Matos
@ 2006-10-26 16:31 ` Daniel da Veiga
  2006-10-26 19:58   ` Claudinei Matos
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel da Veiga @ 2006-10-26 16:31 UTC (permalink / raw
  To: gentoo-user

On 10/26/06, Claudinei Matos <claudineimatos@gmail.com> wrote:
> Hi guys,
>
> I'm changing my third network card (a 3c905cx) with a 3c905B one. Well, the
> drivers are the same and the slot used is also the same.
> My machine has other two NICs, one onboard (via-rhine) and a old realtek
> 8029 10/10 (ne2k-pci).
> On my /etc/modules.d/aliases I have the 3 lines below:
>
> alias eth0 via-rhine
> alias eth1 ne2k-pci
> alias eth2 3c59x
>
> and it works very well setting each device to the right eth interface until
> I'd start to change the NICs, sometimes it does not work but shuting down
> and powering up the machine again used to solve.
> now, since I'd changed the NICs, every time I boot up my machine the third
> device (3com) is associated with eth3 and eth2 does not have any device
> associated.
> my dmesg says that the interface eth2 was associated with the ne2k-pci but
> ifconfig tells that eth1 is ne2k-pci and eth3 (which doesn't appear at dmesg
> log) is the 3com one.
>
> ti01 myers # ifconfig eth3 up
> ti01 myers # ifconfig|grep eth
> eth0      Link encap:Ethernet  HWaddr 00:50:8D:84:A8:4F
> eth1      Link encap:Ethernet  HWaddr 00:C0:DF:EA:D6:49
> eth3      Link encap:Ethernet  HWaddr 00:50:04:6E:9C:AB
>
> ti01 myers # dmesg|grep eth
> eth0: VIA Rhine II at 0xec061000, 00:50:8d:84:a8:4f, IRQ 193.
> eth0: MII PHY found at address 1, status 0x786d advertising 05e1 Link 45e1.
> eth2: RealTek RTL-8029 found at 0xa400, IRQ 209, 00:C0:DF:EA:D6:49.
> eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
>
> ti01 myers # dmesg|grep 3Com
> 0000:00:0a.0: 3Com PCI 3c905B Cyclone 100baseTx at ffffc20000228000.
>
> Well, I do not have any idea about how to fix it or what may be wrong since
> it is supposed to just setup /etc/modules.d/aliases and run modules-update
> to generate /etc/modules.conf.
> One extra information is that booting in single mode (init=/bin/bash) the
> interface order is ok. Could it be a udev problem?
>
> Thanks for the help,
>

I'm pretty sure you can use UDEV rules to set it, something like this:

# cat /etc/udev/rules.d/10-local.rules
BUS=="pci", KERNEL=="eth[0-9]", SYSFS{address}=="00:2a:9a:d4:65:32", \
NAME="lan0"
BUS=="pci", KERNEL=="eth[0-9]", SYSFS{address}=="00:a0:5d:3e:ae:54", \
NAME="lan1"

Where SYSFS{address} is the MAC address of the card.
-- 
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number
  2006-10-26 16:31 ` Daniel da Veiga
@ 2006-10-26 19:58   ` Claudinei Matos
  2006-10-26 20:18     ` Daniel da Veiga
  2006-10-26 20:49     ` Richard Fish
  0 siblings, 2 replies; 5+ messages in thread
From: Claudinei Matos @ 2006-10-26 19:58 UTC (permalink / raw
  To: gentoo-user

Looking at /etc/udev/rules.d/ I'd found 70-persistent-net.rules with
the lines below:
# PCI Device: 0x10ec:0x8029 (ne2k-pci)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:c0:df:ea:d6:49",
NAME="eth1"

# PCI Device: 0x10b7:0x9200 (3c59x)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:04:75:c5:5c:ce",
NAME="eth2"

The interface with name eth1 match the mac address with the installed
one, but interface eth2 does not, probably 'cause it might be the old
card mac adress.

Well, now I know that in some way udev add these links automatically I
do thing that I can just change the mac address putting the right one,
letting the file appear like below:

   	 	 	 	 	 		
# PCI Device: (via-rhine)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:8D:84:A8:4F",
NAME="eth0"

# PCI Device: 0x10ec:0x8029 (ne2k-pci)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:C0:DF:EA:D6:49",
NAME="eth1"

# PCI Device: 0x10b7:0x9200 (3c59x)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:04:6E:9C:AB",
NAME="eth2"


Well, that's OK, it do solve my problem but isn't it supposed to be an
automatically process? Isn't it an UDEV or Gentoo task to deal with?


-- 
Claudinei Matos

>
> I'm pretty sure you can use UDEV rules to set it, something like this:
>
> # cat /etc/udev/rules.d/10-local.rules
> BUS=="pci", KERNEL=="eth[0-9]", SYSFS{address}=="00:2a:9a:d4:65:32", \
> NAME="lan0"
> BUS=="pci", KERNEL=="eth[0-9]", SYSFS{address}=="00:a0:5d:3e:ae:54", \
> NAME="lan1"
>
> Where SYSFS{address} is the MAC address of the card.
> --
> Daniel da Veiga
> Computer Operator - RS - Brazil
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
> PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
> ------END GEEK CODE BLOCK------
> --
> gentoo-user@gentoo.org mailing list
>
>
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number
  2006-10-26 19:58   ` Claudinei Matos
@ 2006-10-26 20:18     ` Daniel da Veiga
  2006-10-26 20:49     ` Richard Fish
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel da Veiga @ 2006-10-26 20:18 UTC (permalink / raw
  To: gentoo-user

On 10/26/06, Claudinei Matos <claudineimatos@gmail.com> wrote:
> Looking at /etc/udev/rules.d/ I'd found 70-persistent-net.rules with
> the lines below:
> # PCI Device: 0x10ec:0x8029 (ne2k-pci)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:c0:df:ea:d6:49",
> NAME="eth1"
>
> # PCI Device: 0x10b7:0x9200 (3c59x)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:04:75:c5:5c:ce",
> NAME="eth2"
>
> The interface with name eth1 match the mac address with the installed
> one, but interface eth2 does not, probably 'cause it might be the old
> card mac adress.
>
> Well, now I know that in some way udev add these links automatically I
> do thing that I can just change the mac address putting the right one,
> letting the file appear like below:
>
>
> # PCI Device: (via-rhine)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:8D:84:A8:4F",
> NAME="eth0"
>
> # PCI Device: 0x10ec:0x8029 (ne2k-pci)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:C0:DF:EA:D6:49",
> NAME="eth1"
>
> # PCI Device: 0x10b7:0x9200 (3c59x)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:04:6E:9C:AB",
> NAME="eth2"
>
>
> Well, that's OK, it do solve my problem but isn't it supposed to be an
> automatically process? Isn't it an UDEV or Gentoo task to deal with?
>

Please do not top post.
Regarding your now solved problem, I don't have such file
(70-persistent-net.rules) in my rules.d directory, it seems that it
has something to do with automatic udev configuration. I don't have
any idea on WHY or WHEN this is run. It appears to be run by some rule
in UDEV configuration writting persistent net devices.

Maybe someone else will have a better idea... They'll probably need
your UDEV version...

-- 
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number
  2006-10-26 19:58   ` Claudinei Matos
  2006-10-26 20:18     ` Daniel da Veiga
@ 2006-10-26 20:49     ` Richard Fish
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Fish @ 2006-10-26 20:49 UTC (permalink / raw
  To: gentoo-user

On 10/26/06, Claudinei Matos <claudineimatos@gmail.com> wrote:
> Well, now I know that in some way udev add these links automatically I
> do thing that I can just change the mac address putting the right one,
> letting the file appear like below:
>
>
> # PCI Device: (via-rhine)
> SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:8D:84:A8:4F",
> NAME="eth0"

BTW, you should use the addresses as they appear in
/sys/class/net/ethX/address, i.e., with lower case letters, or the
matching may not work.

-Richard
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-10-26 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-26 15:01 [gentoo-user] modules.conf - alias for eth devices - can't set the correct interface number Claudinei Matos
2006-10-26 16:31 ` Daniel da Veiga
2006-10-26 19:58   ` Claudinei Matos
2006-10-26 20:18     ` Daniel da Veiga
2006-10-26 20:49     ` Richard Fish

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox