我安装的是ubuntu桌面版,使用网络管理器,配置网络,现在想使用配置文件配置网络,但是使用service network-manager stop命令停止网络管理器之后,修改配置文件,重启网络服务之后,网络配置还是原来网络管理器所配置的,请问怎样才能使用配置文件进行配置

shuixingxundao 配置 OpenStack 实验... 06月04日提问

  • 0 回答
  • 110 浏览

root@controller:/var/lib/NetworkManager# service network-manager stop

root@controller:/var/lib/NetworkManager# service network-manager status

● NetworkManager.service - Network Manager

   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)

   Active: inactive (dead) since Mon 2019-06-03 22:30:18 PDT; 4s ago

     Docs: man:NetworkManager(8)

  Process: 4899 ExecStart=/usr/sbin/NetworkManager --no-daemon (code=exited, status=0/SUCCESS)

 Main PID: 4899 (code=exited, status=0/SUCCESS)

   CGroup: /system.slice/NetworkManager.service

           └─1016 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0

Jun 03 22:25:01 controller NetworkManager[4899]: <info>  [1559625901.6588] manager: NetworkManager state is now CONNECTED_GLOBAL

Jun 03 22:25:01 controller NetworkManager[4899]: <info>  [1559625901.6772] urfkill disappeared from the bus

Jun 03 22:25:01 controller NetworkManager[4899]: <info>  [1559625901.7231] ofono is now available

Jun 03 22:25:01 controller NetworkManager[4899]: <warn>  [1559625901.7241] failed to enumerate oFono devices: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono wa

Jun 03 22:25:11 controller NetworkManager[4899]: <info>  [1559625911.8672] manager: WiFi hardware radio set enabled

Jun 03 22:25:11 controller NetworkManager[4899]: <info>  [1559625911.8682] manager: WWAN hardware radio set enabled

Jun 03 22:30:18 controller NetworkManager[4899]: <info>  [1559626218.3450] caught SIGTERM, shutting down normally.

Jun 03 22:30:18 controller NetworkManager[4899]: <info>  [1559626218.3479] exiting (success)

Jun 03 22:30:18 controller systemd[1]: Stopping Network Manager...

Jun 03 22:30:18 controller systemd[1]: Stopped Network Manager.

root@controller:/var/lib/NetworkManager# service networking restart

root@controller:/var/lib/NetworkManager# ifconfig 

ens33     Link encap:Ethernet  HWaddr 00:0c:29:c3:5e:59  

          inet addr:192.168.1.30  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::20c:29ff:fec3:5e59/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3700 errors:0 dropped:0 overruns:0 frame:0

          TX packets:2359 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:352538 (352.5 KB)  TX bytes:401775 (401.7 KB)

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:378 errors:0 dropped:0 overruns:0 frame:0

          TX packets:378 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:28286 (28.2 KB)  TX bytes:28286 (28.2 KB)