OpenVZ Forum


Home » General » Support » 2.6.8 nat not work
Re: 2.6.8 nat not work [message #4156 is a reply to message #4136] Fri, 30 June 2006 08:06 Go to previous message
Vasily Tarasov is currently offline  Vasily Tarasov
Messages: 1345
Registered: January 2006
Senior Member
1) It seems that you have made something like
"ifconfig venet0..." on host and in VE. It's wrong. You don't have to do it! Routing is also done automaticaly. Just use the commands vzctl set --ipadd IP --save and similar!

2) Here is a small description, what I've done to get it all work:

a) Add "options ip_conntrack ip_conntrack_enable_ve0=1" to /etc/modprobe.conf and reload this module with modprobe.

b) My external IP is 192.168.0.239 on eth0. VE's IP is 10.0.0.2.
(If you have more than one interface don't forget to tune VE_ROUTE_SRC_DEV variable in /etc/vz/vz.conf as you wish)

vzctl set 200 --ipadd 10.0.0.2 --save
vzctl start 200

At this moment you can only ping HOST from VE (and back to front of course)

c)
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.0.0.2 -o eth0 -j SNAT --to 192.168.0.239


After that I was able to ping "world" from VE.

If you'll have problems you can give me an access to the node, if possible, and I'll try to help.

Good luck!
 
Read Message
Read Message
Previous Topic: *SOLVED* development kernel can not boot
Next Topic: Plesk 8 - Fedora Core 4 - Hostname Issue
Goto Forum:
  


Current Time: Fri Jul 19 14:27:40 GMT 2024

Total time taken to generate the page: 0.02301 seconds