Personal tools
You are here: Home Networking Linux systemd systemd-networkd v219 with a single static interface on a CentOS VM

systemd-networkd v219 with a single static interface on a CentOS VM

Notes on setting up a single ethernet interface with a static IPv4 and IPv6 addresses. The aim is to have a lightweight virtual machine that boots simply and quickly.


Network Manager

Remove network manager.

# yum erase NetworkManager NetworkManager-libnm NetworkManager-glib


Install systemd packages

# yum install systemd-networkd systemd-resolved

Configure the single network interface with a static address:

# mkdir -p /etc/systemd/network
# cat > /etc/systemd/network/<<EOF




DNS=fd0c:898b:471c:2::5 fd0c:898b:471c:c::2 



Note:  The IPv6 link local gateway does not support or require an interface specified (i.e. a '%eth0' suffix).

Note: IPv6AcceptRouterAdvertisements=no is not valid for systemd v219

Enable and start the 'networkd' and 'resolved' services:

# for S in networkd resolved ; do systemctl enable systemd-$S ; systemctl start systemd-$S ; done


# rm /etc/resolv.conf
# ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf





# yum install systemd-networkd systemd-resolved
Resolving Dependencies
--> Running transaction check
---> Package systemd-networkd.x86_64 0:219-19.el7_2.7 will be installed
---> Package systemd-resolved.x86_64 0:219-19.el7_2.7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

 Package                    Arch             Version                   Repository         Size
 systemd-networkd           x86_64           219-19.el7_2.7            updates           423 k
 systemd-resolved           x86_64           219-19.el7_2.7            updates           395 k

Transaction Summary
Install  2 Packages

Total download size: 818 k
Installed size: 2.5 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): systemd-networkd-219-19.el7_2.7.x86_64.rpm                       | 423 kB  00:00:00
(2/2): systemd-resolved-219-19.el7_2.7.x86_64.rpm                       | 395 kB  00:00:00
Total                                                          798 kB/s | 818 kB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : systemd-networkd-219-19.el7_2.7.x86_64                                      1/2
  Installing : systemd-resolved-219-19.el7_2.7.x86_64                                      2/2
  Verifying  : systemd-resolved-219-19.el7_2.7.x86_64                                      1/2
  Verifying  : systemd-networkd-219-19.el7_2.7.x86_64                                      2/2

  systemd-networkd.x86_64 0:219-19.el7_2.7       systemd-resolved.x86_64 0:219-19.el7_2.7


networkd status

# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2016-04-05 22:59:16 NZST; 1min 55s ago
     Docs: man:systemd-networkd.service(8)
  Process: 439 ExecStart=/usr/lib/systemd/systemd-networkd (code=exited, status=0/SUCCESS)
 Main PID: 439 (code=exited, status=0/SUCCESS)
   Status: "Shutting down..."

Apr 05 22:58:44 systemd[1]: Starting Network Service...
Apr 05 22:58:44 systemd-networkd[439]: Enumeration completed
Apr 05 22:58:44 systemd[1]: Started Network Service.
Apr 05 22:58:44 systemd-networkd[439]: eth0            : gained carrier
Apr 05 22:58:44 systemd-networkd[439]: eth0            : link configured

resolved status

# systemctl status systemd-resolved
● systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/usr/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2016-04-05 22:37:31 NZST; 5min ago
     Docs: man:systemd-resolved.service(8)
 Main PID: 598 (systemd-resolve)
   Status: "Processing requests..."
   CGroup: /system.slice/systemd-resolved.service
           └─598 /usr/lib/systemd/systemd-resolved

Apr 05 22:37:31 systemd[1]: Starting Network Name Resolution...
Apr 05 22:37:31 systemd-resolved[598]: Using system hostname 
Apr 05 22:37:31 systemd-resolved[598]: Switching to system 
    DNS server fd0c:898b:471c:2::5.
Apr 05 22:37:31 systemd[1]: Started Network Name Resolution.


Document Actions