systemd-networkd inside systemd-nspawn/machinectl and interface status

Issues related to configuring your network
Post Reply
enp
Posts: 1
Joined: 2016/11/29 08:01:53

systemd-networkd inside systemd-nspawn/machinectl and interface status

Post by enp » 2016/11/29 08:15:51

Hi,

I'm trying to run container with centos and systemd-networkd inside systemd-nspawn/machinectl. Container directory was created by

Code: Select all

yum -y --nogpg --releasever=7 --installroot=/var/lib/machines/centos install systemd systemd-networkd iproute passwd yum vim-minimal
Network configured as:

Code: Select all

# cat /var/lib/machines/centos/etc/systemd/network/local.network 
[Match]
Name=mv-*
[Network]
Address=10.0.0.11/24
Gateway=10.0.0.1
After machinectl start centos and machinectl login centos I see:

Code: Select all

-bash-4.2# networkctl 
IDX LINK             TYPE               OPERATIONAL SETUP     
  1 lo               loopback           carrier     unmanaged 
  2 mv-enp4s0.10     ether              off         configured

2 links listed.
-bash-4.2# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
   Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2016-11-29 08:09:52 UTC; 29s ago
     Docs: man:systemd-networkd.service(8)
 Main PID: 21 (systemd-network)
   Status: "Processing requests..."
   CGroup: /machine.slice/systemd-nspawn@cs.service/system.slice/systemd-networkd.service
           └─21 /usr/lib/systemd/systemd-networkd

Nov 29 08:09:52 cs systemd[1]: Starting Network Service...
Nov 29 08:09:52 cs systemd-networkd[21]: mv-enp4s0.10    : Cannot configure IPv4 forwarding for interface mv-enp4s0.10: Read-only file system
Nov 29 08:09:52 cs systemd-networkd[21]: mv-enp4s0.10    : Cannot configure IPv6 forwarding for interface: No such file or directory
Nov 29 08:09:52 cs systemd-networkd[21]: Enumeration completed
Nov 29 08:09:52 cs systemd-networkd[21]: mv-enp4s0.10    : mv-enp4s0.10    : could not bring up interface: Address family not supported by protocol
Nov 29 08:09:52 cs systemd-networkd[21]: mv-enp4s0.10    : mv-enp4s0.10    : could not set route: Network is unreachable
Nov 29 08:09:52 cs systemd-networkd[21]: mv-enp4s0.10    : link configured
Nov 29 08:09:52 cs systemd[1]: Started Network Service.
-bash-4.2# ip link set mv-enp4s0.10 up
-bash-4.2# networkctl 
IDX LINK             TYPE               OPERATIONAL SETUP     
  1 lo               loopback           carrier     unmanaged 
  2 mv-enp4s0.10     ether              routable    configured

2 links listed.
So, why I need to up interface directly? Why it can be up by systemd-networkd or udev? I tried to add rule:

Code: Select all

# cat /var/lib/machines/centos/etc/udev/rules.d/10-net.rules 
SUBSYSTEM=="net", ACTION=="add", RUN+="/sbin/ip link set %k up"
but no success. So, what is the right way to bring interface up?

matt_garman
Posts: 40
Joined: 2006/10/18 14:14:21

Re: systemd-networkd inside systemd-nspawn/machinectl and interface status

Post by matt_garman » 2017/06/13 21:11:45

Bump... did you ever figure this out?

I've been trying to do similar things with CentOS and systemd-nspawn/systemd-networkd... I've lost track of everything I've tried, but can't get systemd-networkd to do anything useful. But I've had some success not using networkd and creating /etc/sysconfig/network-scripts/ifcfg-* files the old-fashioned way.

Post Reply