For those of you that are interested, I managed to solve this myself.
Apparently, "ipt_MASQUERADE," the module that makes masquerading possible, is not (yet?) available in OpenVZ. The absence of this module is what causes the following command to fail:
Code:
root@xx:~# iptables -t nat -A POSTROUTING -d x.x.x.x -j MASQUERADE
iptables: No chain/target/match by that name.
I discovered that it was still possible to accomplish my goal, only that an alternate second command was required. So here's what I did.
1. Cleared out existing nat PREROUTING and POSTROUTING rules from earlier testing.
Code:
root@xx:~# iptables -t nat -F PREROUTING
root@xx:~# iptables -t nat -F POSTROUTING
2. Added the following two rules:
Code:
root@xx:~# iptables -t nat -A PREROUTING -p tcp -d x.x.x.x --dport 7777 -j DNAT --to y.y.y.y:7777
root@xx:~# iptables -t nat -A POSTROUTING -j SNAT --to-source x.x.x.x
*Where x.x.x.x represents the source IP and y.y.y.y represents the destination IP.
3. Saved iptables (necessary for changes to persist after reboot)
Code:
root@xx:~# iptables-save
Hope this helps someone...I know it would have helped me.
Recent comments
16 hours 24 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 6 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 13 hours ago
1 day 23 hours ago
2 days 4 hours ago
2 days 5 hours ago