First go into /etc/udev/rules.d/
Vi and Vim commands
$ sudo vi /etc/udev/rules.d/70-persistent-net.rules
![]() |
/etc/udev/rules.d/70-persistent-net.rules |
For example, above I want to delete the old eth0 entry and then find the eth1 device I am still using but wish to rename and change the NAME parameter from eth1 back to eth0.
So make your adjustments or removals in 70-persistent-net.rules and then go to /etc/sysconfig/network-scripts where you will alter and rename the ifcfg-eth1 file.
$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth1
![]() |
eth1 renamed to eth0 |
$ sudo mv /etc/sysconfig/network-scripts/ifcfg-eth1 /etc/sysconfig/network-scripts/ifcfg-eth0
Or write a new file completely with contents similar to below
TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
IPADDR=192.168.0.100
GATEWAY=192.168.0.1
BROADCAST=192.168.0.255
HWADDR=6C:F0:49:09:47:17
NETMASK=255.255.255.0
ONBOOT=yes
ONHOTPLUG=yes
PEERDNS=no
USERCTL=yes
IPV6INIT=no
Which are typical parameters for someone using a static IP address on a wired ethernet card. Finally, issue the command
$ sudo service network restart
Or reboot your system to enable the new named device.
The interface name of a network device increases if the mac address of the physical or virtual network card changes. A common case is if you made a clone of a virtual machine for example via VMware or KVM or replaced a physical network card in a non virtualized server http://namhuy.net/376/change-network-device-name-from-eth1-back-to-eth0.html
ReplyDeleteIt increments appropriately according to each address change.
ReplyDeleteVery Interesting article..
ReplyDeleteJava Course Online
J2EE training