Hi,
I have 2 public addresses and 3 containers.
Obviously the host has one of the public addresses, a webserver container has the other public address.
I have a database container that sits on 192.168.100.101 and has no public address
The host has eth0:1 on 192.168.100.100 and the webserver has venet0:1 on 192.168.100.102
The database container runs iptables and only accepts incoming traffic from hosts on the 192.168.100.0/24 network however it seems that by default any mysql request from the webserver to the database server comes with a source address of the public ip.
if I add a route...
ip route add 192.168.100.0/24 via 192.0.2.1 src 192.168.100.102
the traffic comes from the right address but I must do this manually inside the CT, is there any way to save this route in the container configuration or am I going about this the wrong way?
Thanks in advance.
sh-4.1# uname -a && vzctl --version
Linux example.com 2.6.32-5-openvz-amd64 #1 SMP Fri May 10 09:43:55 UTC 2013 x86_64 GNU/Linux
vzctl version 3.0.24