修改配置文件
[root@bogon ~]# ifconfig
ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.183.133 netmask 255.255.255.0 broadcast 192.168.183.255
inet6 fe80::20c:29ff:fe12:80d6 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:12:80:d6 txqueuelen 1000 (Ethernet)
RX packets 2174 bytes 1961105 (1.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 815 bytes 64414 (62.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 36 bytes 3032 (2.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 36 bytes 3032 (2.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:cb:2a:2e txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@bogon ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens160
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=eui64
NAME=ens160
UUID=20270779-e880-431b-a8a2-a78c6914d830
DEVICE=ens160
ONBOOT=yes //改为yes
~
~
~
~
~
~
~
~
Type :qa! and pr...anges and exit Vim 15,9 全部
重启网络服务或者重启