1

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: <LOOPBACK,UP,LOWER_UP> 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: <NO-CARRIER,BROADCAST,MULTICAST,UP> 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: <LOOPBACK,UP,LOWER_UP> 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: <BROADCAST,MULTICAST,UP,LOWER_UP> 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: <BROADCAST,MULTICAST> 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?

  • In my experience, you need to enable systemd-networkd before booting (which should only need to be done once). Then again, I think I tried to get networking working in a Debian container, but didn't get it, though it did work in Ubuntu 17.10 Artful. – jpkotta Aug 28 '18 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.