Skip to main content

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
code:
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
*accidentally had rule in there twice earlier testing


#2
code:
root@xx:~# iptables -t nat -f prerouting  root@xx:~# iptables -t nat -f postrouting
#3
code:
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.
#4
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

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support