OpenVZ Forum


Home » General » Support » public & private venet in a single CT, how to route to private address from private address (IP Routing problem)
public & private venet in a single CT, how to route to private address from private address [message #49648] Mon, 27 May 2013 22:43
foobar77 is currently offline  foobar77
Messages: 1
Registered: May 2013
Junior Member
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



 
Read Message
Previous Topic: Zimbra on OpenVZ container: Disk space Issues
Next Topic: Templates - NetBSD
Goto Forum:
  


Current Time: Fri Sep 13 22:22:33 GMT 2024

Total time taken to generate the page: 0.04703 seconds