OpenVZ Forum


Home » General » Support » *SOLVED* NAT/MASQUERADING inside VZ
*SOLVED* NAT/MASQUERADING inside VZ [message #4852] Sat, 29 July 2006 09:19 Go to next message
Plnt is currently offline  Plnt
Messages: 2
Registered: June 2006
Location: Prague, Czech Republic
Junior Member

From: 82.208.33*
Hi,

I've successfuly created OpenVPN connection to VZ using tun interface. Now I need to do NAT inside VZ but I wasn't able to set-up rule for iptables:
zone1:~# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
FATAL: Could not load /lib/modules/2.6.16-026test014/modules.dep: No such file or directory
iptables v1.3.3: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Module ipt_MASQUERADE is loaded on host computer.

Same problem is with SNAT:
zone1:~# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j SNAT --to-source x.x.x.x
FATAL: Could not load /lib/modules/2.6.16-026test014/modules.dep: No such file or directory
iptables v1.3.3: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

zone1:~# iptables -t nat -L
FATAL: Could not load /lib/modules/2.6.16-026test014/modules.dep: No such file or directory
iptables v1.3.3: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.


Do I need to enable something for VZ like when using NAT on host computer? Is it possible to do NAT inside VZ?

Thanks,
Jan

[Updated on: Mon, 31 July 2006 05:28] by Moderator

Report message to a moderator

Re: NAT/MASQUERADING inside VZ [message #4855 is a reply to message #4852] Sat, 29 July 2006 13:53 Go to previous messageGo to next message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
From: *sw.ru
What about IPTABLES parameter in your /etc/vz/vz.conf?

[Updated on: Sat, 29 July 2006 13:54]

Report message to a moderator

Re: NAT/MASQUERADING inside VZ [message #4860 is a reply to message #4855] Sat, 29 July 2006 21:26 Go to previous messageGo to next message
Plnt is currently offline  Plnt
Messages: 2
Registered: June 2006
Location: Prague, Czech Republic
Junior Member

From: 82.208.33*
vass wrote on Sat, 29 July 2006 15:53

What about IPTABLES parameter in your /etc/vz/vz.conf?


I totally forgot this. I've added iptable_nat parameter and everything is working fine, now.

Thanks for hint.

Jan
Re: *SOLVED* NAT/MASQUERADING inside VZ [message #23856 is a reply to message #4852] Wed, 28 November 2007 07:41 Go to previous messageGo to next message
doublet is currently offline  doublet
Messages: 6
Registered: November 2007
Junior Member
From: *ipcom.comunitel.net
Hi,I have same problem but there's no /etc/vz/vz.conf, no idea about where could it be.

Anyway, I'm using a provider VPS, so i don't know if problem is in node on inside my VPS.

Any idea?

[root@swol~]# iptables -t nat -A PREROUTING -p tcp -d 10.20.30.40 --dport 40 -j DNAT --to-destination 10.20.30.50:70
iptables v1.2.11: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

[root@swol~]# iptables -L -t nat
iptables v1.2.11: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Thanks in advance =)

[Updated on: Wed, 28 November 2007 07:45]

Report message to a moderator

Re: *SOLVED* NAT/MASQUERADING inside VZ [message #31784 is a reply to message #23856] Thu, 10 July 2008 00:09 Go to previous messageGo to next message
adeeln is currently offline  adeeln
Messages: 6
Registered: July 2007
Junior Member
From: *hsd1.ca.comcast.net
doublet wrote on Wed, 28 November 2007 02:41

Hi,I have same problem but there's no /etc/vz/vz.conf, no idea about where could it be.

Anyway, I'm using a provider VPS, so i don't know if problem is in node on inside my VPS.



/etc/vz/vz.conf ONLY exists in the Host Node, so if it's a provider VPS, you can't do anything about it except ask them to do it for you.
Re: *SOLVED* NAT/MASQUERADING inside VZ [message #42693 is a reply to message #4852] Thu, 12 May 2011 03:07 Go to previous messageGo to next message
mad4solusvm is currently offline  mad4solusvm
Messages: 7
Registered: May 2011
Location: UK
Junior Member
From: *edge3.mal-gateway.sharkyinternet.co.uk
I am trying to get NAT to work inside my CentOS node.

I have the following installed

CentOS 5.6
SolusVM (Latest Stable Release)
OpenVZ Kernel (2.6.18-238.9.1.el5.028stab089.1)
2 x NIC's

Ok here goes, i have 2 sets of IP's set inside the node a set of private / local IP's and a block of external IP's. Im trying to issue my VPS containers with private IP addresses issued by the router using NAT, However dispite the fact i can see the private ip's in the routers ARP Table. i carnt get to the servers using thier assigned private IP's. however if i assign one of the external IP's i can get to the server just fine.

Just for the record, I've checked the /etc/vz/vz.conf file on the node in question for the iptable_nat parameter and can report back that it is in there.

Does anyone have any ideas why i can not do this? and also how i can fix it?, if at all possible.
Re: *SOLVED* NAT/MASQUERADING inside VZ [message #44154 is a reply to message #4852] Tue, 22 November 2011 06:54 Go to previous message
Rene is currently offline  Rene
Messages: 40
Registered: September 2006
Member
From: *183.189-19.dynamic.3bb.co.th
Plnt wrote on Sat, 29 July 2006 05:19
Hi,

Module ipt_MASQUERADE is loaded on host computer.



How do you load ipt_MASQUERADE on the host computer, pray tell?

Quote:

# insmod ipt_MASQUERADE
insmod: can't read 'ipt_MASQUERADE': No such file or directory
Previous Topic: vzctl restore: Error: undump failed: File exists
Next Topic: Infiniband Support
Goto Forum:
  


Current Time: Sat Jun 06 14:29:53 GMT 2020