I have a container running an openvpn server id like to use as a gateway for other containers. I believe I can use the bridge-utils package to create a bridge that doesn’t attach to a physical interface, specify the tun0 adapter as the gateway and then tell the secured container to use this bridge. Am I getting close?
~$ lxc list
+------+---------+--------------------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+--------------------------------+------+------------+-----------+
| secure | RUNNING | 10.100.100.29 (eth0) | | PERSISTENT | 1 |
+------+---------+--------------------------------+------+------------+-----------+
| vpn | RUNNING | 10.8.0.1 (tun0) | | PERSISTENT | 1 |
| | | 10.100.100.105 (eth0) | | | |
+------+---------+--------------------------------+------+------------+-----------+
I having trouble wrapping my head around the /etc/network/interfaces entry to accomplish this. What should the network address for the bridge be?
~$ tail /etc/network/interfaces
# Bridge for LXC Containers
#auto br0
# iface br0 inet static
# address 10.8.0.?
# network 10.8.0.0
# netmask 255.255.255.0
# broadcast 10.8.0.255
# gateway 10.8.0.1
# bridge_ports none