Hey,

We have containers running Ubuntu 18.04 and netplan and systemd-networkd. The 
network
device is bridged on the LXD host so that the container is basically part of 
our local network.
The network device of the container gets its address from DHCP.

Each time when systemd-networkd is restarted in the container it gets a new IP 
address. And
not only that, the old IP address and the old routes have not been deleted.

To give an example. This is what I start with

root@mindmap:~# ip addr show dev eth0 scope global
35: eth0@if36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state 
UP group default qlen 1000
    link/ether 00:16:3e:e2:3a:9a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.16.16.161/22 brd 172.16.19.255 scope global dynamic eth0
       valid_lft 5911sec preferred_lft 5911sec
root@mindmap:~# ip route
default via 172.16.16.1 dev eth0 proto dhcp src 172.16.16.161 metric 100
172.16.16.0/22 dev eth0 proto kernel scope link src 172.16.16.161
172.16.16.1 dev eth0 proto dhcp scope link src 172.16.16.161 metric 100

Then after a restart of systemd-networkd

root@mindmap:~# ip addr show dev eth0 scope global
35: eth0@if36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state 
UP group default qlen 1000
    link/ether 00:16:3e:e2:3a:9a brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.16.16.161/22 brd 172.16.19.255 scope global dynamic eth0
       valid_lft 5829sec preferred_lft 5829sec
    inet 172.16.16.139/22 brd 172.16.19.255 scope global secondary dynamic eth0
       valid_lft 7200sec preferred_lft 7200sec
root@mindmap:~# ip route
default via 172.16.16.1 dev eth0 proto dhcp src 172.16.16.161 metric 100
default via 172.16.16.1 dev eth0 proto dhcp src 172.16.16.139 metric 100
172.16.16.0/22 dev eth0 proto kernel scope link src 172.16.16.161
172.16.16.1 dev eth0 proto dhcp scope link src 172.16.16.161 metric 100
172.16.16.1 dev eth0 proto dhcp scope link src 172.16.16.139 metric 100

I realize that this could be a systemd issue, however I only see the problem in 
an LXC container.
So far I haven't been able to reproduce this problem on a normal (non-LXC)
system, or in virtualbox.

BTW. In the captured network packets I see something strange. When the DHCP
sees the DISCOVER it pings the "old" IP address, and it gets an answer from the
container. Well, it shouldn't get an answer.
-- 
Kees Bakker

Attachment: pEpkey.asc
Description: application/pgp-keys

_______________________________________________
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Reply via email to