Lead Image © Kritiya Sumpun, 123RF.com

Lead Image © Kritiya Sumpun, 123RF.com

networkd and nspawn in systemd

Startup Aid

Article from ADMIN 32/2016
By
Version 219 of the controversial init system, systemd, comes with a few major changes. We look at the new features in network management and container handling.

Most new features in the current systemd version relate to the networkd and nspawn components. Both have been part of systemd for some time, but they have been given added features in the new version to make working with them far easier in some cases.

Setting Up Bridge Devices

The systemd-networkd network manager can now handle a variety of different network devices; its feature set has been extended to provide better support for use in container environments. The following example shows how easy it is to use the daemon to set up, say, a bridge device. Networkd is not designed to replace the established Gnome Network Manager; instead, the daemon is designed for special environments, such as container hosts, or in embedded applications.

Listing 1 shows the preparations required to be able to use the new network manager. For name resolution, it relies on the LLMNR (Link-Local Multicast Name Resolution)-capable stub resolver, which is also part of the system package.

Listing 1

Basic Setup

systemctl enable systemd-networkd
systemctl disable NetworkManager
systemctl enable systemd-resolved
cp /etc/resolv.conf /etc/resolv.conf.bak
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
mkdir /etc/systemd/network

Listings 2 and 3 show the two configuration files for the normal Ethernet card (Listing 2) and the bridge device (Listing 3). You can decide which device is configured by these files by entering the device names or

...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus