Containers on bridged network lost IPs

networking

(Nathan Bass) #1

So I deleted my previous macvlan profile and built a bridge profile instead using a host bridge.
You can see the bridge and the ethernet interface as follows
ip link (abridged)

2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000
    link/ether b8:ca:3a:f5:89:1c brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether b8:ca:3a:f5:89:1c brd ff:ff:ff:ff:ff:ff

ip a (abridged)

2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000
    link/ether b8:ca:3a:f5:89:1c brd ff:ff:ff:ff:ff:ff
6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b8:ca:3a:f5:89:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.10/24 brd 192.168.42.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::baca:3aff:fef5:891c/64 scope link 
       valid_lft forever preferred_lft forever

lxc list (abridged)

+---------------+---------+------+------+------------+-----------+
|     NAME      |  STATE  | IPV4 | IPV6 |    TYPE    | SNAPSHOTS |
+---------------+---------+------+------+------------+-----------+
| dns           | RUNNING |      |      | PERSISTENT | 1         |
+---------------+---------+------+------+------------+-----------+

yesterday these were working fine, all the other devices on my network still work (both the static and dynamic ones), just for sanity I’ve restarted LXD, the containers, the host system and my network router but no change.

The above is a static assigned container (at the router) so again for sanity I did
lxc config show dns

architecture: x86_64
config:
  image.architecture: amd64
  image.description: ubuntu 18.04 LTS amd64 (release) (20190320)
  image.label: release
  image.os: ubuntu
  image.release: bionic
  image.serial: "20190320"
  image.version: "18.04"
  security.privileged: "true"
  volatile.base_image: 6700bee14eb3034ba4bd0c3d0165f938faa161d2690e919465aab2946490689b
  volatile.eth0.hwaddr: 00:16:3e:e4:2a:43
  volatile.idmap.base: "0"
  volatile.idmap.next: '[]'
  volatile.last_state.idmap: '[]'
  volatile.last_state.power: RUNNING
devices: {}
ephemeral: false
profiles:
- bridge
stateful: false
description: ""

and confirmed the mac address the one I used in my router.

Interestingly non-bridged containers still work correctly and obviously so does the connection into the host…

lxc profile show bridge (abridged)

config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: bridged
    parent: br0
    type: nic
  root:
    path: /
    pool: lxd
    type: disk
name: bridge
used_by:
- /1.0/containers/dns

note: abridged comments are in places where I have listed only the pertinent interfaces or limited the number of containers shown (as they all exhibited the same symptom anyway).

I’m pretty stumped here I tried to read through some of the similar posts but unfortunately didn’t really come up with anything useful. Thanks in advance for any assistance.


(Stéphane Graber) #2

If you set the IP manually in the container, does networking then work?
Trying to isolate if the issue is related to DHCP or if it’s something lower level messing with your setup.

One such lower level issue would be if you’re running inside a VMWare VM as those have active MAC filtering on the underlying switch, preventing all MAC addresses that don’t match your host’s from sending traffic (including DHCP) to the outside.

It could also be a firewall rule on your host which is somehow blocking this traffic.

In any case, it is odd that things just stopped working.


(Nathan Bass) #3

I must be setting the IP wrong?

lxc stop dns
lxc config device set dns eth0 ipv4.address 192.168.42.12                                                      
Error: The device doesn't exist

also it’s worth noting that this box is running Ubuntu 18.04 on bare metal with LXD installed from apt (no vmware, etc).


(Nathan Bass) #4

So this is just freaking weird… I shut down that machine entirely last night and now after booting it up today the containers all have IPs again…


(Nathan Bass) #5

Happened again, I rebooted the machine 2 days ago and none of the containers on the bridge are getting IP addresses again. I had gone ahead and shutdown the machine cause I didn’t care that much at the time and didn’t have a need for it that day but now I just powered it back up and the containers have no IP addresses. No settings have changed, what could possibly be causing the containers to fail to connect over a bridge sometimes ?