How to remove old eth device in linux

At this  KB I try to explain how to remove an old ethernet device while you perform an  OS  backup recovery action or replace a broken  NIC. As you know when you plug in a new  NIC  to your server, Linux 'll name it next available ethernet name which is like  "ethx". This configuration  comes from  "/etc/udev/rules.d/70-persistent-net.rules" . As you see from the output of command which  I added below there is a  name and  MAC address for  Ethernet port. So when you restart your machine it 'll check this  MAC address and will name  Ethernet port as "eth0".

root@redhattemplate ~]# cat /etc/udev/rules.d/70-persistent-net.rules |grep eth
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:90:7a:8c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
[root@redhattemplate ~]#

In this scenario, we have a  backup server and we clone it from  VMware. But when we give power we observed that new device named  "eth1". But we want to change it to  "eth0".

Step 1: Take  a  backup  of the configuration file

root@redhattemplate ~]# cp  /etc/udev/rules.d/70-persistent-net.rules /root/

Step  2: Remove  Persistent-Net  File restart network service or reboot server.

-Reboot is recommended. Don't forget to apply this action plan while your application is down. It needs downtime.

root@redhattemplate ~]# rm /etc/udev/rules.d/70-persistent-net.rules

After the restart, your configuration file will be created again and your eth  device named  eth0 as first  backup server.

I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me

Related Post