MQP3 Dabbling in all things tech

28Jul/10Off

Routes and Personal Blacklists (Part 1)

Routing (or Static Routing) comes from the networking and router field of study/terminology.  While it is highly useful to know how to configure static routes in the case of routers and networks, I will mostly be talking about uses on a personal computer basis and what the applications are in that capacity.

First, a little background:

Static routes are designed to allow user to manually (as apposed to dynamically) configure the path that their computer network traffic will take based on certain criteria.  Routing usually only needs to be manually changed if there is a lack of communication between two routers, or the router and the computer.

Say, for example, a computer has two network ports connected to two different networks; the computer will have two different IP addresses and two different gateways; therefore that computer has two different paths for accessing the Internet (assuming both networks are Internet-connected) which path will the computer take? With static routing all this traffic can be forced to take one path or another.  All that is being configured is the next hop in a series of hops for a particular interface.

Replace "computer" in the example with "router" and you can see why static routing can be important in the grand scheme of things.

Chances are, in reality not that many people are going to have their personal computers attached to two different internet-enabled networks, but that doesn't mean static routes are unimportant.

Just last week my personal router was having troubles overheating and had all sorts of erratic problems.  After several days of investigation, I found the issue.

For a little topology lesson: I have a router that distributes its signal to three computers and a number of other Internet-connected devices like Smartphones.  One computer, known as Joker, is connected via Ethernet, everything else is attached with WiFi.  Joker is the only desktop so it made the most sense to tether him to one place with a cord.  After I would wake him up from sleep his network connection wouldn't fully connect until I would physically reset the router.  Restarting the router every time I wanted to use the internet on Joker became old really fast.

Begin the investigation:

Screenshot of his "Local Area Connection" network connection details in Windows 7 while having these problems.

Network Connection Details

Network Connection Details

Everything looks totally legit here. Nothing out of the ordinary.

I was taught to look from the inside out, especially with network problems.  Pinging localhost is the fastest way to check if a network adapter is working properly.

ping localhost

ping localhost

That is all good.  Even pinging my local IP address seemed to work just fine as well.  After putting up with resetting the router for a few days, it dawned on me.. Why don't I look at my routes?  Here is a copy/paste from running the "route print" command in Windows 7 at the time of the problem (note that the two top entries were switched occasionally).

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0         On-link       172.16.0.46     20
          0.0.0.0          0.0.0.0       172.16.0.1      172.16.0.46     20
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
      169.254.0.0      255.255.0.0         On-link       172.16.0.46     30
  169.254.255.255  255.255.255.255         On-link       172.16.0.46    276
       172.16.0.0    255.255.255.0         On-link       172.16.0.46    276
      172.16.0.50  255.255.255.255         On-link       172.16.0.46    276
     172.16.0.255  255.255.255.255         On-link       172.16.0.46    276
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link       172.16.0.46    276
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link       172.16.0.46    276
===========================================================================
Persistent Routes:
  None

Reading this is table pretty straightforward, the Network Destination is the criteria (0.0.0.0 being a catchall), the Netmask is the mask for the criteria (0.0.0.0 ditto), the Gateway is where that criteria-filtered traffic is going to head where On-link is 127.0.0.1, the Interface is telling us which interface the rule applies to, and the Metric is sort of like the priority.

I find it somewhat funny, that exactly at the time I am researching routes... is the very time I needed it to solve a strange problem involving my routes.  The problem in the table above is that I have two "all traffic" rules, the top two entries.  Sometimes the two entries would be switched and other times they would look just like this.  The problem is that the routes table was telling Joker that the all Internet traffic could be found by going to 127.0.0.1, which is totally false.  I don't believe I am hosting the entirety of the Internet on my computer.

I blame this on the fact that the two rules have the same metric, and therefore the same priority.  When I would release/renew my IP address, the same problem would come up, but only on the Wired connection, which made it even more odd.

After a while the Vista/7 "you're connected to the internet" diagram would show a successful connection in Network and Sharing Center, seen below.

Internet Connected

Internet Connected

The only way I could fix the routes was resetting the router and waiting for a new IP address.  Until I discovered this, the real problem, the routes were messed up.

The way I fixed this problem on a temporary basis is by running the route add/change command which goes something like this (format from route /?):

> route ADD 0.0.0.0 MASK 0.0.0.0  172.16.0.1 METRIC 20 IF 11
       destination^      ^mask    ^gateway    metric^     ^
                                                 Interface^

or

> route CHANGE 0.0.0.0 MASK 0.0.0.0 172.16.0.1 METRIC 20 IF 11

This command will either add a new entry with an "all traffic" as the criteria, and point it to the correct gateway, or it would change the current 0.0.0.0 entry to the correct gateway (I would use both, since sometimes the first one would throw an error).  Note that I didn't want to use the -p flag (persistent), which would make the route static, even when the system was rebooted, because I did not want to have to come back and delete it when I figured what the real problem was.  Yeah, I'm lazy.  I imagine the router was assigning two routes, and only the one that was supposed to work (172.16.0.1) was listed in the Network Connection Details as the correct gateway, as seen in the first picture.

Problem solved discovered. A firmware update and getting it out of the overheating situation lead to: Problem solved.

Blacklisting

next time...

I decided this post was too long, so I've broken it up in to two parts.  Look for the rest of it, soon.

Filed under: Daily, Tech No Comments
22Apr/10Off

