Ubuntu 18.10 使用VMware克隆後,克隆後的機器再手動更改interfaces配置文件後沒法啓動網絡的解決辦法

克隆過程就略過了vim

配置interfaces網絡

root@client02:~# vim /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.244.11
netmask 255.255.255.0
gateway 192.168.244.2

保存以後重啓網絡服務會拋錯oop

root@client02:~# service networking restart 
Job for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.

折騰了一會,從熱心的網友的經驗中找到了解決辦法:spa

root@client02:~# vim /etc/NetworkManager/NetworkManager.conf 
[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false    #手動更改過interfaces配置文件後,這裏會變成false,將其改成true,而後使用service network-manager restart重啓後,使用ifconfig能夠看到手動設置的IP,且網絡恢復正常(這種方法針對Ubuntu Desktop,server中暫時不清楚是否可行?)

[device]
wifi.scan-rand-mac-address=no

這裏雖然恢復正常了,可是不明白的是,在centOS和RHEL系統中,通常這個Network-Manager在作實驗的時候是關閉的,也沒有影響到網絡,換到Ubuntu系統中就要啓動它,有點不明白。.net

參考:https://blog.csdn.net/qq_34706955/article/details/78051075?locationNum=10&fps=1rest

相關文章
相關標籤/搜索