0

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?

2 Answers 2

1

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .