LXC Linux container with two network interfaces

LXC Linux containers can be used with more then one nic. Just add a second group of config lines to your config file.
Here is an example:
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.network.hwaddr = 3a:76:42:49:79:bf
lxc.network.ipv4 = 192.168.1.47/24
lxc.network.name = eth0

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up
lxc.network.hwaddr = 3a:76:42:51:79:bf
lxc.network.ipv4 = 192.168.10.42/24
lxc.network.name = eth1
After lxc-start of this container, there will be an /dev/eth0 and a /dev/eth1 inside the container. Both can be used. Don't forget to setup the proper routing :)

Link to other LXC pages

See my other LXC pages

Comments

Popular posts from this blog

WMI Static Port configuration

Optimizing your JVM for Best Performance

How do I disable FOREIGN KEY checking for the time of database schema migration?