Tuesday, January 14, 2014

OpenWRT: opening ports to the WAN (aka NAT, aka port forwarding)

Opening a port to a LAN computer is simple, you can do it from the GUI:
# Port 22422 -> 10.0.0.109:22422
config redirect
        option target 'DNAT'
        option src 'wan'
        option dest 'lan'
        option src_dport '22422'
        option dest_ip '10.0.0.109'
        option dest_port '22422'
        option proto 'tcp'
        option name 'Allow-SSH-bob' 
Opening a port to your router is not so simple:
# Port 64430 -> 10.0.0.1:443
config redirect
        option src 'wan'
        option proto 'tcp'
        option src_dport '64430'
        option dest_ip '10.0.0.1'
        option dest_port '443'
        option name 'Allow-HTTPS-router-redirect'

config rule
        option src 'wan'
        option proto 'tcp'
        option dest_port '443'
        option target 'ACCEPT'
        option name 'Allow-HTTPS-router-rule' 
Source:
http://www.smallbusinesstech.net/more-complicated-instructions/openwrt/setting-up-port-forwarding-and-dealing-with-loopbacks-on-openwrt-kamikaze-8.09.1

No comments:

Post a Comment