Help about NAT with virtual server
- by Thanh Tran
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?