I put this note together for my future reference. But, then, a friend suggested that it may be helpful to others. So, I decided to post it here, on the Interwebs …
First, the backstory:
So I have had this D-Link 2730 DSL modem at home for the past year and half. Out of the box, this was a full fledged DSL-modem + Ethernet and Wifi router. Setting it up was easy, but, the Wifi on this box had always been pathetic. It started with “good signal upto about 10 ft” and gradually faded to “ok signal upto about 5 ft”. Then, over the past 6 odd months, the Wifi started getting weaker to the point where it completely died out on March 3, 2014! That was a sad day because I had to tether my laptop to the modem over an Ethernet cable. And there was no way for my phones and tablet to connect to the Interwebs over wifi at home. So I wondered how to fix my no-Wifi at home situation.
Of course, the easiest answer was to go out there and buy another modem from an electronics retail store, like an Indian version of America’s Best Buy. India now has a lot of retail stores, big and small, that sell various computer accessories. The closest such store was just a few kms from my home. But, considering the heat and even worse, all the people interactions I would have to undertake to get a modem, I figured I would buy one online.
So, I checked at various online retail stores in India. And my favorite store so far, Flipkart, had the modem I wanted. But, ever since Flipkart goofed up my last order I have desisted from ordering anything from them. Also, with Flipkart the delivery timings are like “anytime from 9:00 am to 7:00 pm” which basically means that I would have to sit at home for an entire day just waiting for my shipment to come in.
There was a third way: I could go the route I had taken a few years back when I setup an old Linux laptop to be the Wifi gateway. Essentially, the Ethernet on the laptop was connected to the modem and then, using simple iptables configuration, I had setup the laptop as a Wifi gateway (with NetworkManager disabled). This had enabled my other notebooks to connect to the Wifi-gateway-laptop over Wifi (obviously) and then the laptop would forward all the traffic in/out the modem. But, this time through I was in no real mood to “use” an entire laptop for such a trivial task.
So, just as I was wondering if I should go out there and get myself a new modem a light bulb lit up in my head. Somewhere in all the stowed away “old equipment” I had a 3G router that I had bought a couple of years ago but never really used. So, if I could locate it:
- I wouldn’t have to go out in the Indian heat
- Even more importantly, I wouldn’t have to interact with all the people (the auto-rickshaw drivers, the unnecessarily arrogant boys and girls who work at those retail stores, the crazy sales people who want to sell me more than I want to buy, the always suspicious security that guard the retail stores, etc.)
- I would learn some networking
So, if I could locate that 3G router then, it would be a win-win situation (no people interaction + learning networking). So, with all the will power I could muster, I pulled myself out of my chair and rummaged through all my boxes to ultimately find an old but unused TP-Link MR-3020 3G router in one of my boxes.
Alright! So, that’s the back story. Now onto the “putting together the networking rig” part of the story …
Setting up the networking rig:
I had a fairly basic configuration in mind.
Realize that this configuration is similar to the “old linux laptop as a Wifi gateway” mentioned earlier. The only difference here is that a physically big piece of hardware, the old linux laptop, has been replaced by a tiny piece of dedicated hardware, the TP-Link 3G router.
Setting up the TP-Link router wasn’t exactly “a charm”. The router has all these various modes called AP, WISP, WPS and what have you. It can act as a repeater, an client ap, a server ap and even more what have you. Without digressing: one of the biggest reasons Wifi is so frustrating is that you really need to know about all this stuff to figure out what you really want. Wifi is, clearly, not as simple and easy as Ethernet: plug-n-play. But, the biggest stupidity with this specific TP-Link MR3020 3G router is that it has this little “mechanical” switch which puts the router into various modes. So, I was never sure whether the physical/mechanical switch overrode the software configuration I did or was it the other way around. The confusion was further exacerbated by the fact that the TP-Link router continuously shows “help text” in the right-most frame of the router’s configuration web page. The fact is that this help text is complete and utter gibberish. (NOTE that I am not saying I know English well … but, I can assure you that the TP-Link 3G router help text is worse than the gibberish the Minions speak. I feel that TP-Link should hire an American technical writer to create sane user-manuals and online-help.) But, getting back to the point of this post …
After playing with various configuration settings for almost 2 hours and having forgotten English because of all the gibberish help the TP-Link 3G router kept showing on the side (just kidding … about the forgetting English part), I figured I had wasted enough time. What I wanted was really simple (see the diagram above) … so I did what most computer engineers do when they have faulty or not-working-as-expected computing equipment: I hard reset the TP-Link 3G router. But, before that I set the physical/mechanical switch on the TP-Link 3G router to “3G” mode. Then, I connected the box to my laptop over Ethernet and logged into it. Although it appeared to have been completely reset, I didn’t want to take chances with the Chinese (just kidding). So, I hunted down the “reset to factory defaults” link on the router’s configuration page and reset it once again.
Then, after the reboot, setting it up was “almost” fairly easy:
- I enabled a Wifi network and secured it with WPA/WPA-2 (Personal) password
- I enabled MAC filtering and added the Wifi MAC addresses of all my computers, phones and tablet
- I setup the DHCP server on the box to dish out specific IP addresses to my computers. This makes it easy for me to transfer files from my phones and tablet to my computers. (NOTE that I run Open-SSH server on all of my computers. And I have Turbo Client on all of my phones and the tablet.)
- I setup the box to connect to the Interwebs only over WAN and therefore to completely ignore 3G. This WAN connection is through the Ethernet port on the TP-Link 3G router.
After saving that configuration I reboot the TP-Link 3G router and hooked it up to the D-Link 2730 over Ethernet.
With that setup, my computers, phones and tablet showed that they had a super strong Wifi signal like I had never seen in the past few years. 🙂 I got all of them to connect to my newly setup Wifi network. But, I couldn’t browse the Interwebs! 😦
Do you remember that earlier I said it was “almost” easy to setup? You see, the TP-Link 3G router has this crazy thing called MAC-clone which I had never seen/heard before and I hope I never have to deal with it again! Also, the gibberish help added to all the confusion. You see, earlier I had copied the MAC address of the D-Link modem into this “field” on the TP-Link 3G router’s configuration page because I was unable to figure out what the TP-Link help manual was trying to convey. But, since things weren’t working as expected, this seemed to be the only field that could be causing the problem. So, I “restored” that field to have the TP-Link 3G router’s MAC address. I saved the configuration, prayed to the Gods and reboot the 3G router. And after about 3 minutes, I was browsing the web like there was no tomorrow. 🙂
But, the show wasn’t over boys-n-girls. I still had to get a few things done on the D-Link 2730.
- I directly connected my laptop to the D-Link modem over Ethernet and logged into the modem
- I completely disabled Wifi (rather, whatever was left of it) on the D-Link 2730.
- If you didn’t realize why I had to directly connect my laptop to the D-Link modem, then here it is: Because of the two address spaces (the TP-Link router gave out addresses in 192.168.0/24 on its Wifi. The D-Link modem gave out 192.168.1/24 on its Ethernet … thus giving the TP-Link router’s Ethernet port an IP address of 192.168.1.111) the D-Link modem had no way to get back to my computers. It probably assumed that any unknown IP address (even private IP?) should be routed out to the ISP. So, to get my computers and the D-Link modem to talk to each other I setup a static route on the D-Link 2730 so that all communication with 192.168.0.0/24 is directed back to the TP-Link 3G router (192.168.1.111) over Ethernet.
And finally, all was good. Now, I have a fairly decent Wifi signal all through my house. In fact, even my neighbors are getting it and I noticed they have already tried to hack in … so far unsuccessfully.
So, that’s that boys-n-girls. Thanks to my laziness (not wanting to go out in the heat) and craziness (wanting to learn the TP-Link gibberish and waste my time putting together this rig), I finally put together a rig that gives me decent Wifi access all through my house and lets me connect to the Interwebs. I am happy … for now.
- D-Link 2730U DSL modem image from D-Link
- TP-Link MR3020 3G router image from TP-Link
- Laptop image from Cisco icons