2

I'm having an issue with networking in a systemd nspawn container.

I have enabled the -n / --network-veth option in the systemd-nspawn command. This has worked a few hours ago (I know that because I downloaded some stuff). However, I did some things on the host and the container (which unfortunately I can't remember mostly, it involved some rebooting, messing with the webserver which should not interfere here and some other stuff) and now when I came back, it didn't work anymore.

The host system is a CentOS 7, container is put into effect using Arch Linux.


ip link on the host

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
link/ether 0c:c4:7a:4b:11:3e brd ff:ff:ff:ff:ff:ff
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT qlen 1000
link/ether 0c:c4:7a:4b:11:3f brd ff:ff:ff:ff:ff:ff
4: ve-private@if2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT qlen 1000
link/ether 76:de:ce:fa:fd:49 brd ff:ff:ff:ff:ff:ff link-netnsid 0

Should the ve-private not be UP?


On the client:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default 
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: host0@if4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether ce:1a:92:1b:95:22 brd ff:ff:ff:ff:ff:ff link-netnsid 0

when I set host0 up, it changes to

1: the same as above...
2: host0@if4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether ce:1a:92:1b:95:22 brd ff:ff:ff:ff:ff:ff link-netnsid 0

Unfortunately I'm not very experienced with networking. What kind of information can I get you apart from the ip link output? I don't know where to start here, any ideas are highly appreciated.

Yorrd
  • 143
  • 1
  • 5

2 Answers2

1

Verify in your container that the service systemd-networkd is enabled and running.
You can do this by executing systemctl status systemd-networkd inside your container.
If the service is only loaded but not active (running) you have to enable it with systemctl enable systemd-networkd and restart your container.


In reply to your comment:

Apparently I have to start it WITHOUT --network-veth? It's working now, but I don't understand it anymore so I won't mark this as accepted. Feel free to post something useful.

When you removed --network-veth it also removed the implicit option --private-network which in turn made every interface of your host available to your container.
At this point ip a should show the same result on host and container.

Ludwig Behm
  • 161
  • 7
0

Apparently I have to start it WITHOUT --network-veth? It's working now, but I don't understand it anymore so I won't mark this as accepted. Feel free to post something useful.

Yorrd
  • 143
  • 1
  • 5