up vote 0 down vote favorite
share [g+] share [fb]

I am trying to forward the outbound traffic to another server. Current rule is:

/sbin/iptables -A OUTPUT -p tcp -s localhost -o 91.xxx.xxx.xxx --dport 65000:65010 -j ACCEPT

but when I do a iptables -L, the rule its showed like this:

ACCEPT tcp -- localhost.localdomain anywhere tcp dpts:65000:65010

So I guess my rule is bad written since the "destination" column shows "anywhere"

Can you help me with this?

link|improve this question

50% accept rate
feedback

2 Answers

Based on what it looks like you're trying to do, you're probably better off with a route.

/sbin/route add default gw 91.xxx.xxx.xxx

You would use iptables for Network Address Translation.

link|improve this answer
feedback

maybe this:

iptables -t nat -A PREROUTING -p tcp --dport 65000:65010 -j DNAT --to ip.of.other.host

i assume your FORWARD policy is allow or otherwise such traffic is permitted.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.