- Create a bridge and attach the physical ethernet interface
# /etc/network/interfaces
iface br0 inet dhcp
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
- Compile and run the code
erlc br.erl
sudo ./start.sh
> br:start().
- In another shell, as root, bring up the uplink and attach it to the bridge:
# ifconfig erlbr up
# brctl addif br0 erlbr
# brctl show br0
bridge name bridge id STP enabled interfaces
br0 8000.4aec6d3a44d1 no erlbr
eth0
- Move the switch port interface into the container. The interface name inside the container will be known as "erl0".
lxc.network.type=phys
lxc.network.link=erl0
lxc.network.flags=up