OpenVZ Forum


Home » General » Support » OpenVZ and IP masquerading
OpenVZ and IP masquerading [message #2725] Tue, 18 April 2006 11:53 Go to previous message
Santi is currently offline  Santi
Messages: 7
Registered: April 2006
Junior Member
Hello,

We have a Debian Sarge box which runs this script to enable NAT/IP masquerading to local network machines:

Quote:

#!/bin/sh
modprobe iptable_nat
modprobe ip_nat_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE


eth0 = Internet
eth1 = LAN

It works fine with Debian's default kernel, "2.6.8-2-386". I have compiled OpenVZ 2.6.8-022stab076-up, with "enterprise" .config file from OpenVZ site, and when booting with this kernel everything works well except NAT/masquerading with the same iptables rules Sad

I have search in this forum a howto to enabe Internet access to the VPS, which has this rule:

http://forum.openvz.org/index.php?t=tree&goto=13&#ms g_13

Quote:


iptables -t nat -A POSTROUTING -s src_net -o eth0 -j SNAT --to ip_address



This rules depends "ip_address" variable, and it's a big problem because our public IP is dinamic, and can change Sad

Why those rules of iptables dont work with OpenVZ kernel? What's the best way to enable NAT/masquerading to my local network? thanks!!

Regards,

--
Santi Saez
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: vzpkgcache issue
Next Topic: *SOLVED* compiling errors with ovzkernel 2.6.16-026test009.1
Goto Forum:
  


Current Time: Thu Jul 11 07:27:29 GMT 2024

Total time taken to generate the page: 0.02319 seconds