IPTables Proxy NAT

Ryan asked:

I am trying to create a proxy NAT that will forward a port to a remote host. I have two interfaces: venet0:0 and venet0:18. I want to be able to forward connections from venet0:18 to venet0:0 and then out to a remote host.

I have tried this: http://www.debian-administration.org/articles/595
and it does work but I cannot get it to forward the packets through my other interface (venet0:0).

My answer:


You’re using OpenVZ, and doing NAT within an OpenVZ VPS container is tricky at best and often doesn’t work right.

You can try asking your hosting provider to enable TUN/TAP support within your container.

If this fails to resolve the problem, you will probably have to use a different VPS based on different technology, such as KVM, VMware or Xen.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.