1

I have the following rule:

iptables -t nat -A PREROUTING -d 93.xxx.61.56 -j DNAT --to-destination 10.8.0.10

Problem is that this rule affects some programs and I want this rule to be active only for a specific port like 443.

Is it possible to do that? I mean, everything else that tries to connect to 93.xxx.61.56 on a different port than 443 should not be affected by this rule.

many thanks.

2 Answers 2

1

Try

iptables -t nat -A PREROUTING -d 93.xxx.61.56 --sport 443 -j DNAT --to-destination 10.8.0.10d
2
  • Damn. The answer above got it before me. Nov 1, 2010 at 19:33
  • Weird that --sport instead of --dport fixed it. That too without -m tcp. Nov 2, 2010 at 8:15
3

Add -p tcp --dport 443 to your command, and then it will only match TCP packets with destination port = 443.

You must log in to answer this question.

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