Port forwarding DD-WRT

Posted by Pawel on Super User See other posts from Super User or by Pawel
Published on 2011-01-16T01:14:53Z Indexed on 2011/01/16 5:56 UTC
Read the original article Hit count: 539

Hi,

I'am runing locally service on port 81 (192.168.1.101) I would like to access server from outside MY.WAN.IP.ADDR:81. Everything is working fine on my local network, However can't access it from outside.

Below iptables rules on the router. I am using dd-wrt and asus rt-n16 (everything is setup through standard port range forwarding in dd-wrt ) It might be something obvious, but I don't have any experience with routing. Any help will be really appreciated. Thanks.

#iptables -t nat -vnL 
Chain PREROUTING (policy ACCEPT 1285 packets, 148K bytes)
 pkts bytes target     prot opt in     out     source               destination         
    3   252 DNAT       icmp --  *      *       0.0.0.0/0            MY.WAN.IP.ADDR       to:192.168.1.1 
    5   300 DNAT       tcp  --  *      *       0.0.0.0/0            MY.WAN.IP.ADDR       tcp dpt:81 to:192.168.1.101 
    0     0 DNAT       udp  --  *      *       0.0.0.0/0            MY.WAN.IP.ADDR       udp dpt:81 to:192.168.1.101 
  298 39375 TRIGGER    0    --  *      *       0.0.0.0/0            MY.WAN.IP.ADDR       TRIGGER type:dnat match:0 relate:0 

Chain POSTROUTING (policy ACCEPT 7 packets, 433 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  747 91318 SNAT       0    --  *      vlan2   0.0.0.0/0            0.0.0.0/0           to:MY.WAN.IP.ADDR 
    0     0 RETURN     0    --  *      br0     0.0.0.0/0            0.0.0.0/0           PKTTYPE = broadcast 

Chain OUTPUT (policy ACCEPT 86 packets, 5673 bytes)
 pkts bytes target     prot opt in     out     source               destination



# iptables -L          
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       tcp  --  anywhere             anywhere            tcp dpt:webcache 
DROP       tcp  --  anywhere             anywhere            tcp dpt:www 
DROP       tcp  --  anywhere             anywhere            tcp dpt:https 
DROP       tcp  --  anywhere             anywhere            tcp dpt:69 
DROP       tcp  --  anywhere             anywhere            tcp dpt:ssh 
DROP       tcp  --  anywhere             anywhere            tcp dpt:ssh 
DROP       tcp  --  anywhere             anywhere            tcp dpt:telnet 
DROP       tcp  --  anywhere             anywhere            tcp dpt:telnet 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     0    --  anywhere             anywhere            
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU 
lan2wan    0    --  anywhere             anywhere            
ACCEPT     0    --  anywhere             anywhere            state RELATED,ESTABLISHED 
logaccept  tcp  --  anywhere             pawel-ubuntu        tcp dpt:81 
logaccept  udp  --  anywhere             pawel-ubuntu        udp dpt:81 
TRIGGER    0    --  anywhere             anywhere            TRIGGER type:in match:0 relate:0 
trigger_out  0    --  anywhere             anywhere            
logaccept  0    --  anywhere             anywhere            state NEW 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain advgrp_1 (0 references)
target     prot opt source               destination         

Chain advgrp_10 (0 references)
target     prot opt source               destination         

Chain advgrp_2 (0 references)
target     prot opt source               destination         

Chain advgrp_3 (0 references)
target     prot opt source               destination         

Chain advgrp_4 (0 references)
target     prot opt source               destination         

Chain advgrp_5 (0 references)
target     prot opt source               destination         

Chain advgrp_6 (0 references)
target     prot opt source               destination         

Chain advgrp_7 (0 references)
target     prot opt source               destination         

Chain advgrp_8 (0 references)
target     prot opt source               destination         

Chain advgrp_9 (0 references)
target     prot opt source               destination         

Chain grp_1 (0 references)
target     prot opt source               destination         

Chain grp_10 (0 references)
target     prot opt source               destination         

Chain grp_2 (0 references)
target     prot opt source               destination         

Chain grp_3 (0 references)
target     prot opt source               destination         

Chain grp_4 (0 references)
target     prot opt source               destination         

Chain grp_5 (0 references)
target     prot opt source               destination         

Chain grp_6 (0 references)
target     prot opt source               destination         

Chain grp_7 (0 references)
target     prot opt source               destination         

Chain grp_8 (0 references)
target     prot opt source               destination         

Chain grp_9 (0 references)
target     prot opt source               destination         

Chain lan2wan (1 references)
target     prot opt source               destination         

Chain logaccept (3 references)
target     prot opt source               destination         
ACCEPT     0    --  anywhere             anywhere            

Chain logdrop (0 references)
target     prot opt source               destination         
DROP       0    --  anywhere             anywhere            

Chain logreject (0 references)
target     prot opt source               destination         
REJECT     tcp  --  anywhere             anywhere            tcp reject-with tcp-reset 

Chain trigger_out (1 references)
target     prot opt source               destination 

#iptables -vnL FORWARD
Chain FORWARD (policy ACCEPT 130 packets, 5327 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   15   900 ACCEPT     0    --  br0    br0     0.0.0.0/0            0.0.0.0/0           
  390 20708 TCPMSS     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU 
 182K  130M lan2wan    0    --  *      *       0.0.0.0/0            0.0.0.0/0           
 179K  129M ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
    0     0 logaccept  tcp  --  *      *       0.0.0.0/0            192.168.1.101       tcp dpt:81 
    0     0 logaccept  udp  --  *      *       0.0.0.0/0            192.168.1.101       udp dpt:81 
    0     0 TRIGGER    0    --  vlan2  br0     0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0 
 2612  768K trigger_out  0    --  br0    *       0.0.0.0/0            0.0.0.0/0           
 2482  762K logaccept  0    --  br0    *       0.0.0.0/0            0.0.0.0/0           state NEW

© Super User or respective owner

Related posts about routing

Related posts about router