As the title says, how do I edit the lxc container's configuration to use the aliased bond0 interface on the host? This is what I have in the /etc/network/interfaces file now:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface #allow-hotplug eth0 #iface eth0 inet static # address 192.168.100.90/22 # gateway 192.168.101.1 auto bond0 iface bond0 inet static address 192.168.100.90/22 gateway 192.168.101.1 bond-slaves eth0 eth1 bond-mode active-backup bond-miimon 100 bond-primary eth0 eth1
Can I add this to at the end:
auto bond0:101 iface bond0:101 inet static address 192.168.100.101 netmask 255.255.252.0
and make the lxc container use this address? I don't want bridging, I just want the host and lxc cont. on the same network. I don't know what configuration options go into /var/lib/lxc/lxc_cont/config file. I tried this
lxc.network.type = phys lxc.network.flags = up lxc.network.link = bond0:101 lxc.network.hwaddr = 00:00:00:fe:fe:01 lxc.network.ipv4 = 192.168.100.101/22 lxc.network.ipv4.gateway = 192.168.101.1
but get this error:
lxc-start 20160912185144.642 ERROR lxc_conf - conf.c:lxc_assign_network:3044 - failed to move 'bond0:101' to the container : Invalid argument lxc-start 20160912185144.642 ERROR lxc_start - start.c:lxc_spawn:1197 - failed to create the configured network
In the future I would be adding other containers on the bond0 interface such as:
auto bond0:102 iface bond0:102 inet static address 192.168.100.102 netmask 255.255.252.0 auto bond0:102 etc.
I've setup containers using bridged interface before, but I'm stuck whith regards to this bonding thing.
Any help or pointers are much appreciated!
Thanks for your time!
P.S. seems to me that my question is similar to this one