First, thanks to Major Hayden for his blog post which pointed out the use of systemd-resolved:
So, now we have the possibility to use systemd-networkd under ubuntu 18.04, I’d like to use it also under CentOS 7.
And yes, we can.
yum -y install systemd-networkd
Disable network manager and enable networkd and resolved:
systemctl disable network NetworkManager systemctl enable systemd-networkd systemd-resolved
Save the following contents to
[Match] Name=eth* [Network] DHCP=yes IPv6AcceptRA=yes
(On my server the interface was no longer called ens3 but now eth0, hence the
Now create a symlink to the systemd-resolved resolv.conf:
rm -f /etc/resolv.conf ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
And just to be sure, reboot 🙂
Now we have it up and running:
[root@el7 ~]# networkctl IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 eth0 ether routable configured 2 links listed. [root@el7 ~]# networkctl status eth0 ● 2: eth0 Link File: n/a Network File: /etc/systemd/network/99-wildcard.network Type: ether State: routable (configured) Path: pci-0000:00:03.0 Driver: virtio_net Vendor: Red Hat, Inc. Model: Virtio network device HW Address: 1e:00:85:00:1b:5a MTU: 1500 Address: 18.104.22.168 2a00:f10:121:b00:1c00:85ff:fe00:1b5a fe80::1c00:85ff:fe00:1b5a Gateway: 22.214.171.124 (ICANN, IANA Department) fe80::d6ca:6dff:fe74:870d (Routerboard.com) DNS: 126.96.36.199 188.8.131.52