Skip to contentSkip to conversation

network interface names ethX and renaming interfaces

DISCUSSION Hein Roehrig 2 participants 2 messages Dec 6, 2001 – Dec 10, 2001

lore
Share & tools
lore
#0 lore raw

Hello *,

in Linux 2.2.20 I have a problem renaming the network interface dummy0 to eth0 and then starting a regular ethernet driver --- I would like it to come up as eth1 but it comes up as eth0, messing up the dummy0 interface.

Reading the source, it appears that in init_ethernev(), ethernet drivers claim device names according to the array ethdev_index and shoot down any device name eth0 claimed by a non-ethernet driver.

Therefore it appears to me that SIOCSIFNAME should either disallow renaming to ethX or it should adjust ethdev_index.

Thanks in advance for any comment/advice,
Hein

#1 lore raw
Quoted 8 lines · Hein Roehrig

in Linux 2.2.20 I have a problem renaming the network interface dummy0 to eth0 and then starting a regular ethernet driver --- I would like it to come up as eth1 but it comes up as eth0, messing up the dummy0 interface.

Reading the source, it appears that in init_ethernev(), ethernet drivers claim device names according to the array ethdev_index and shoot down any device name eth0 claimed by a non-ethernet driver.

I presume you are refering to init_etherdev() in drivers/net/net_init.c ?

Quoted 2 lines

Therefore it appears to me that SIOCSIFNAME should either disallow renaming to ethX or it should adjust ethdev_index.

I wonder why it doesn't either use dev_alloc_name() from net/core/dev.c , or implement similar logic?

Regards,
Neale.