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

From KoanSoftware Wiki
Jump to: navigation, search
(Created page with "= Linux Network Managers and Configuration Files = Linux supports various network management systems, each designed for different use cases such as desktop environments, serv...")
 
Line 16: Line 16:
 
=== Example Connection File ===
 
=== Example Connection File ===
 
`/etc/NetworkManager/system-connections/wired-connection.nmconnection`
 
`/etc/NetworkManager/system-connections/wired-connection.nmconnection`
<syntaxhighlight lang="ini">
 
[connection]
 
id=wired-connection
 
type=ethernet
 
interface-name=enp0s3
 
  
[ipv4]
+
[connection]
method=auto
+
id=wired-connection
</syntaxhighlight>
+
type=ethernet
 +
interface-name=enp0s3
 +
 +
[ipv4]
 +
method=auto
  
 
== 2. systemd-networkd ==
 
== 2. systemd-networkd ==

Revision as of 06:28, 20 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` <syntaxhighlight lang="ini"> [Match] Name=enp0s3

[Network] DHCP=yes </syntaxhighlight>

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` <syntaxhighlight lang="bash"> auto lo iface lo inet loopback

auto enp0s3 iface enp0s3 inet dhcp </syntaxhighlight>

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` <syntaxhighlight lang="yaml"> network:

 version: 2
 ethernets:
   enp0s3:
     dhcp4: true

</syntaxhighlight>

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 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)

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` <syntaxhighlight lang="ini"> [General] PreferredTechnologies=ethernet,wifi SingleConnectedTechnology=true </syntaxhighlight>

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.  |
+-----------------------------+