lost and found ( for me ? )

Ubuntu LXC : use bridge network

small tips.
# lxc-version
lxc version: 0.9.0

# tail -1 /etc/lsb-release

# uname -ri
3.8.0-25-generic x86_64

make a bridge network and associate that bridge (br0) with a physical link(eth0).

physical link : eth0
bridge network I made : br0
auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
       bridge_ports eth0
       bridge_stp off
       bridge_fd 0
       bridge_maxwait 0

restart network
# /etc/init.d/networking restart

edit existing containers configuration(/var/lib/lxc/< container name>/config ) to have those containers use the bridge network br0 which is associated with eth0.

container name : ubuntu-cn1
# less /var/lib/lxc/ubuntu-cn1/config
# Template used to create this container: ubuntu
# Template script checksum (SHA-1): 6f468a9a658112f6420fb39d2ab90a80fd43cd22

lxc.network.type = veth
lxc.network.hwaddr = MAC address
#lxc.network.link = lxcbr0
lxc.network.link = br0

edit LXC’s config ( default.conf ) to have containers which I build next time use bridge network.
# less /etc/lxc/default.conf
lxc.network.type = veth
#lxc.network.link = lxcbr0
lxc.network.link = br0
lxc.network.flags = up


  1. What are various purposes for which we can use bridge network?

    Silvester Norman

    Change Mac Address

  2. containers are visable from outside a LXC host when using bridge device(br0).
    ( container's IP addresses are the same network of the the LXC host network)



Note: Only a member of this blog may post a comment.