Friday, July 29, 2016

Cable WLAN / home network connectivity debug

Somehow my cable connection is quite bad, gets lost, takes long time to connect, when streaming videos these are really choppy. So, I decided to dive in the home networking to try to solve this once and for all!
  1. When streaming in Youtube, I can see with the System Monitor the download speeds dropping to almost zero and the video failing to keep loading...
  2. Speedtest actually comes to about 1Mbps and works even when the video is not loading.
  3. Modem (Motorola Surfboard SB6141) to router (either Netgear WGR614 v6 or Fry's FR-300RTR) light shows orange blinking, which indicates less than 100Mbps connection (is this normal?)
  4. Connecting directly with wire to the modem shows 0 packets lost and pings (http://www.pingtest.net/) of 14ms with jitter of 4ms, consistently. For the test to be reliable, stop any other network activity. Youtube seems to interfere sometimes and speedtest.net interferes a lot (which makes sense).
  5. Checking the ports for security on this mode (connected directly to modem), many ports are easy to find (visible or closed) but somehow they change with the scan (like something is adapting!?). The PC firewall (vino) is on.
  6. We then disconnect our home PC and switch to the laptop, the laptop does not connect, even after 20 minutes and several repair (Windows) attempts. It did have an IP (169.254.177.150).
  7. Plug back into the home computer and flies back. Modem IP is 192.168.100.1. Connecting to it and checking "addresses" one can see that the CPE MAC address is D0:50:99:3B:5F:6C (the one on my PC).
  8. Connect back the laptop and again, does not work. 
  9. Reboot the modem and sure enough, the laptop works now! New CPE MAC is E8:E0:B7:EE:B3:E5.
  10. Our theory is that the modem needs to renew the new computer address after that is plugged (Max of 1) and do to so, the easiest way is to restart the modem. To prove it, we plug the home PC back and sure enough, now that is the one not working. But if I clone (spoof) the MAC address of the Linux box to E8:E0:B7:EE:B3:E5 it connects flawlessly right away!
  11. Unfortunately the Intel adapter on my Windows laptop does not allow for that, at least through the Device Manager (this other link may work). So, I am going to leave my Linux box like this which will make transparent the switch of the cable, if I ever need to.
So, one mystery down, but still haven't solved the streaming. It probably has to do with the router. So, let's debug that...
  1. We plug now the Fry's router to the linux PC (not to the modem!). And connect to the router by typing 192.168.0.1. 
  2. Then try cloning the MAC of the modem (the WAN, under Status, on Device Info) to be the same as that of the Linux PC (which is now also the same as the laptop xxE5). Nevertheless, we have a familiar issue with the router refusing to accept that as a valid MAC address. Found solution here. Basically there is an error on a java function that validates the address (in public.js). You got to open the console and overwrite it by typing: check_mac = function check_mac(mac){ var error = true; return error; }. There is a 2nd function that you got to overwrite too: check_mac_00 with the same.
  3. So, to recap, now we got laptop, PC and router with the same MAC. We should be able to plug the router onto the modem and go, but somehow, even before that, after cloning, the PC can't connect to the router. If I change the MAC of my PC, then I can, no problem. Actually the laptop has also the same issue. This happens already without connecting to the WAN, so, got to be something related to the router. Maybe related to the DHCP?
  4. Found out that the MAC filtering was enabled and E8:E0:B7:EE:B3:E5 was not in there. Wondering if I ever got my laptop connected through wire to the Fry's router. Wonder also if when I did step 2, my Linux PC had still its MAC, not the cloned, and that is why I could connect. And only when I switched to E8:E0:B7:EE:B3:E5 failed... A mystery but after adding E8:E0:B7:EE:B3:E5 to the list of addresses, now it is working.
  5. Tested the speed of the net and looks good. Also with video streaming.
Wireless
  1. This was straightforward as I had already configure it. Using the Fry's router, connecting my cell phone through WiFi and testing the speed, had no issues. Same for the laptop, in the sense that it looked the same as through the wired connection on the PC, although the upload speed on both cases was pretty poor (0.5Mbps).
VPN:
  1. The final test was to connect my laptop wirelessly and see if all works fine as it used to fail too sometimes. Nevertheless, now I got no issues. Ping and speed was a bit slower but no big deal, likely due to the VPN itself. 
So, hopefully this is it. I'll revisit if any future issues.

Update: about 1 year later, things continue to work solid. Actually I had to unplug everything because of some remodeling at the apartment and plugging it back, without changing any configuration (but in the right order, as above, although I can't think of why I have to, as all the MACs still the same) and it is working great.

Other links of interest:

No comments:

Post a Comment