NICの名前をeno16777736からeth0に変更(CentOS7)

GRUB_CMDLINE_LINUXに「net.ifnames=0 biosdevname=0」を追加
# cp /etc/sysconfig/grub{,.old}
# vi /etc/sysconfig/grub
# diff /etc/sysconfig/grub{,.old}

5c5
< GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet net.ifnames=0 biosdevname=0"
---
> GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"


grub2-mkconfigで設定ファイルの生成
# grub2-mkconfig -o /boot/grub2/grub.cfg

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-14915b50c1bc40d5b650d0480e4cc780
Found initrd image: /boot/initramfs-0-rescue-14915b50c1bc40d5b650d0480e4cc780.img
done


ネットワークインターフェイス設定ファイルの名前変更
# mv /etc/sysconfig/network-scripts/ifcfg-eno16777736 /etc/sysconfig/network-scripts/ifcfg-eth0
# sed 's/\(DEVICE=\).*/\1eth0/g' /etc/sysconfig/network-scripts/ifcfg-eth0 -i


OS再起動
# reboot


再起動後ネットワークインターフェイス確認
# ip a s

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:d1:6e:6a brd ff:ff:ff:ff:ff:ff
    inet 192.168.137.130/24 brd 192.168.137.255 scope global dynamic eth0
       valid_lft 88176sec preferred_lft 88176sec
    inet6 fe80::20c:29ff:fed1:6e6a/64 scope link 
       valid_lft forever preferred_lft forever