[root@localhost ~]# cd /etc/sysconfig/network-scripts
[root@localhost network-scripts]# ls
ifcfg-ens33 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
ifdown-post ifup-eth ifup-sit
[root@localhost network-scripts]# vim ifcfg-ens33 #最后一个选项 no 改为yes 保存退出 ONBOOT=no 改为ONBOOT=yes
[root@localhost network-scripts]# systemctl restart network
[root@localhost network-scripts]# ping www.baidu.com
PING www.a.shifen.com (() bytes of data.
bytes ttl= time=25.0 ms
bytes ttl= time=25.0 ms
bytes ttl= time=25.0 ms
bytes ttl= time=25.0 ms
bytes ttl= time=24.5 ms
^C
--- www.a.shifen.com ping statistics ---
packets transmitted, received, % packet loss, time 13035ms