[lxc-users] Bug in LXC networking

CDR venefax at gmail.com
Sun May 4 09:04:26 UTC 2014


Finally I understand the issue at hand.
The behavior is identical in Fedora 20 and Ubuntu Server LTS latest.
If there is only one NIC in the box, everything works fine, both
libvirt virbr0 and LXC lxcbr0 allow to route packets in NAT mode.
Here comes the issue, I have two NICs connected to two different networks.
This is my configuration. If I remove eth1 everything works,
But I need both networks, how do I get through this barrier?
I use policy-based routing so both networks act independently from each other.

auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.88.205
netmask 255.255.255.0
mtu 1460
gateway 192.168.88.1
post-up ip route replace default via 192.168.88.1 dev eth0 table eth0
post-up ip rule add iif eth1 table eth0
post-up ip rule add from 192.168.88.205 table eth0
post-up ip route show table eth0
post-up ip route replace default via 192.168.88.1 dev eth0


auto eth1
iface eth1 inet static
address 172.16.0.4
netmask 255.255.248.0
#gateway 172.16.0.1
mtu 1500
post-up ip route replace default via 172.16.0.1 dev eth1 table eth1
post-up ip rule add iif eth0 table eth1
post-up ip rule add from 172.16.0.4 table eth1
post-up ip route show table eth1
post-ip ip route replace default via 192.168.88.1 dev eth0


dns-nameservers 172.16.0.1


More information about the lxc-users mailing list