0

Ubuntu 18.04.4
lxd 3.0.3
lxc 3.0.3

I have had several containers running without issue for a long time. Today I was making changes to my network and one of the containers picked up a DHCP address.

user@localhost:/tmp$ sudo lxc list host_a
+-----------------------+---------+--------------------------+------+------------+-----------+
|         NAME          |  STATE  |           IPV4           | IPV6 |    TYPE    | SNAPSHOTS |
+-----------------------+---------+--------------------------+------+------------+-----------+
| host_a                | RUNNING | 192.168.112.5 (vlan112)  |      | PERSISTENT | 3         |
|                       |         | 192.168.11.8 (eth0)      |      |            |           |
|                       |         | 192.168.11.193 (eth0)    |      |            |           |
+-----------------------+---------+--------------------------+------+------------+-----------+

Interfaces 192.168.112.5 and 192.168.11.8 are original interfaces that have existed all along and need to remain. Interface 192.168.11.193 is the interface that appeared today during network changes and what I can't find to remove. I don't find it in the container and I can't figure how to remove it via lxc. I resorted to rebooting the container and the lxd host yet it remains.

user1801810
  • 133
  • 5

1 Answers1

0

It turns out that when dhcpcd is installed, as it is on this host, it can still assign get an additional address assigned. Either remove or disable dhcpcd or add denyinterfaces <interface name> (in my case denyinterfaces eth0) to /etc/dhcpcd.conf. This was the proposed/tested/accepted answer in https://askubuntu.com/questions/1329454/remove-secondary-dhcp-ip-address.

user1801810
  • 133
  • 5