Renaming a NIC on SUSE and openSUSE

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.

This entry was posted in Linux, Orat-oret and tagged , , . Bookmark the permalink.

0 Responses to Renaming a NIC on SUSE and openSUSE

  1. Pingback: yvyzotuvuz

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:)) :) :D (LOL) :-P (woot) ;-) :-o X-( ;-( :-& (angry) (annoyed) (bye) B-) (cozy) (sick) (: (goodluck) (griltongue) (mmm) (hungry) (music) (tears) (tongue) (unsure) (highfive) (dance) (doh) (brokenheart) (drinking) (girlkiss) (rofl) (money) (rock) (nottalking) (party) (sleeping) (thinking) (bringit) (worship) (applause) 8-) (gym) (heart) (devil) (lmao) (banana_cool) (banana_rock) (evil_grin) (headspin) (heart_beat) (ninja) (haha) (evilsmirk) (bigeyes) (funkydance) (idiot) (lonely) (scenic) (hassle) (panic) (okok) (yahoo) (blush) (fish_hit) (muhaha) (muscle) (taser) (beer) (coffee) (banana_ninja) (goal) (fireworks) (smileydance) (dance_bzz) (rusian)