rename eth2 to eth0

Asked by Matthias Metzger

Hi,

I upgraded to Jaunty Alpha 5 and then eth0 was changed to eth2.
My wlan was first eth1 and changed now to wlan0 (that's very good).
How can I change eth2 back to eth0? I know I have to modify the file /etc/udev/rules.d/70-persistent-net.rules, but what exactly.
Here is the content of my file:
cat /etc/udev/rules.d/70-persistent-net.rules

# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x8086:0x4222 (ipw3945)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:1c:bf:49:f0:fa", ATTR{type}=="1", NAME="eth1"

# PCI device 0x14e4:0x170c (b44)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:1c:23:b1:b9:8d", ATTR{type}=="1", NAME="eth0"

# PCI device 0x14e4:0x170c (b44)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1c:23:b1:b9:8d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x8086:0x4222 (iwl3945)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1c:bf:49:f0:fa", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

Thanks
Matthias

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Ruddock
Solved:
Last query:
Last reply:
Revision history for this message
Bhavani Shankar (bhavi) said :
#1

Its simple

Edit /etc/iftab and swap the names eth2 and eth0 and reboot:

sudo gedit /etc/iftab

Revision history for this message
Best Andy Ruddock (andy-ruddock) said :
#2

Is /etc/iftab new to Jaunty?

If you don't have /etc/iftab then the changes to make to /etc/udev/rules.d/70-persistent-net.rules are as follows :
1. Remove the first two "PCI devices" entries.
2. Change the interface name from eth2 to eth0 in the remaining entry for "PCI device 0x14e4:0x170c (b44)"
3. Reboot

Your /etc/udev/rules.d/70-persistent-net.rules will now look like :

# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x14e4:0x170c (b44)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1c:23:b1:b9:8d", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x4222 (iwl3945)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:1c:bf:49:f0:fa", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

Revision history for this message
Andy Ruddock (andy-ruddock) said :
#3

Quick google reports that /etc/iftab is old and superceded by the udev rules.

Revision history for this message
Matthias Metzger (macellarius) said :
#4

Thanks Andy Ruddock, that solved my question.