I have a container which needs two interfaces and certain features, like this
auto lo eth0 eth1
iface lo inet loopback
allow-hotplug eth0 eth1
iface eth0 inet static
address 192.168.11.38
netmask 255.255.255.0
gateway 192.168.88.1
mtu 1458
post-up ip route replace default via 192.168.11.1 dev eth0 table eth0
post-up ip rule add iif eth0 table eth0
post-up ip rule add from 192.168.11.38 table eth0
post-up ip route show table eth0
iface eth1 inet static
address XXXXXXXX
netmask 255.255.255.0
post-up ip route replace default via XXXXXX.1 dev eth1 table eth1
post-up ip rule add iif eth1 table eth1
post-up ip rule add from XXXXXXXX table eth1
post-up ip route show table eth1
post-up ip route replace default via 192.168.11.1 dev eth0
This is called "policy based routing" and it solves certain application issues. The issue here is that every time the container gets booted, my "interfaces" file gets overwritten. How do I get around that? This is a Debian 7 container.
By the way, Proxmox must find a way to integrate common LXC containers, on disk, not on mounted devices. I still have not figured out how to import my existing containers. And nobody seems to now how to do this.
auto lo eth0 eth1
iface lo inet loopback
allow-hotplug eth0 eth1
iface eth0 inet static
address 192.168.11.38
netmask 255.255.255.0
gateway 192.168.88.1
mtu 1458
post-up ip route replace default via 192.168.11.1 dev eth0 table eth0
post-up ip rule add iif eth0 table eth0
post-up ip rule add from 192.168.11.38 table eth0
post-up ip route show table eth0
iface eth1 inet static
address XXXXXXXX
netmask 255.255.255.0
post-up ip route replace default via XXXXXX.1 dev eth1 table eth1
post-up ip rule add iif eth1 table eth1
post-up ip rule add from XXXXXXXX table eth1
post-up ip route show table eth1
post-up ip route replace default via 192.168.11.1 dev eth0
This is called "policy based routing" and it solves certain application issues. The issue here is that every time the container gets booted, my "interfaces" file gets overwritten. How do I get around that? This is a Debian 7 container.
By the way, Proxmox must find a way to integrate common LXC containers, on disk, not on mounted devices. I still have not figured out how to import my existing containers. And nobody seems to now how to do this.