Change the NIC name in Centos 7
1. View IP addresses
[Root @ localhost ~] # Ip
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
Link/loopback 00: 00: 00: 00: 00: 00 brd 00: 00: 00: 00: 00: 00
Inet 127.0.0.1/8 scope host lo
Valid_lft forever preferred_lft forever
Inet6: 1/128 scope host
Valid_lft forever preferred_lft forever
2:Eno16777736: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
Link/ether 00: 0c: 29: 20: 53: b3 brd ff: ff
Inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic eno16777736
Valid_lft 6568sec preferred_lft 6568sec
Inet6 fe80: 20c: 29ff: fe20: 53b3/64 scope link
Valid_lft forever preferred_lft forever
3: eNo33554976: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
Link/ether 00: 0c: 29: 20: 53: bd brd ff: ff
Inet 192.168.1.113/24 brd 192.168.1.255 scope global dynamic eno33554976
Valid_lft 6569sec preferred_lft 6569sec
Inet6 fe80: 20c: 29ff: fe20: 53bd/64 scope link
Valid_lft forever preferred_lft forever
2. Modify the grub file and add a part of the red font to the file.
[Root @ localhost ~] # Vim/etc/sysconfig/grub
GRUB_TIMEOUT = 5
GRUB_DISTRIBUTOR = "$ (sed's, release. * $, G'/etc/system-release )"
GRUB_DEFAULT = saved
GRUB_DISABLE_SUBMENU = true
GRUB_TERMINAL_OUTPUT = "console"
GRUB_CMDLINE_LINUX = "rd. lvm. lv = VG00/swap vconsole. font = latarcyrheb-sun16 crashkernel = auto vconsole. keymap = us rd. lvm. lv = VG00/root rhgb quietNet. ifnames = 0 biosdevname = 0"
GRUB_DISABLE_RECOVERY = "true"
3. Create a New imgfile
[Root @ localhost ~] # Grub2-mkconfig-o/boot/grub2/grub. cfg
Generating grub configuration file...
Found linux image:/boot/vmlinuz-3.10.0-229.7.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-229.7.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-229.4.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-229.4.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-229.1.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-229.1.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-123.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-123.el7.x86_64.img
Found linux image:/boot/vmlinuz-3.10.0-123.13.2.el7.x86_64
Found initrd image:/boot/initramfs-3.10.0-123.13.2.el7.x86_64.img
Found linux image:/boot/vmlinuz-0-rescue-f16a3c5e4d1949dd87cf7fdc31231925
Found initrd image:/boot/initramfs-0-rescue-f16a3c5e4d1949dd87cf7fdc31231925.img
Done
4. Restart the server
[Root @ localhost ~] # Reboot
5. Check the IP address of the server again.
[Root @ localhost ~] # Ip
1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
Link/loopback 00: 00: 00: 00: 00: 00 brd 00: 00: 00: 00: 00: 00
Inet 127.0.0.1/8 scope host lo
Valid_lft forever preferred_lft forever
Inet6: 1/128 scope host
Valid_lft forever preferred_lft forever
2: eth0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
Link/ether 00: 0c: 29: 20: 53: b3 brd ff: ff
Inet 192.168.1.102/24 brd 192.168.1.255 scope global dynamic eth0
Valid_lft 7150sec preferred_lft 7150sec
Inet6 fe80: 20c: 29ff: fe20: 53b3/64 scope link
Valid_lft forever preferred_lft forever
3: eth1: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
Link/ether 00: 0c: 29: 20: 53: bd brd ff: ff
Inet 192.168.1.113/24 brd 192.168.1.255 scope global dynamic eth1
Valid_lft 7150sec preferred_lft 7150sec
Inet6 fe80: 20c: 29ff: fe20: 53bd/64 scope link
Valid_lft forever preferred_lft forever