CentOS7.2重启网卡失败已解决

1使用vi  /etc/sysconfig/network-scripts/ifcfg-eno16777736,BOOTPROTO默认设置dhcp若想设置静态的改为static,ONROOT设置为yes,ifcfg-eno16777736中我的先前是没有HWADDR的,所以要加上,可使用ip addr 查看自己的。

CentOS7.2重启网卡失败已解决_第1张图片CentOS7.2重启网卡失败已解决_第2张图片

2.删除network-scripts中有ifcfg-xxx,只留一个ifcfg-enough16777736.

3.转载小灰灰1234:https://blog.csdn.net/selfsojourner/article/details/72510432 

systemctl stop NetworkManager

systemctl disable NetworkManager

Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

重新启动网络:

systemctl start network.service

ifconfig |grep eno

eno16777736: flags=4163  mtu 1500

inet 192.168.1.192  netmask 255.255.255.0  broadcast 192.168.1.255

inet6 fe80::20c:29ff:fe3d:b305  prefixlen 64  scopeid 0x20

ether 00:0c:29:3d:b3:05  txqueuelen 1000  (Ethernet)

RX packets 2  bytes 120 (120.0 B)

RX errors 0  dropped 0  overruns 0  frame 0

TX packets 22  bytes 3551 (3.4 KiB)

TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

网络正常启动,访问正常。

4.也是查了网上好多人写的都试着改了改,捣鼓好几天,最后重启下ok

在转载一下一路前行1:http://blog.csdn.net/weiyongle1996/article/details/75128239 

 

 

你可能感兴趣的:(CentOS7.2重启网卡失败已解决)