Forum Navigation
You need to log in to create posts and topics.

Rename Network interface without rebooting


User wants to rename the network interface name on cent0s7/8 without rebooting.

One of the reasons is to create network compatibility for applications like kubernetes who looks for identical hardware on all nodes


run the following commands to rename the network interface. rename and set accordingly

ip link set ens192 down
ip link set ens192 name eth0
ip link set eth0 up

mv /etc/sysconfig/network-scripts/ifcfg-{ens192,eth0}
sed -ire “s/NAME=\”ens192\”/NAME=\”eth0\”/” /etc/sysconfig/network-scripts/ifcfg-eth0
sed -ire “s/DEVICE=\”ens192\”/DEVICE=\”eth0\”/” /etc/sysconfig/network-scripts/ifcfg-eth0
MAC=$(cat /sys/class/net/eth0/address)
echo -n ‘HWADDR=”‘$MAC\” >> /etc/sysconfig/network-scripts/ifcfg-eth0


Uploaded files:

With rebooting option and permanently

edit the file


and set the name and the device for the new name. for example: eth0

edit the file


and set GATEWAYDEV to the new name