Personal Posts xxxxxdead

I have murdered all of my personal posts and moved them over to KOandJR.com.

I will also have you know that I have my last OS X/MacBook post (#6) in the final stages of its gestation.

That is all.

Filed under: Daily No Comments
26Mar/10Off

Wireshark Winner

I have officially been entered in to the Wireshark hall of fame.

Okay, maybe not.  But, for the first time in a non-scholastic environment, I used Wireshark to solve a real-life problem.

I was at home, trying to get my MacBook connected to my Win7 Pro "Server" machine, and stream a movie file located on a share.  I do this streaming several times a week, and always have problems.

On a (somewhat) side note, I am pretty sure that Apple is against Windows shares because they NEVER show up in the Network locations place.

Network Empty

Network Empty

This screenshot is taken on a network with a NAS with a samba share and two Windows 7 machines, both with shares available and open.  I can sit and wait for the refresh period build into Samba and it never shows up.  I hate networking with Windows on this MacBook.  I can CMD+K in Finder and smb://serverName/ and it'll open right up, but the servers never show up in the Network for some odd reason that I have yet to discover.  Suggestions welcome.

Back on topic, I was CMD+K'ing with my Win7 boxes name and every time I would try to connect it would throw and error.  I started cursing Steve Jobs name because he just hates Windows.  Cue Wireshark.

For help with the picture, dent.local is the name of my MacBook and 192.168.1.15 is the IP of my Win7 pro box.

I set a filter so I could see all traffic between me and the Win7 guy, so I could find out what is happening.  After a little (17.1k packets) while of capturing I found the gem I was looking for- an Error!

Wireshark Capture

Wireshark Capture

Sorry for those with small resolutions, that lightbox is going to fill your screen!

I found the problem, looked for a solution and ended up just restarting the Win7 box in order to connect to it.  It wasn't out of RAM, I could connect to it with other Windows boxes, but OS X just couldn't do it.  Strange behavior.  Thank goodness restarting always fixes even the worst of problems.

Filed under: Daily No Comments
25Mar/10Off

Google Wave Invites

I have lots of Google Wave invites. Lots.

I understand there is a small privacy flaw in this distribution method, but I don't want them any more.

First come, first served.

https://wave.google.com/wave/invite?a=pre&wtok=79e43704a0723898&wsig=ABk8uhRheYEpyCTgggVkNUxivO41U3UJ0w
https://wave.google.com/wave/invite?a=pre&wtok=522da1578d51a4bb&wsig=ABk8uhQTnIAdEg-PFJA3Hmt8jvcYQJtkWw
https://wave.google.com/wave/invite?a=pre&wtok=b047497d2ed6c20f&wsig=ABk8uhRidipG5hZYJ3eqsCxWk-OeRAfNSQ
https://wave.google.com/wave/invite?a=pre&wtok=f3c9b398654e8a8c&wsig=ABk8uhTDT7M5m309VAiuBNGTewf5sFdWmQ
https://wave.google.com/wave/invite?a=pre&wtok=bbd20b49a42c437e&wsig=ABk8uhT2-KUd7cGffh7-4e8bkbp0Ieuk9A
https://wave.google.com/wave/invite?a=pre&wtok=1522c218754e63cf&wsig=ABk8uhQ8T_dleSXY7wfgBNcaULaSroRSzg
https://wave.google.com/wave/invite?a=pre&wtok=12510db5648c214e&wsig=ABk8uhTY1ygGA5H8yPzKEliKgCtPmpjbYw
https://wave.google.com/wave/invite?a=pre&wtok=49b877b9e78e4623&wsig=ABk8uhQkzXrJoRjRPWeWofQ5RK7tmVijgQ
https://wave.google.com/wave/invite?a=pre&wtok=4e0c12ef6d147e39&wsig=ABk8uhSueMtNmYQ74MQboqAOiIgIHjzPxg
https://wave.google.com/wave/invite?a=pre&wtok=07a410bfb426cbe1&wsig=ABk8uhRVkFP7jZp2VnFf5aAAFJXx2QFaCg
https://wave.google.com/wave/invite?a=pre&wtok=1358ea488c26c54c&wsig=ABk8uhSFshODCfnYCHBrpDDnGQ6H3kuw0g
https://wave.google.com/wave/invite?a=pre&wtok=b54c48a5b4c524a3&wsig=ABk8uhRxn48jXAJHxYC0ZG5s2wVjiB50EA
https://wave.google.com/wave/invite?a=pre&wtok=31cc79f23541d090&wsig=ABk8uhRw3EophNc9WB7kHOZTpPTTX0B-ZQ
https://wave.google.com/wave/invite?a=pre&wtok=76840734fd3c8c4c&wsig=ABk8uhSgTbZRxpah_yTXF9AyN4UCHNoalQ
https://wave.google.com/wave/invite?a=pre&wtok=4a1b020c7662f754&wsig=ABk8uhRS_KDJDBw2hYuuc5vz4vXcGR0fcw
https://wave.google.com/wave/invite?a=pre&wtok=2556c69069724b96&wsig=ABk8uhRJHUtWZO7jxVrdPNfYxnGQfLnw2A
https://wave.google.com/wave/invite?a=pre&wtok=4e9c59443fe7f3a5&wsig=ABk8uhSDAQ6oOvnqfAujyN9FL39losndYQ
Filed under: Daily, Tech No Comments