OS: SLES 10
One nic installed
# hwinfo --netcard
.
.
.
Device File: eth2
.
.
how can I change "eth2" to "eth0"?
say you have two nics installed on the system, eth0, and eth1.
At some times latter, you removed eth0 from the system.
Now eth1 is the only nic in your machine... and you want to rename this nic(eth1) as eth0.
following are the steps:
# 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, as eth0,
SUBSYSTEM=="net", ACTION=="add", SYSFS{address}=="00:02:b3:22:84:f3", IMPORT="/lib/udev/rename_netiface %k eth0"
save and exit
Now execute the following command
# /lib/udev/rename_netiface
i.e
# /lib/udev/rename_netiface eth1 eth0
# rcnetwork start
DONE
even we can give any valid name to our nic, say e.g we want to name our eth0 as 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, as 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:
say we gave our 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.
阅读(724) | 评论(0) | 转发(0) |