🔗
Networking concepts
  • Introduction
  • DNS
    • Introduction
    • DNS query
  • SSH
    • Introduction
    • Basics
    • SSH tunneling
      • Direct SSH tunnel
      • Reverse SSH tunnel
      • Dynamic SSH tunnel
    • SSH public key authentication
    • Port forwarding with virtual interface
    • sshd
    • scp/sftp
  • 🔫Networking tools
    • configuration & information
      • ip
      • netstat/netsh
      • ifconfig/ipconfig/iwconfig
      • arp
      • route
      • ps
      • ss
      • lsof
      • pgrep
      • nmcli
      • Information about services/processes & PID
    • monitoring & troubleshooting
      • ping
      • tracert/traceroute
      • mtr
      • iperf3
    • domain information
      • dig/nslookup
      • whois
      • host
    • capture & analysis
      • tcpdump
      • ngrep
      • wireshark
    • firewall & security
      • iptables
      • nft
    • services
      • dnsmasq
      • hostapd
      • RDP/VNC
      • ngrok
      • networking.service
      • NetworkManager.service
      • nginx
      • apache
      • nfs
    • miscellaneous
      • cURL
      • wget
      • netwox
      • netcat
      • openssl
      • socat
      • ftp
      • smbclient
    • proxy & tunneling
      • proxychains
    • Programming/scripting
      • Python
      • C
  • 🤩Interesting concepts
    • Simple tips & tricks
    • Network hole punching
    • SSH Over HTTPS
  • Network ports & services cheat sheet
    • 20/21/tcp ~ ftp
    • 22/tcp ~ ssh
    • 23/tcp ~ telnet
    • ...
  • For-fun projects
    • Raspberry pi + Windows machine experiments
Powered by GitBook
On this page
  • ifupdown section
  • Example configuration for a Debian-based machine
  1. Networking tools
  2. services

NetworkManager.service

Previousnetworking.serviceNextnginx

Last updated 16 days ago

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

This section contains ifupdown-specific options and thus only has effect when using the ifupdown plugin.

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=false

Since 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 eth0 interface in /etc/network/interfaces, NetworkManager will ignore it, and our machine will not be able to configure that interface:

# wrong configuration
iface eth0 inet dhcp

We 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
🔫
NetworkManager.conf: NetworkManager Reference Manual