Monthly Archives: January 2014

1) On the host system, add a tap1 interface

ip tuntap add mode tap tap1
ifconfig tap1 up

2) Setup a bridge
brctl addbr br0
brctl addif br0 tap1
#let’s see the bridge:
brctl show
brctl showmacs br0

3) Setup an LXC container with the following settings in the /var/lib/lxc/my-ubuntu/config file: = 00:22:3e:da:58:6c
lxc.utsname = my-ubuntu


4) You can setup NAT now:
echo “1” > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

NOTE: Before you setup conteiner’s interfaces properly it might take too much time to start the container, If so then on the container host cd to /etc/network and change dhcp mode to manual for eth0

Troubleshooting tools:
tcpdump -i br0
tshark -i br0

General info about tun/tap:

How to configure a bridge

NAT How-to:

LXC containers: