Port forwarding problem: WNDR3700v4 DD-WRT v24-sp2 (12/22/14

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
castletonroad
DD-WRT Novice


Joined: 23 Oct 2018
Posts: 27

PostPosted: Sun Mar 31, 2019 6:09    Post subject: Port forwarding problem: WNDR3700v4 DD-WRT v24-sp2 (12/22/14 Reply with quote
Hi,

I hope that some kind soul can help me with my port forwarding problem...

My setup:

ISP <> Sagecom F@ST5355 (modem: xxx.xxx.xxx.xxx/192.168.1.1) <> WNDR3700v4 (router: 192.168.1.3/192.168.200.2) <> raspberrypi1 (192.168.200.20) & raspberrypi2 (192.168.200.21)

On the F@ST5355 I have set the WNDR3700 to be in the DMZ.

The ISP-provided F@ST5355 modem/router is configured in bridge mode, with DHCP enabled. LAN-side it is 192.168.1.1, WAN-side it is the ISP-provided dynamic IP address. (I use NO-IP.COM to link this dynamic IP to a domain name.)

Connected to a LAN port on the F@ST5355 LAN by its WAN port is a Netgear WNDR3700v4 with DDWRT DD-WRT v24-sp2 (12/22/14) std (SVN revision 25697). WAN-side it is 192.168.1.3, LAN-side it is 192.168.200.2. The WNDR3700v4 is my LAN DHCP server.

On the WNDR3700v4 I have enabled the internal DDWRT web server (ports 81, 443) and the internal openvpn server (port 1194).

I have forwarded port 80 (web server) and 25, 465, 587, 143, 993, 110, 995 (email server) to raspberrypi1.

I have also forwarded port 4444 (2nd openvpn) to raspberrypi2.

None of the port forwarding to either raspberrypi works. For example, http://www.portchecktool.com/ shows:
    WNDR3700v4 / ports 81 and 443 = visible
    WNDR3700v4 / port 1194 = not visible [<< not sure why this is the case...?]
    raspberrypi1 / ports 80 = not visible
    raspberrypi2 / ports 4444 = not visible


When I set raspberrypi1 into the DMZ on the DDWRT WNDR3700v, port 80 is still not visible - but then neither is port 81. Removing raspberrypi1 from the DMZ then makes port 81 visible again.

On the WNDR3700v4:
Code:
:~# iptables -t nat -vnL PREROUTING
Chain PREROUTING (policy ACCEPT 2701 packets, 321K bytes)
 pkts bytes target     prot opt in     out     source               destination
    1    28 DNAT       icmp --  *      *       0.0.0.0/0            192.168.1.3         to:192.168.200.2
    0     0 DNAT       udp  --  *      *       0.0.0.0/0            192.168.1.3         udp dpt:4444 to:192.168.200.21:4444
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:25 to:192.168.200.20:25
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:465 to:192.168.200.20:465
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:587 to:192.168.200.20:587
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:143 to:192.168.200.20:143
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:993 to:192.168.200.20:993
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:110 to:192.168.200.20:110
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:995 to:192.168.200.20:995
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:80 to:192.168.200.20:80
    0     0 DNAT       tcp  --  *      *       0.0.0.0/0            192.168.1.3         tcp dpt:80 to:192.168.200.20
    0     0 DNAT       udp  --  *      *       0.0.0.0/0            192.168.1.3         udp dpt:80 to:192.168.200.20
  149 13446 TRIGGER    0    --  *      *       0.0.0.0/0            192.168.1.3         TRIGGER type:dnat match:0 relate:0

and
Code:
:~# iptables -vnL FORWARD
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     0    --  tun2   br0     0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  br0    tun2    0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  *      *       10.8.0.0/24          0.0.0.0/0
20067 8364K ACCEPT     0    --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
    0     0 ACCEPT     47   --  *      vlan2   192.168.200.0/24     0.0.0.0/0
    0     0 ACCEPT     tcp  --  *      vlan2   192.168.200.0/24     0.0.0.0/0           tcp dpt:1723
    0     0 ACCEPT     0    --  tun2   *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  *      tun2    0.0.0.0/0            0.0.0.0/0
 1341  174K lan2wan    0    --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     0    --  br0    br0     0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            192.168.200.21      udp dpt:4444
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:25
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:465
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:587
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:143
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:993
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:110
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:995
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:80
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            192.168.200.20      tcp dpt:80
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            192.168.200.20      udp dpt:80
    0     0 TRIGGER    0    --  vlan2  br0     0.0.0.0/0            0.0.0.0/0           TRIGGER type:in match:0 relate:0
 1341  174K trigger_out  0    --  br0    *       0.0.0.0/0            0.0.0.0/0
 1327  174K ACCEPT     0    --  br0    *       0.0.0.0/0            0.0.0.0/0           state NEW
   14   716 DROP       0    --  *      *       0.0.0.0/0            0.0.0.0/0



On raspberrypi1:
Code:
:~$ sudo nmap -sT -sU -p 80 192.168.200.2 (WNDR3700v4 LAN-side)
Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-31 16:36 AEDT
Nmap scan report for wndr3700v4 (192.168.200.2)
Host is up (0.0093s latency).
PORT   STATE  SERVICE
80/tcp open   http
80/udp closed http
MAC Address: 28:C6:8E:B3:D3:5B (Netgear)
Nmap done: 1 IP address (1 host up) scanned in 1.10 seconds

:~$ sudo nmap -sT -sU -p 80 192.168.1.3 (WNDR3700v4 WAN-side)
Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-31 16:33 AEDT
Nmap scan report for 192.168.1.3
Host is up (0.0059s latency).
PORT   STATE  SERVICE
80/tcp open   http
80/udp closed http
Nmap done: 1 IP address (1 host up) scanned in 1.04 seconds

:~$ sudo nmap -sT -sU -p 80 192.168.1.1 (F@ST5355 LAN-side)
Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-31 16:35 AEDT
Nmap scan report for 192.168.1.1
Host is up (0.0034s latency).
PORT   STATE         SERVICE
80/tcp open          http
80/udp open|filtered http
Nmap done: 1 IP address (1 host up) scanned in 1.27 seconds

:~$ sudo nmap -sT -sU -p 80 xxx.xxx.xxx.xxx  (F@ST5355 LAN-side)
Starting Nmap 7.40 ( https://nmap.org ) at 2019-03-31 16:37 AEDT
Nmap scan report for xxx.xxx.xxx.xxx
Host is up (0.0080s latency).
rDNS record for xxx.xxx.xxx.xxx
PORT   STATE         SERVICE
80/tcp filtered      http
80/udp open|filtered http
Nmap done: 1 IP address (1 host up) scanned in 6.60 seconds



So, the problem I have is that I can reach services on the WNDR3700v4 router, from the internet, but I cannot reach services beyond this router, on the LAN.

But when I check e.g. raspberrypi1 on the LAN, and the forwarding rules on the DDWRT WNDR3700v4 router, it seems all the right ports are open/forwarding.

What am I missing?


Last edited by castletonroad on Sun Mar 31, 2019 6:23; edited 1 time in total
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sun Mar 31, 2019 6:24    Post subject: Reply with quote
Your ISP modem is not in bridge mode otherwise the Netgear would get a Public IP.

Sou you have to port forward both your ISP modem and the Netgear

If possible use bridge mode on the ISP modem if not place the Netgear in the DMZ of the ISP modem that saves you the port forwarding from the ISP modem.

If you place the Netgear in the DMZ then give it a static lease.

The build of your Netgear is really old, consider upgrading, read the build threads, it could be that this is one of the routers that is picky about build size

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
castletonroad
DD-WRT Novice


Joined: 23 Oct 2018
Posts: 27

PostPosted: Sun Mar 31, 2019 6:46    Post subject: Reply with quote
eibgrad wrote:
Something doesn't make sense here. If the Sagecom is in bridge mode, then the dd-wrt router should be assigned the public IP on its WAN. But you indicated a *private* IP (192.168.1.3). You can't remotely access your dd-wrt router unless it has a *public* IP!


The Sagecom says it's in bridge mode.

FYI, this morning I swapped out a Netgear D6200 (stock firmware) for this WNDR3700 (DDWRT). I recall port forwarding worked, and it saw the ISP IP as it's IP, not an assigned IP like 192.168.1.3...
castletonroad
DD-WRT Novice


Joined: 23 Oct 2018
Posts: 27

PostPosted: Sun Mar 31, 2019 6:52    Post subject: Reply with quote
egc wrote:
Your ISP modem is not in bridge mode otherwise the Netgear would get a Public IP.

Sou you have to port forward both your ISP modem and the Netgear

If possible use bridge mode on the ISP modem if not place the Netgear in the DMZ of the ISP modem that saves you the port forwarding from the ISP modem.

If you place the Netgear in the DMZ then give it a static lease.

The build of your Netgear is really old, consider upgrading, read the build threads, it could be that this is one of the routers that is picky about build size


Sagecom says the WNDR3700 with a static IP is in the DMZ...
sploit
DD-WRT User


Joined: 16 Apr 2016
Posts: 307
Location: California

PostPosted: Mon Apr 01, 2019 0:41    Post subject: Reset Reply with quote
Factory reset the wndr3700. Then factory reset the cable modem.
Put the cable modem in bridge mode after the factory reset.

The cable modem will firewall the router if you switch between a known router and a foreign router.

I encounter this problem all the time with my customers who swap out their old routers with new ddwrt routers. The cable modem always has to be reset on isp equipment.

_________________
My Karma ran over your Dogma
SploitWorks Custom Flashed Routers
castletonroad
DD-WRT Novice


Joined: 23 Oct 2018
Posts: 27

PostPosted: Mon Apr 01, 2019 8:07    Post subject: Re: Reset Reply with quote
sploit wrote:
Factory reset the wndr3700. Then factory reset the cable modem.
Put the cable modem in bridge mode after the factory reset.

The cable modem will firewall the router if you switch between a known router and a foreign router.

I encounter this problem all the time with my customers who swap out their old routers with new ddwrt routers. The cable modem always has to be reset on isp equipment.


Spot-on.

A clue that the ISP router/modem (F@ST5355) was misbehaving was in that the VOIP phone light was still on, and the internal admin page said the phone was available - internet phone is NOT available on this router when in 'bridge mode'.

I factory reset the ISP router/modem (F@ST5355), then put it back into 'bridge mode'. Didn't even need to reboot the WNDR3700v4 DDWRT router, just renewed the DHCP lease.

All is now working the way it should! My DDWRT router is now seeing the ISP provided IP.

Thanks all for helping me out.
sploit
DD-WRT User


Joined: 16 Apr 2016
Posts: 307
Location: California

PostPosted: Mon Apr 01, 2019 8:19    Post subject: Your Welcome Reply with quote
Your Welcome.

And the only reason I suggested the wndr3700 reset was because you has setup so many settings I wasnt sure if any of them might cause other problems as well.

_________________
My Karma ran over your Dogma
SploitWorks Custom Flashed Routers
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum