系统部署后:
[root@rhel7 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 fe80::320e:a836:3cd4:4f05/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@rhel7 ~]# vim /etc/default/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="crashkernel=auto rd.lvm.lv=vg_root/lv_root rhgb quiet net.ifnames=0 biosdev
name=0"
GRUB_DISABLE_RECOVERY="true"
~
~
[root@rhel7 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-ad77f1e2f42144faa99b516f45825fc2
Found initrd image: /boot/initramfs-0-rescue-ad77f1e2f42144faa99b516f45825fc2.img
done
[root@rhel7 ~]# mv /etc/sysconfig/network-scripts/ifcfg-ens192 /etc/sysconfig/network-scripts/ifcfg-eth0
[root@rhel7 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.31.137
PREFIX=24
GATEWAY=192.168.31.1
DNS1=114.114.114.114
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=fd572aa4-d20d-4f68-ab84-8df94a18c5a0
DEVICE=eth0
ONBOOT=yes
[root@rhel7 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 fe80::320e:a836:3cd4:4f05/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@rhel7 ~]# nmcli connection show
NAME UUID TYPE DEVICE
ens192 fd572aa4-d20d-4f68-ab84-8df94a18c5a0 ethernet ens192
[root@rhel7 ~]# reboot
Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.31.137:22) at 14:48:53.
Type `help' to learn how to use Xshell prompt.
[D:\~]$ ssh 192.168.31.137
Connecting to 192.168.31.137:22...
Connection established.
To escape to local shell, press Ctrl+Alt+].
Last login: Mon Apr 1 14:41:10 2019 from 192.168.31.173
[root@rhel7 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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 group default qlen 1000
link/ether 00:0c:29:aa:46:1d brd ff:ff:ff:ff:ff:ff
inet 192.168.31.137/24 brd 192.168.31.255 scope global noprefixroute eth0
valid_lft forever preferred_lft forever
inet6 fe80::c9c4:d1aa:aa30:aec7/64 scope link noprefixroute
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 回车开始安装系统。