Last login: Mon Jul 23 14:55:39 2018 [root@zzulichen ~]# [root@zzulichen ~]# [root@zzulichen ~]# [root@zzulichen ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:0c:29:7c:c4:be TYPE=Ethernet UUID=714d0211-05c8-40bb-9859-9b91c4d3a34b ONBOOT=no NM_CONTROLLED=yes BOOTPROTO=dhcp USERCTL=no PEERDNS=yes IPV6INIT=no [root@zzulichen ~]# sed -i 's#ONBOOT=no#ONBOOT=yes#g' cat /etc/sysconfig/network-scripts/ifcfg-eth0 sed: can't read cat: No such file or directory [root@zzulichen ~]# sed -i 's#ONBOOT=no#ONBOOT=yes#g' /etc/sysconfig/network-scripts/ifcfg-eth0 [root@zzulichen ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:0c:29:7c:c4:be TYPE=Ethernet UUID=714d0211-05c8-40bb-9859-9b91c4d3a34b ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp USERCTL=no PEERDNS=yes IPV6INIT=no
(将ONBOOT从no改为yes,避免每一次开机都需要设置网卡)