-   Linux - Hardware (
-   -   need help to change eth numbers at boot time (

akiuni 10-19-2012 11:49 AM

need help to change eth numbers at boot time
Hello everybody

I have googled a lot to find an answer to my question but I couldn't find a correct answer, or I don't have enought knowledge to understand... I hope somebody will help me.

I'm using debian 6 with kernel 3.2.31 on a DELL server with 4 broadcom network connectors. The thing is that debian is autoprobing the cards in a wrong order... The first RJ45 port is eth2, the second is eth3, the third is eth0 and the last one is eth1.

I would like to change this so as to get first port=eth0, second=eth1, third=eth2 and fourth=eth3

I've find out that I could create an alias on the driver name in modeprobe.conf, but all the cards are using the same driver (tg3)...

I've also find out that I could add a kernel boot command like that :
but I don't know how to find the correct "io" parameter to set (these are PCIexpress cards)

Could someone help me ?

the only thing that I can find to identify the cards is the pci slot, but I don't know how to change the eth numbers based on that information :

#lspci -m
01:00.0 "Ethernet controller" "Broadcom Corporation" "Device 165f" "Dell" "Device 1f5b"
01:00.1 "Ethernet controller" "Broadcom Corporation" "Device 165f" "Dell" "Device 1f5b"
02:00.0 "Ethernet controller" "Broadcom Corporation" "Device 165f" "Dell" "Device 1f5b"
02:00.1 "Ethernet controller" "Broadcom Corporation" "Device 165f" "Dell" "Device 1f5b"

#ls -l /sys/class/net/eth*/device
lrwxrwxrwx 1 root root 0 Oct 19 18:58 /sys/class/net/eth0/device -> ../../../devices/pci0000:00/0000:00:01.0/0000:02:00.0
lrwxrwxrwx 1 root root 0 Oct 19 18:58 /sys/class/net/eth1/device -> ../../../devices/pci0000:00/0000:00:01.0/0000:02:00.1
lrwxrwxrwx 1 root root 0 Oct 19 18:58 /sys/class/net/eth2/device -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.0
lrwxrwxrwx 1 root root 0 Oct 19 18:58 /sys/class/net/eth3/device -> ../../../devices/pci0000:00/0000:00:01.1/0000:01:00.1

Thank you in advance

malekmustaq 10-19-2012 12:01 PM

Have you tried creating a udev-net-rules to control the naming of the device links?

A short read of this page may help and this one too for debian.

Hope that helps.



JaseP 10-19-2012 12:09 PM

You'll need a udev rule...

See this for an example;
It's on SuSE, but the principle should be the same...

akiuni 10-19-2012 12:10 PM

yes, thank you malekmustaq, I've forget to say that I can't base my solution on MAC addresses because I'll have to apply my patch on a lot of servers...

JaseP 10-19-2012 12:16 PM


Here's,an example closer to what you want;

akiuni 10-22-2012 11:01 AM

yes, thanks a lot JaseP, that's exactly what I was looking for !
It worked well

thanks again

All times are GMT -5. The time now is 04:03 AM.