Thread: Having Trouble Forwarding Traffic With Iptables
hey all, have vps running ubuntu 11.04, , i'm trying forward incoming traffic on port 7777 vps different ip address.
asked question @ howtoforge , person helping me recommended post here. here's link.
here's i've tried , error received:
#1
*accidentally had rule in there twice earlier testingcode:root@xx:~# iptables --list -n -t nat chain prerouting (policy accept) target prot opt source destination dnat tcp -- 0.0.0.0/0 x.x.x.x tcp dpt:7777 to:x.x.x.x:7777 dnat tcp -- 0.0.0.0/0 x.x.x.x tcp dpt:7777 to:x.x.x.x:7777 chain postrouting (policy accept) target prot opt source destination chain output (policy accept) target prot opt source destination
#2
#3code:root@xx:~# iptables -t nat -f prerouting root@xx:~# iptables -t nat -f postrouting
#4code:root@xx:~# iptables -t nat -a prerouting -p tcp -d x.x.x.x --dport 7777 -j dnat --to x.x.x.x:7777 root@xx:~# iptables -t nat -a postrouting -d x.x.x.x -j masquerade iptables: no chain/target/match name.
code:root@xx:~# iptables --list -t nat chain prerouting (policy accept) target prot opt source destination dnat tcp -- anywhere x.x.x.x tcp dpt:7777 to:x.x.x.x:7777 chain postrouting (policy accept) target prot opt source destination chain output (policy accept) target prot opt source destination
x.x.x.x represents correct ip addresses in preceding quotes. it's worth mentioning in game client, when type domain , port connect to, resolves ip address of ubuntu box , not ip want forward traffic to.
in advance.
k edited since boffed first time.
try adding a
-o interface
on masquerade postrouting line
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] Having Trouble Forwarding Traffic With Iptables
Ubuntu
Comments
Post a Comment