DD-WRT on Netgear WNDR4500

Client OS: macOS Sierra 10.12.6

This router has been having strange issues since the day I got it.  It was given to me by a friend who installed dd-wrt on it.  I configured it for basic Internet connectivity with an Ethernet hand-off from my ISP but after a few days, it failed.  I couldn’t put my finger on it the first time it “flaked out” and I decided at that moment to just swap it out with a different router rather than troubleshoot the issue.  The issue wasn’t very straight-forward.  I would lose pings to it after a few minutes and I recall back then that I thought there was a memory leak that may have been causing it to reboot itself.  Why a memory leak?  Well, the ping round-trip times would gradually increase and sometimes spike to 2000ms+.  Sure, that doesn’t indicate a memory leak but I’m just saying, that’s what it felt like in the moment and I’m only mentioning this because the point is, it wasn’t something that just jumped out at me.

Then, I took it over to a friend’s house to swap their ancient WRT54G router out with a N900 router to see if they could get better coverage.  While onsite, this router did nothing that I asked it to do.  I couldn’t see any indication that it was even in working condition so for the second time, I just bagged it.

Now, it’s a rainy weekend and I have begun cleaning up my office some and this damn router is still sitting around and I’m still trying to figure out what to do with it.  This is the final straw.  If I can’t get some life out of it, it’s going in the trash (well, freecycle, actually).  Either way, I’m getting rid of it!

Let’s try just plugging it in.  After about a minute, I get a blinking green power LED.  I actually found this post from kb.netgear.com so yeah, sure, let’s do the necessary due diligence and see if I can reset it and gain connectivity to it.  I hit the reset button for 10+ seconds and for 30+ seconds and the light says blinking green.  Hmmm.  That doesn’t help at all.  Next, I did the reset where you pull the power, push in the reset button, then reattach power and that had the same results – no IP address and a blinking power light.

I decided to assign my NIC a static 192.168.1/24 IP address (Open System Preferences > go to Network > select Ethernet > under Configure IPv4 choose “Manually” and enter in the following information: IP Address = 192.168.1.111 Subnet Mask = 255.255.255.0 Router = <leave blank>).  Voilà!  I can ping 192.168.1.1.  I am not so sure this is going to work for everybody in a situation like this but it works for me!

cichlid-2:~ pja$ ping 192.168.1.1
64 bytes from 192.168.1.1: icmp_seq=140 ttl=100 time=0.345 ms
64 bytes from 192.168.1.1: icmp_seq=141 ttl=100 time=0.303 ms

Can I get to the web GUI?  Let’s try it out and see.  No luck on port 80 and 443.  I suppose I’ll port scan it to see if any services at all are up and running and bound to a port.  There is a built-in Network Utility that has a port scanner capability.  Open Spotlight > type in “Network Utility” > click on the Port Scan tab and enter in 192.168.1.1 as the target (Internet or IP address).  Click Scan.  This will take some time.  In fact, it takes a long, long time.  I specified a port range of 1-1024 (the standard reserved ports) and it still took an incredibly long time.  I decreased the range to 1-22 just to see what a response looked like and I still couldn’t get a response.  Decreasing this further to 1-2 and the utility still failed to give me any results.

I decided to try another tool.  I use home brew on my Mac.  I found a pretty handy script that gives you a rudimentary command line interface. brew install netcat and we’re ready.  Let’s scan ports 1 to 2048 on 192.168.1.1.  That looks something like this:

for PORT in {1..2048}; do netcat -vnz -w 1 192.168.1.1 $PORT; done

At least I can see what’s going on.  With the Network Utility port scanner, I couldn’t.  I could dig into that more to see if there was a way but netcat takes less time to get set up than all that other Apple stuff.

And we wait…

Most importantly, I need port 69 to respond if we’re going to have any chance to bring this thing back from the dead.  After about 15 minutes, I took the output from netcat, copied it to a text file, and grepped for anything that wasn’t “Operation timed out”.  No hits were returned.

Next, since this had dd-wrt on it before, I decided to do the 30/30/30 reset to it.  This may have been a mistake.  I found the reset instructions on this page, but this page says don’t do it on newer routers.  I don’t know what “newer” means but the alternate instructions mention the WPS button.  This router has a WPS button so maybe this router is a “newer” router.  Did I destroy it by using the 30/30/30 method?  I don’t know!  But what I found next suggests that I did NOT!

After the 30/30/30, I got more lights on the front of the router, like a solid green power LED, a green 2.4GHz LED, a 5GHz LED, and an LED on the switchport into which my laptop is plugged.  This is looking good.  I ran another netcat to see what that produced and the test happened at a much faster rate!  It took less than a minute to complete.  Wow!  What a difference.  Searching for ports that responded resulted in a familiar looking list:

cichlid-2:Downloads pja$ grep -v 'timed out' ./Netgear\ Port\ Scan\ after\ reset.txt | grep -v 'refused'
192.168.1.1 23 (telnet) open
192.168.1.1 53 (domain) open
192.168.1.1 80 (http) open

I opened a browser and went to http://192.168.1.1 and found that this router is using a beta from 2015.  I’m guessing that beta version had issues.  I’m okay trying a beta from 2017.  This one from Oct 10 to be precise.

At this point, it looks like I have a working router.  This escapade didn’t turn out to be exactly what I thought it would be.  I thought I’d be jtagging some stuff but I didn’t have to.  I’ve never jtagged anything and wanted to be sure I documented the entire process but, alas, there is nothing to document.  Just the basic troubleshooting steps I took to get to this point.

Next, configuring the dd-wrt router for my needs.