Help about NAT with virtual server

Posted by Thanh Tran on Server Fault See other posts from Server Fault or by Thanh Tran
Published on 2009-05-12T09:55:51Z Indexed on 2010/05/22 19:21 UTC
Read the original article Hit count: 394

Filed under:
|
|

I have a dedicated server running Linux CentOS 5.3 with 2 IP addresses. I've installed a virtual machine using VMware Server. The host and the guest have a host-only network. Now I want to map the 2nd IP address to the virtual machine so that it can run as a second dedicated server for me. Here is what I do:

modprobe iptable_nat

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t filter -A FORWARD -s 192.168.78.128 -d 64.85.164.184 -j ACCEPT

iptables -t nat -A PREROUTING -d 64.85.164.184 -i eth0 -j DNAT --to-destination 192.168.78.128

iptables -t nat -A POSTROUTING -s 192.168.78.128 -o eth0 -j SNAT --to-source 64.85.164.184</p>

But it not working as intended. What is the matter?

© Server Fault or respective owner

Related posts about linux

Related posts about server