Networking¶
Use macvlan for bridged network¶
On the host, setup br0 as the bridge interface, then bond the actual physical interface to it.
auto br0
iface br0 inet static
bridge-ifaces eno1
bridge-ports eno1
up ip link set eno1 up
address 192.168.1.3
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.1.53
dns-search example.com
auto eno1
iface eno1 inet manual
After this, the clients have to be configured to use the br0 bridge.
Configure container bridge¶
Using br0 as the bridge device (from the host), and eth0 as the container’s ethernet device:
lxc config device add container-name eth0 nic nictype=bridged parent=br0 name=eth0