Modify

Opened 8 years ago

Closed 7 years ago

Last modified 21 months ago

#2769 closed defect (duplicate)

Port forwarding redirects to a wrong port

Reported by: emil@… Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version:
Keywords: Cc:

Description

These rules suppose to redirect all incoming traffic to a given IP in the local network:

iptables -t nat -A prerouting_wan -p tcp --dport 3389 -j DNAT --to 10.10.10.205:3389
iptables -A forwarding_wan -p tcp --dport 3389 -d 10.10.10.205 -j ACCEPT

However PREROUTING-DNAT rule rewrites a destination port to a wrong one. Logs:

IN=eth0.1 OUT=br-lan SRC=xxx.xxx.xxx.xxx DST=10.10.10.205 LEN=60 TOS=0x00 PREC=0x00 TTL=53 ID=31632 DF PROTO=TCP SPT=38563 DPT=3390 WINDOW=5840 RES=0x00 SYN URGP=0

So as a workaround I had to modify my firewall rules to:

iptables -t nat -A prerouting_wan -p tcp --dport 3389 -j DNAT --to 10.10.10.205:3388
iptables -A forwarding_wan -p tcp --dport 3389 -d 10.10.10.205 -j ACCEPT

Please read also http://forum.openwrt.org/viewtopic.php?pid=59584 where there are reports from other people

Attachments (0)

Change History (6)

comment:1 Changed 8 years ago by dstensnes

Sadly, the final destination port is not always intended port +1, so that rule you wrote in the bugreport will probably fail after a while too. I tried to redirect to port 22, and it ended up on port 27 :/

comment:2 Changed 8 years ago by emil@…

Seems like all these tickets are about the same issue: #2570, #2558

comment:3 Changed 8 years ago by ed.gomez@…

Same problem on a good old wrt54g, i observe a constant offset of +6 here.

Rebooting doesn't reset the offset.

comment:4 Changed 7 years ago by anonymous

I see this bug too, extremely annoying. Just because of this router needs reboot once a day.

comment:5 Changed 7 years ago by florian

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #2558.

comment:6 Changed 21 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.