系统部署后:

    1. [root@rhel7 ~]# ip addr
    2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    4. inet 127.0.0.1/8 scope host lo
    5. valid_lft forever preferred_lft forever
    6. inet6 ::1/128 scope host
    7. valid_lft forever preferred_lft forever
    8. 2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    9. link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
    10. inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute ens192
    11. valid_lft forever preferred_lft forever
    12. inet6 fe80::320e:a836:3cd4:4f05/64 scope link noprefixroute
    13. valid_lft forever preferred_lft forever
    1. [root@rhel7 ~]# vim /etc/default/grub
    2. GRUB_TIMEOUT=5
    3. GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    4. GRUB_DEFAULT=saved
    5. GRUB_DISABLE_SUBMENU=true
    6. GRUB_TERMINAL_OUTPUT="console"
    7. GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=vg_root/lv_root rhgb quiet net.ifnames=0 biosdev
    8. name=0"
    9. GRUB_DISABLE_RECOVERY="true"
    10. ~
    11. ~
    12. [root@rhel7 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
    13. Generating grub configuration file ...
    14. Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
    15. Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
    16. Found linux image: /boot/vmlinuz-0-rescue-ad77f1e2f42144faa99b516f45825fc2
    17. Found initrd image: /boot/initramfs-0-rescue-ad77f1e2f42144faa99b516f45825fc2.img
    18. done
    19. [root@rhel7 ~]# mv /etc/sysconfig/network-scripts/ifcfg-ens192 /etc/sysconfig/network-scripts/ifcfg-eth0
    20. [root@rhel7 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
    21. TYPE=Ethernet
    22. PROXY_METHOD=none
    23. BROWSER_ONLY=no
    24. BOOTPROTO=none
    25. IPADDR=192.168.31.137
    26. PREFIX=24
    27. GATEWAY=192.168.31.1
    28. DNS1=114.114.114.114
    29. DEFROUTE=yes
    30. IPV4_FAILURE_FATAL=no
    31. IPV6INIT=yes
    32. IPV6_AUTOCONF=yes
    33. IPV6_DEFROUTE=yes
    34. IPV6_FAILURE_FATAL=no
    35. IPV6_ADDR_GEN_MODE=stable-privacy
    36. NAME=eth0
    37. UUID=fd572aa4-d20d-4f68-ab84-8df94a18c5a0
    38. DEVICE=eth0
    39. ONBOOT=yes
    1. [root@rhel7 ~]# ip addr
    2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    3. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    4. inet 127.0.0.1/8 scope host lo
    5. valid_lft forever preferred_lft forever
    6. inet6 ::1/128 scope host
    7. valid_lft forever preferred_lft forever
    8. 2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    9. link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
    10. inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute ens192
    11. valid_lft forever preferred_lft forever
    12. inet6 fe80::320e:a836:3cd4:4f05/64 scope link noprefixroute
    13. valid_lft forever preferred_lft forever
    14. [root@rhel7 ~]# nmcli connection show
    15. NAME UUID TYPE DEVICE
    16. ens192 fd572aa4-d20d-4f68-ab84-8df94a18c5a0 ethernet ens192
    1. [root@rhel7 ~]# reboot
    2. Connection closing...Socket close.
    3. Connection closed by foreign host.
    4. Disconnected from remote host(192.168.31.137:22) at 14:48:53.
    5. Type `help' to learn how to use Xshell prompt.
    6. [D:\~]$ ssh 192.168.31.137
    7. Connecting to 192.168.31.137:22...
    8. Connection established.
    9. To escape to local shell, press Ctrl+Alt+].
    10. Last login: Mon Apr 1 14:41:10 2019 from 192.168.31.173
    11. [root@rhel7 ~]# ip addr
    12. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    13. link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    14. inet 127.0.0.1/8 scope host lo
    15. valid_lft forever preferred_lft forever
    16. inet6 ::1/128 scope host
    17. valid_lft forever preferred_lft forever
    18. 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    19. link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
    20. inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute eth0
    21. valid_lft forever preferred_lft forever
    22. inet6 fe80::c9c4:d1aa:aa30:aec7/64 scope link noprefixroute
    23. valid_lft forever preferred_lft forever

    grub2-mkconfig -o /boot/grub2/grub.cfg 生成新的内核引导文件

    系统部署前:
    net.ifnames=0 biosdevname=0

    选择“Install RHEL 7”,按tab键修改内核参数,加入net.ifnames=0 biosdevname=0 回车开始安装系统。
    image.png