I'm new to NAT and iptables, I have my physical server running CentOS 6 with KVM installed, 2 more linux box is started as VM - VM2 and VM3, and their ip is 192.168.122.2 and 192.168.122.3 accordingly. Since I have one real IP only, NAT is used for port forwarding external request to VM's application, e.g. port 30022 to VM3's ssh (port 22). After setup everything work fine, its running for a month already, but then after I done a RAM upgrade and server reboot, NAT/port forward is not working again.
- Iptables running at host OS but NOT at guest OSs.
- Host OS iptables has configure NAT as follow:
target prot opt source destination DNAT tcp -- anywhere anywhere tcp dpt:30022 to:192.168.122.3:22 DNAT tcp -- anywhere anywhere tcp dpt:20022 to:192.168.122.2:22(22)
- Result of command iptables -t nat -L -v -n:
pkts bytes target prot opt in out source destination 6 304 LOG tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:30022 LOG flags 0 level 4 prefix ROUTE APP3 6 304 DNAT tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:30022 to:192.168.122.3:22 3 152 DNAT tcp -- br0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:20022 to:192.168.122.2:22
- That means package is handled by the NAT rule while I try to telnet 30022 from my local PC (separate network)
Have been struggled for few days..any help?