Difference between revisions of "Linux Network Managers and Configuration Files"

From KoanSoftware Wiki
Jump to: navigation, search
 
Line 5: Line 5:
 
== 1. NetworkManager ==
 
== 1. NetworkManager ==
  
NetworkManager is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. It is widely used in desktop Linux distributions such as Ubuntu, Fedora, and others.
+
'''NetworkManager''' is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. It is widely used in desktop Linux distributions such as Ubuntu, Fedora, and others.
  
* '''Service''': `NetworkManager`
+
* '''Service''': NetworkManager
* '''CLI Tools''': `nmcli`, `nmtui`
+
* '''CLI Tools''': nmcli, nmtui
 
* '''Main Configuration Files''':
 
* '''Main Configuration Files''':
** `/etc/NetworkManager/NetworkManager.conf` – Main configuration file.
+
** /etc/NetworkManager/NetworkManager.conf – Main configuration file.
** `/etc/NetworkManager/system-connections/` – Directory containing individual connection profiles.
+
** /etc/NetworkManager/system-connections/ – Directory containing individual connection profiles.
** `/var/lib/NetworkManager/` – Runtime data.
+
** /var/lib/NetworkManager/ – Runtime data.
  
 
=== Example Connection File ===
 
=== Example Connection File ===
`/etc/NetworkManager/system-connections/wired-connection.nmconnection`
+
 
 +
'''/etc/NetworkManager/system-connections/wired-connection.nmconnection'''
  
 
  [connection]
 
  [connection]
Line 27: Line 28:
 
== 2. systemd-networkd ==
 
== 2. systemd-networkd ==
  
`systemd-networkd` is a system service that manages networks. It detects and configures network devices as they appear and can also create virtual network devices.
+
'''systemd-networkd''' is a system service that manages networks. It detects and configures network devices as they appear and can also create virtual network devices.
  
* '''Service''': `systemd-networkd`
+
* '''Service''': systemd-networkd
* '''CLI Tools''': `networkctl`, `systemctl`
+
* '''CLI Tools''': networkctl, systemctl
 
* '''Main Configuration Files''':
 
