I’m using Ubuntu Server 16.04 with LXD 2.0.11. This is a fresh install for testing purposes on bare metal.
Following the official guide, I created a container successfully, so there is no general issue with the configuration.
I have not changed the profiles, there are ‘default’ and ‘docker’. The ‘default’ profile is using lxdbr0 which is handing out addresses from a pool that was generated at random, I created container C1 that’s using it and I could connect to it fine.
What I’m trying to achieve now is to create containers that are in the same subnet as my host. From what I could find out so far, there are two ways of achieving that. Either I simply set the nictype to macvlan, or I create a new bridge that I reference in the configuration. Network configuration can be done either on a container directly or using a profile. Any changes in the container will override the profile. As this is just a test on a single container, I decided to do the change on the container directly.
At the moment, I’m stuck with the nictype=macvlan option and hope someone can help me out with this. I did the following on container C1:
$ sudo lxc stop C1
$ sudo lxc config device add C1 eth0 nic nictype=macvlan parent=eno1 ### eno1 being my host nic with a static IP address 'iface eno1 inet static'
$ sudo lxc start C1
In my understanding, C1 should now be getting an IP from my local dhcp server (which is not on the host machine, by the way - I understand that wouldn’t work with macvlan), but it’s not.
What could be the issue? Do I have to somehow manually kickstart the dhcp client in the container or is something else entirely?