Translation(s): none


Please find alternative network setups for containers on the LXC mainpage.

In case of bridged or routed network provided by the host, here is an example.

Host device as bridge

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

auto br0
iface br0 inet dhcp
        bridge_ports eth0
        bridge_fd 0
        bridge_maxwait 0

# uncomment the below and comment the above for static ip setup on the host
#iface br0 inet static
#       bridge_ports eth0
#       bridge_fd 0
#       address <host IP here, e.g. 10.1.1.2>
#       netmask 255.255.255.0
#       network <network IP here, e.g. 10.1.1.0>
#       broadcast <broadcast IP here, e.g. 10.1.1.255>
#       gateway <gateway IP address here, e.g. 10.1.1.1>
#       # dns-* options are implemented by the resolvconf package, if installed
#       dns-nameservers <name server IP address here, e.g. 10.1.1.1>
#       dns-search your.search.domain.here

Additonal bridge device instead of changing a host device to br0

natted

routed

References :