Modify

Opened 7 years ago

Closed 7 years ago

#8037 closed defect (fixed)

Redirect WAN to router not working

Reported by: anonymous Owned by: jow
Priority: normal Milestone: Backfire 10.03.1
Component: luci Version: Trunk
Keywords: Cc:

Description

See this thread for details: https://forum.openwrt.org/viewtopic.php?pid=118039#p118039

According to Jow, this should allow the router's web page to be accessed from the WAN, as part of /changeset/22228.html :

config redirect
  option src wan
  option src_dport 81
  option dest_port 80

This code results in the following iptables rule being set:
-A zone_wan_prerouting -p tcp -m tcp --dport 81 -j DNAT --to-destination :80

This does not seem to be sufficient for opening a port to the router itself. My workaround code is as follows:

config redirect
    option src    wan
    option src_dport    81
    option dest    lan
    option dest_ip    192.168.2.2
    option dest_port    80
    option proto    tcp

config rule
    option src    wan
    option proto    tcp
    option dest_ip    192.168.2.2
    option dest_port    80
    option target    ACCEPT

It would be nice if Jow's ultra elegant code worked correctly. The 192.168.2.2 address above is the router's LAN address.

Listing component as Luci, if this isn't correct, please change.

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by JimWright

The above was from me, not sure why my name didn't save there.

comment:2 Changed 7 years ago by jow

  • Owner set to jow
  • Status changed from new to accepted

comment:3 Changed 7 years ago by ciusss89 <ciusss@…>

hi guys,

config 'redirect'
        option '_name' 'Rs-pro_http'
        option 'proto' 'tcp'
        option 'src' 'wan'
        option 'src_ip' '0.0.0.0'
        option 'src_dport' '80'
        option 'dest' 'lan'
        option 'dest_ip' '192.168.10.12'
        option 'dest_port' '80'
        option 'target' 'DNAT'
        option 'reflection' '1'

Redirect from wan to other lan device doesn't work

comment:4 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from accepted to closed

ciusss89, your issue is pebkac; "src_ip 0.0.0.0" is never going to happen. You either want 0.0.0.0/0 or no such option at all. The original issue should be solved by now.

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.