LXC networking
This document describes the options of network configuration with containers.
Host configuration
# ip link add dummy0 type dummy # ip link set dummy0 up
Interfaces file at the host:
auto lxc-br0 iface lxc-br0 inet static address 192.168.3.1 netmask 255.255.255.0 network 192.168.3.0 broadcast 192.168.3.255 pre-up modprobe dummy bridge_fd 0 bridge_ports dummy0 bridge_maxwait 0
dnsmasq
/usr/libexec/lxc/lxc-net /etc/default/lxc-net
LXC configuration
config file:
# Network configuration lxc.net.0.type = veth lxc.net.0.link = lxc-br0 lxc.net.0.flags = up lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx ## Autostart lxc.start.auto = 1 lxc.start.delay = 5
Interfaces file into de LXC container to use static IP addr:
auto eth0 iface eth0 inet static address 192.168.3.11 netmask 255.255.255.0 gateway 192.168.3.1 dns-nameservers 192.168.3.1
Return to LXC Debian