centos 网卡无法链接的问题

[root@localhost~]# systemctl stop NetworkManager
[root@localhost~]# 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.
[root@localhost~]# service network restart

重启网络
systemctl restart network

 

 

1. 执行下面的命令,将导致ifconfig出现ens33,但没有ip地址

ifconfig ens33 up

2. 执行下面的命令

systemctl stop NetworkManager
ifup ens33

3. 重启网络

systemctl restart network.service

4. 此时执行ifconfig发现ens33已经有了ip地址

5. 最后一步:永久关闭NetworkManager,保证下次开机ens33会自启动

systemctl disable NetworkManager

 

posted @ 2022-06-16 09:12  吕晋峰  阅读(53)  评论(0编辑  收藏  举报