Enabling networking in a systemd-nspawn container
3
votes
2
answers
3320
views
I'm trying to setup container that has access to the internet but have been unsuccessful so far.
# sudo systemd-nspawn -nb -M debian-tree
# systemctl enable --now systemd-networkd systemd-resolved
# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
# ip link
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: host0@if8: mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
link/ether 42:ca:d5:8c:af:60 brd ff:ff:ff:ff:ff:ff link-netnsid 0
# ping google.com
ping: google.com: Temporary failure in name resolution
On the host
# ip link
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlp1s0: mtu 1500 qdisc mq state UP mode DORMANT group default qlen 1000
link/ether 7c:7a:91:ae:7d:47 brd ff:ff:ff:ff:ff:ff
8: ve-debian-tree@if2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 92:f7:e1:4b:c6:6f brd ff:ff:ff:ff:ff:ff link-netnsid 0
Any ideas why it's not working?
Asked by Ava
(143 rep)
Jul 27, 2017, 11:15 PM
Last activity: Jul 13, 2025, 11:06 PM
Last activity: Jul 13, 2025, 11:06 PM