I want to run 2 LXC containers under a host, and I want each to have their own IP on the network, let's say the host has 10.10.1.10 and the containers have 10.10.1.11 and 10.10.1.12.
Does my setup require that I configure 2 bridged interfaces in the hosts /etc/network/interfaces file, something like this:
auto br0
iface br0 inet static
address 10.10.1.11 #ip of our host
netmask 255.255.255.0 #subnet of our host
network 10.10.1.0 #network of our host
broadcast 10.10.1.255 #our broadcast address
gateway 10.10.1.1 #default gw for our host to access the internet
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
auto br1
iface br0 inet static
address 10.10.1.12 #ip of our host
netmask 255.255.255.0 #subnet of our host
network 10.10.1.0 #network of our host
broadcast 10.10.1.255 #our broadcast address
gateway 10.0.1.1 #default gw for our host to access the internet
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Or is there another way to configure the host more like a switch and allow the individual containers to configure their own IPs (that would be safer so we're not always changing the interfaces file whenever we move containers around).
Use one bridge on the host.
The LXC config file dictates what the guest/containers IP addressing will be.
And a sample LXC config file...