Systemd-networkd

From HPCWIKI
Jump to navigation Jump to search

Systemd-networkd

systemd-networkd is a system daemon that manages network, can detect and configure network devices and is also capable of creating virtual network devices configurations sinde 2010. systemd-network can be especially useful to set up complex network configurations for a container managed by systemd-nspawn or for virtual machines. This site explains technical details including system service dependencies of systemd-netword.


The default network management moved to netplan[1] from the Ubuntu 20.04 server, so admin is able to configure various network configuration by modifing /etc/netplan/*.yaml file and netplan commands.


To use systemd-networkd, start/enable systemd-networkd.service.

Relationship with netplan

There are two different network managers can be installed on the same system at the time this post is wrote. by default, HPCMATE's automated server setup script disabled NetworkManager to avoid potential confliction between systemd-networkd service.

Netplan-overview

Networkctl

Networkctl is a command line utility which has been developed in order to show a summary of the network devices in the system and their respective connection status, in addition, with networkctl it will be possible to consult and control the Linux network subsystem.[2][3]

$ networkctl --help
  status [PATTERN...]    Show link status
  lldp [PATTERN...]      Show LLDP neighbors
  label                  Show current address label entries in the kernel
  delete DEVICES...      Delete virtual netdevs
  renew DEVICES...       Renew dynamic configurations
  reconfigure DEVICES... Reconfigure interfaces
  reload                 Reload .network and .netdev files

Options:
  -h --help              Show this help
     --version           Show package version
     --no-pager          Do not pipe output into a pager
     --no-legend         Do not show the headers and footers
  -a --all               Show status for all links
  -s --stats             Show detailed link statics
  -l --full              Do not ellipsize output
  -n --lines=INTEGER     Number of journal entries to show

Netplan commands

netplan generate
Use /etc/netplan to generate the required configuration for the renderers.
netplan apply
Apply all configuration for the renderers, restarting them as necessary.
for debugging purpose, sudo netplan --debug apply
netplan try
Apply configuration and wait for user confirmation; will roll back if network is broken or no confirmation is given.
netplan get
Merge and display all the current available configuration on the system.
netplan set
Add new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=true.
netplan info
Show available feature flags of the currently installed version as YAML.
netplan ip
Retrieve IP information from the system.
netplan help
Show the help message.         

References