Skip to content

Instantly share code, notes, and snippets.

@smijar
Last active December 10, 2021 02:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smijar/86c17992196873fbae12c57001e5fc88 to your computer and use it in GitHub Desktop.
Save smijar/86c17992196873fbae12c57001e5fc88 to your computer and use it in GitHub Desktop.
Steps on how to rename Centos 7 ethnxxxx interface to eth0
centos 7 setup-rename NIC to eth0
http://ask.xmodulo.com/change-network-interface-name-centos7.html
- This is achieved by editing /etc/default/grub and adding "net.ifnames=0" to GRUB_CMDLINE_LINUX variable.
- Then run this command to regenerate GRUB configuration with updated kernel parameters.
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- cat /sys/class/net/*/address
- 00:0c:29:e0:ad:52
- 00:00:00:00:00:00
- NOTE the mac address
- vi /etc/udev/rules.d/70-persistent-ipoib.rules
-
- replace the mac address in the line below to yours
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e0:ad:52”, ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
reboot
ip a
eth0:…..
- rename /etc/sysconfig/network-scripts/ifcfg-enxxx to ifcfg-eth0
- rename the DEVICE=enxxxx to DEVICE=eth0 in the above file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment