SUSE Conversations


Renaming a NIC



By: Muhammad Sharfuddin

May 29, 2007 4:37 pm

Reads:127

Comments:0

Rating:0

by Muhammad Sharfuddin

Problem:

Say you have installed two NICs in your system e.g. eth0 and eth1 and sometime later you removed one of the nics from your machine, say, eth0.

Now you want to access the remaining nic, eth1, as eth0, or you want to simply name the existing nic (i.e. eth1) as eth0.

Solution:

Here are the steps to follow:

# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules

here you find a line as

SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth1"

simply change eth1, to eth0:

SUBSYSTEM==”net”, ACTION==”add”, SYSFS{address}==”00:02:b3:22:84:f3″, IMPORT=”/lib/udev/rename_netiface %k eth0″

Now execute the following command:

# /lib/udev/rename_netiface <old> <new>

i.e.

# /lib/udev/rename_netiface eth1 eth0
# rcnetwork start

DONE

We can give any valid name to our nic, say e.g. we want to rename our eth0 to lan0, then

# rcnetwork stop
# vi /etc/udev/rules.d/30-net_persistent_names.rules

here you find a line as

SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"

simply change eth1, to lan0:

SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k lan0"

Now execute the following command:

# /lib/udev/rename_netiface eth0 lan0

NOTE: If you gave your nic a name as lanX, nicX, or intX(i.e non ethX name), and then want to change the name from lan0 to eth0, all the above steps are required, and reboot too.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: As with everything else at SUSE Conversations, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

Comment

RSS