2
host, container: fc21
$ systemctl start systemd-networkd.service
$ systemd-nspawn -b -D `pwd` -M m1 --private-network --network-veth
... In container:
$ systemctl start systemd-networkd.service
$ ip addr
2: host0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether c6:a1:72:9b:16:08 brd ff:ff:ff:ff:ff:ff
inet 169.254.215.78/16 brd 169.254.255.255 scope link host0
valid_lft forever preferred_lft forever
inet6 fe80::c4a1:72ff:fe9b:1608/64 scope link
valid_lft forever preferred_lft forever
-> container gets only an ipv4LL address, not a nice-looking dhcp-assigned one.
Why ?
On the host tcpdump -i v1-m1 shows the DHCP requests coming from the m1 container as per the systemd-networkd default configuration for interface host0:
$ sudo tcpdump -i ve-m1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ve-m1, link-type EN10MB (Ethernet), capture size 262144 bytes
11:57:18.768736 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from c6:a1:72:9b:16:08 (oui Unknown), length 271
11:57:19.757532 ARP, Request who-has 169.254.215.78 tell 0.0.0.0, length 28
On the host, strace of the systemd-networkd shows that it is listening on the UDP DHCP server port but never reading from it:
socket(PF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 12
setsockopt(12, SOL_IP, IP_TOS, [192], 4) = 0
setsockopt(12, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
setsockopt(12, SOL_IP, IP_PKTINFO, [1], 4) = 0
setsockopt(12, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
bind(12, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 12, {EPOLLIN, {u32=2522795824, u64=139692039130928}}) = 0
writev(2, [{"DHCP SERVER: STARTED", 20}, {"\n", 1}], 2) = 21
I checked that no other process is listening on the same udp port:
$ lsof |grep -i udp |grep -i bootps
systemd-n 16276 systemd-network 12u IPv4 265473 0t0 UDP *:bootps
Now that I have reached the end of my debugging skills. My question is: how can I debug this further ? i.e. is there a way to get information on where the dhcp request might get lost and why ?
You don't need the ".service"s. – None – 2015-07-20T16:03:35.013
1
I've filed a bug for this: https://github.com/t-woerner/firewalld/issues/35
– eliasp – 2015-07-29T11:37:50.047