LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   need help to change eth numbers at boot time (https://www.linuxquestions.org/questions/linux-hardware-18/need-help-to-change-eth-numbers-at-boot-time-4175433074/)

akiuni 10-19-2012 10: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 :
append="netdev=irq=21,io=0x3000,name=eth0"
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
bests
Julien

malekmustaq 10-19-2012 11:01 AM

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.

Goodluck.

m.m.

JaseP 10-19-2012 11:09 AM

You'll need a udev rule...

See this for an example;
http://www.novell.com/support/kb/doc.php?id=3012993
It's on SuSE, but the principle should be the same...

akiuni 10-19-2012 11:10 AM

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 11:16 AM

OK,...

Here's,an example closer to what you want;
http://linux-tips.org/article/73/per...ming-with-udev

akiuni 10-22-2012 10:01 AM

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

thanks again
bests
Julien


All times are GMT -5. The time now is 09:29 AM.