Last active
December 10, 2021 02:32
-
-
Save smijar/86c17992196873fbae12c57001e5fc88 to your computer and use it in GitHub Desktop.
Steps on how to rename Centos 7 ethnxxxx interface to eth0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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