NetworkManager.service
This service is integrated with the nmcli tool.
Configuration file: /etc/NetworkManager/NetworkManager.conf.
The following /etc/NetworkManager/NetworkManager.conf file is retrieved from a Kali Linux machine:
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
ifupdown section
ifupdown sectionThis section contains ifupdown-specific options and thus only has effect when using the
ifupdownplugin.
managed
If set to true, then interfaces listed in /etc/network/interfaces are managed by NetworkManager. If set to false, then any interface listed in /etc/network/interfaces will be ignored by NetworkManager. Remember that NetworkManager controls the default route, so because the interface is ignored, NetworkManager may assign the default route to some other interface.
The default value is false.
Example configuration for a Debian-based machine
Given that we have a Linux machine with an eth0 interface, and the following values in the respective configuration files:
/etc/network/interfaces
source /etc/network/interfaces.d/*
#The loopback network interface
auto lo
iface lo inet loopback/etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=falseSince the managed field is set to false, NetworkManager will ignore the interfaces listed in /etc/network/interfaces. In this case, the lo interface will be ignored.
NOTE: If we were to include the
eth0interface in/etc/network/interfaces, NetworkManager will ignore it, and our machine will not be able to configure that interface:
# wrong configuration
iface eth0 inet dhcpWe can use the nmcli tool to view the status:
$ nmcli device status
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
lo loopback connected (externally) lo As a result, NetworkManager will automatically configure DHCP and DNS for our machine. To view DHCP and DNS configurations respectively:
DHCP:
$ ifconfig
# notice the inet field
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.22.6 netmask 255.255.255.0 broadcast 10.0.22.255
...
DNS:
$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver [configured_nameserver_addr] # will usually be the router gateway or VPN DNS server
Last updated