* '''Main Configuration Files''':
** `/etc/systemd/network/*.network` – Match and configure physical interfaces.
+
** /etc/systemd/network/*.network – Match and configure physical interfaces.
** `/etc/systemd/network/*.netdev` – Configuration for virtual devices.
+
** /etc/systemd/network/*.netdev – Configuration for virtual devices.
  
 
=== Example Network File ===
 
=== Example Network File ===
`/etc/systemd/network/20-wired.network`
+
'''/etc/systemd/network/20-wired.network'''
<syntaxhighlight lang="ini">
+
 
[Match]
+
[Match]
Name=enp0s3
+
Name=enp0s3
 +
 +
[Network]
 +
DHCP=yes
  
[Network]
 
DHCP=yes
 
</syntaxhighlight>
 
  
 
== 3. ifupdown (traditional Debian tool) ==
 
== 3. ifupdown (traditional Debian tool) ==
  
`ifupdown` is the classic network configuration tool used in older Debian and Ubuntu systems. It is gradually being replaced by newer systems like NetworkManager or `systemd-networkd`.
+
'''ifupdown''' is the classic network configuration tool used in older Debian and Ubuntu systems. It is gradually being replaced by newer systems like NetworkManager or systemd-networkd.
  
* '''Service''': No dedicated service (scripts run via `ifup`/`ifdown`)
+
* '''Service''': No dedicated service (scripts run via ifup/ifdown)
* '''CLI Tools''': `ifup`, `ifdown`
+
* '''CLI Tools''': ifup, ifdown
 
* '''Main Configuration File''':
 
* '''Main Configuration File''':
** `/etc/network/interfaces`
+
** /etc/network/interfaces
  
 
=== Example Interfaces File ===
 
=== Example Interfaces File ===
`/etc/network/interfaces`
+
'''/etc/network/interfaces'''
<syntaxhighlight lang="bash">
+
 
auto lo
+
auto lo
iface lo inet loopback
+
iface lo inet loopback
 +
 +
auto enp0s3
 +
iface enp0s3 inet dhcp
  
auto enp0s3
 
iface enp0s3 inet dhcp
 
</syntaxhighlight>
 
  
 
== 4. netplan ==
 
== 4. netplan ==
  
Netplan is a utility for configuring networking on modern Ubuntu systems (17.10 and later). It abstracts configuration and delegates to either NetworkManager or `systemd-networkd`.
+
'''Netplan''' is a utility for configuring networking on modern Ubuntu systems (17.10 and later). It abstracts configuration and delegates to either NetworkManager or systemd-networkd.
  
 
* '''Service''': Depends on backend (NetworkManager or systemd-networkd)
 
* '''Service''': Depends on backend (NetworkManager or systemd-networkd)
* '''CLI Tools''': `netplan apply`, `netplan try`
+
* '''CLI Tools''': netplan apply, netplan try
 
* '''Main Configuration Files''':
 
* '''Main Configuration Files''':
** `/etc/netplan/*.yaml`
+
** /etc/netplan/*.yaml
  
 
=== Example Netplan YAML File ===
 
=== Example Netplan YAML File ===
`/etc/netplan/01-netcfg.yaml`
+
'''/etc/netplan/01-netcfg.yaml'''
<syntaxhighlight lang="yaml">
+
 
network:
+
network:
  version: 2
+
  version: 2
  ethernets:
+
  ethernets:
    enp0s3:
+
    enp0s3:
      dhcp4: true
+
      dhcp4: true
</syntaxhighlight>
+
 
  
 
== 5. Wicd ==
 
== 5. Wicd ==
  
Wicd is a network connection manager that aims to provide a simple interface to connect to networks. It is now mostly obsolete but may still be found on lightweight systems.
+
'''Wicd''' is a network connection manager that aims to provide a simple interface to connect to networks. It is now '''mostly obsolete''' but may still be found on lightweight systems.
 +
 
 +
* '''Service''': wicd
 +
* '''CLI Tools''': wicd-curses, wicd-cli
 +
* '''Main Coniguration Files''':
 +
** /etc/wicd/ – Configuration directory
 +
** /etc/wicd/wireless-settings.conf – Wireless-specific configuration
 +
** /etc/wicd/wired-settings.conf – Wired-specific configuration
  
* '''Service''': `wicd`
 
* '''CLI Tools''': `wicd-curses`, `wicd-cli`
 
* '''Main Configuration Files''':
 
** `/etc/wicd/` – Configuration directory
 
** `/etc/wicd/wireless-settings.conf` – Wireless-specific configuration
 
** `/etc/wicd/wired-settings.conf` – Wired-specific configuration
 
  
 
== 6. ConnMan (Connection Manager) ==
 
== 6. ConnMan (Connection Manager) ==
  
ConnMan is a daemon for managing internet connections within embedded devices. It is lightweight and often used in systems with limited resources.
+
'''ConnMan''' is a daemon for managing internet connections within embedded devices. It is lightweight and often used in systems with limited resources.
  
* '''Service''': `connmand`
+
* '''Service''': connmand
* '''CLI Tools''': `connmanctl`
+
* '''CLI Tools''': connmanctl
 
* '''Main Configuration Files''':
 
* '''Main Configuration Files''':
** `/etc/connman/main.conf` – General configuration
+
** /etc/connman/main.conf – General configuration
** `/var/lib/connman/` – Profiles and saved settings
+
** /var/lib/connman/ – Profiles and saved settings
  
 
=== Example ConnMan Configuration ===
 
=== Example ConnMan Configuration ===
`/etc/connman/main.conf`
+
'''/etc/connman/main.conf'''
<syntaxhighlight lang="ini">
+
 
[General]
+
[General]
PreferredTechnologies=ethernet,wifi
+
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=true
+
SingleConnectedTechnology=true
</syntaxhighlight>
+
 
  
 
= Summary Table =
 
= Summary Table =

Latest revision as of 13:33, 21 June 2025

Linux Network Managers and Configuration Files

Linux supports various network management systems, each designed for different use cases such as desktop environments, servers, or embedded systems. Below is a summary of the most commonly used network managers along with their associated configuration files.

1. NetworkManager

NetworkManager is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. It is widely used in desktop Linux distributions such as Ubuntu, Fedora, and others.

  • Service: NetworkManager
  • CLI Tools: nmcli, nmtui
  • Main Configuration Files:
    • /etc/NetworkManager/NetworkManager.conf – Main configuration file.
    • /etc/NetworkManager/system-connections/ – Directory containing individual connection profiles.
    • /var/lib/NetworkManager/ – Runtime data.

Example Connection File

/etc/NetworkManager/system-connections/wired-connection.nmconnection

[connection]
id=wired-connection
type=ethernet
interface-name=enp0s3

[ipv4]
method=auto

2. systemd-networkd

systemd-networkd is a system service that manages networks. It detects and configures network devices as they appear and can also create virtual network devices.

  • Service: systemd-networkd
  • CLI Tools: networkctl, systemctl
  • Main Configuration Files:
    • /etc/systemd/network/*.network – Match and configure physical interfaces.
    • /etc/systemd/network/*.netdev – Configuration for virtual devices.

Example Network File

/etc/systemd/network/20-wired.network

[Match]
Name=enp0s3

[Network]
DHCP=yes


3. ifupdown (traditional Debian tool)

ifupdown is the classic network configuration tool used in older Debian and Ubuntu systems. It is gradually being replaced by newer systems like NetworkManager or systemd-networkd.

  • Service: No dedicated service (scripts run via ifup/ifdown)
  • CLI Tools: ifup, ifdown
  • Main Configuration File:
    • /etc/network/interfaces

Example Interfaces File

/etc/network/interfaces

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet dhcp


4. netplan

Netplan is a utility for configuring networking on modern Ubuntu systems (17.10 and later). It abstracts configuration and delegates to either NetworkManager or systemd-networkd.

  • Service: Depends on backend (NetworkManager or systemd-networkd)
  • CLI Tools: netplan apply, netplan try
  • Main Configuration Files:
    • /etc/netplan/*.yaml

Example Netplan YAML File

/etc/netplan/01-netcfg.yaml

network:
  version: 2
  ethernets:
    enp0s3:
      dhcp4: true


5. Wicd

Wicd is a network connection manager that aims to provide a simple interface to connect to networks. It is now mostly obsolete but may still be found on lightweight systems.

  • Service: wicd
  • CLI Tools: wicd-curses, wicd-cli
  • Main Coniguration Files:
    • /etc/wicd/ – Configuration directory
    • /etc/wicd/wireless-settings.conf – Wireless-specific configuration
    • /etc/wicd/wired-settings.conf – Wired-specific configuration


6. ConnMan (Connection Manager)

ConnMan is a daemon for managing internet connections within embedded devices. It is lightweight and often used in systems with limited resources.

  • Service: connmand
  • CLI Tools: connmanctl
  • Main Configuration Files:
    • /etc/connman/main.conf – General configuration
    • /var/lib/connman/ – Profiles and saved settings

Example ConnMan Configuration

/etc/connman/main.conf

[General]
PreferredTechnologies=ethernet,wifi
SingleConnectedTechnology=true


Summary Table

Network Manager Main Config File(s) CLI Tools Typical Use
NetworkManager /etc/NetworkManager/ nmcli, nmtui Desktop
systemd-networkd /etc/systemd/network/ networkctl Server, Embedded
ifupdown /etc/network/interfaces ifup, ifdown Legacy Debian/Ubuntu
netplan /etc/netplan/*.yaml netplan Ubuntu (modern)
Wicd /etc/wicd/ wicd-curses, wicd-cli Lightweight Desktop
ConnMan /etc/connman/ connmanctl Embedded Systems




+--------------------+
|   User Interface   |
|--------------------|
| nmcli / nmtui       <-- NetworkManager
| networkctl          <-- systemd-networkd
| netplan apply       <-- Netplan
+--------------------+

            ↓

+-----------------------------+
|   Configuration Files       |
|-----------------------------|
| /etc/netplan/*.yaml         <-- Netplan
| /etc/NetworkManager/*.conf  <-- NetworkManager
| /etc/systemd/network/*.network  <-- systemd-networkd
| /etc/network/interfaces     <-- ifupdown
+-----------------------------+

            ↓

+-----------------------------+
|  Network Managers (Daemons) |
|-----------------------------|
| NetworkManager.service
| systemd-networkd.service
| ifupdown (manual)
| connman.service
+-----------------------------+

            ↓

+-----------------------------+
|       Kernel/Drivers        |
|-----------------------------|
| Interface mgmt, DHCP, etc.  |
+-----------------------------+