Home Network Project
RSS icon Email icon Home icon
  • MTR – Network Diagnostic Tool

    Posted on July 11th, 2009 lance No comments

    Traceroute

    You may have used traceroute in a Micrsoft OS or in Linux.  It’s quite simple and can tell you a few things about the connection between you and any other device on the internet.   Just type in traceroute <domain name> and hit enter.  You should see something like the following.

    traceroute to microsoft.com (207.46.232.182), 30 hops max 40 byte packets
    1 192.168.64.64
    (192.168.64.64) 1.210 ms 1.237 ms 1.304 ms
    2 x-xxx-137-216.mtaonline.net (216.137.xxx.x) 37.635 ms 37.693 ms 38.798 ms
    3 6506-1-er-ge3-2.mtaonline.net (216.152.176.205) 40.463 ms 42.126 ms 43.595 ms
    4 7606-1-er-po1.mtaonline.net (216.152.176.157) 45.261 ms 46.985 ms 48.903 ms
    5 197-168-165-209.static.gci.net (209.165.168.197) 51.290 ms 52.718 ms 54.420 ms
    6 209-128-165-209.gci.net (209.165.128.209) 84.047 ms 60.093 ms 61.256 ms
    7 8-128-165-209.gci.net (209.165.128.8) 62.892 ms 64.553 ms 66.021 ms
    8 52-129-165-209.gci.net (209.165.129.52) 67.917 ms 69.604 ms 71.020 ms
    9 217-129-165-209.gci.net (209.165.129.217) 72.445 ms 73.898 ms 75.299 ms
    10 InetSeaSDCsw-1.gci.net (209.165.129.62) 77.711 ms 78.967 ms 80.682 ms
    11 ge-7-3-0-58.wst-64cb-1a.ntwk.msn.net (207.46.46.41) 82.308 ms 83.984 ms 87.674 ms
    12 ge-0-2-0-0.tuk-64cb-1b.ntwk.msn.net (207.46.47.70) 61.504 ms 60.918 ms 61.017 ms
    13 ten2-4.tuk-76c-1b.ntwk.msn.net (207.46.46.23) 63.226 ms 64.564 ms 66.245 ms


    The second column lists the name (or IP) of the next device interface, and then the next column it’s IP address.  This goes on until you hit the destination.  All the while you are given the time it has taken to send the ICMP message to each device and then the return message.  If you notice, the further away the device is, the longer it takes.  But not always, as the last two devices show ~66ms while #11 had ~82ms to ~87ms.

    If you were having problems on the internet and it seemed there were a bottleneck somewhere, this nice little tool can help you identify if one exists.  Perhaps if one of those above was returning ~70ms and then the next device gave you ~250ms.   That’s a noticeable difference, and it could indicate the the link between those two devices has maxed it’s bandwidth at that particular time.   Not that you could do anything about it.

    MTR

    So what if the problem were intermittent, or traceroute did not show any problems because perhaps the chokepoint is experiencing intermittent bursts of data?  Enter MTR, the big brother to tracerouteMTR (or My Trace Route) can show you a constant display of each link and how it’s holding up.  Take a look.

    If you have MTR installed (aptitude install mtr), run it as you would traceroute.  i.e. MTR YAHOO.COM

    My Traceroute

    Click to see full image

    The default display looks much like a regular traceroute display, aside from the data is constantly changing and there’s a few more columns of information.  The data changes due to the fact that it’s constantly getting data for you, no once, but constantly until you quit.

    After the hostname, you are given columns telling you how much packet loss you get.  How many packets were sent.  Then you get to see how the pings are doing.  You get what the last time it took for the response, the average time, the best it’s been to that particular host and the worst time.  You also get a standard deviation.   Not exactly sure on this one yet, but lower seems better.

    As you can see from the example above, once we went from device #4 to  #5, the pings doubled and then from # 5 to #6, the pings doubled again.   The first time it doubled, it’s not too bad because that’s an increase in 30ms whereas the second jump was a good 72+ ms.

    Not that I’m saying here’s a bottleneck, by no means.  However, if anywhere between me and nandomedia.com there would be one, that’s my first suspect.   This trace is pretty simple anyway.  If I were to see much larger numbers then I would be concerned.  Again, not that I can do anything about it, but at least I know it’s not my network, unless the problem was on my network, then I’ll point fingers.

    Click to see full image

    Click to see full image

    Hit the D key.  Here you can change the display.   You get a nice view of the packets as they are returned.  This first view does not offer much, so hit the D key again.   DO IT!!!  You’ll like it.  At least better than this view.

    Click to see full image

    Click to see full image

    Now this is much more informational.  On the bottom of the screen is a scale.  It shows you what each dot, number and letter up above mean.  The period is 7ms and as you can see from my PC to my router, that’s what it should be.  The next hop is to my ISP and there’s 3’s all along there and the other 2 routers at that location.  The 3 is less than 54ms, but since it’s not a 2, it’s greater than 29ms.  You see an ‘a’ and a ‘b’ up there too.  So the return just from my ISP had a ping return over 54ms and one over 120ms just in these 57 pings.

    The display is nice because it scrolls nicely to the left and you can see if there’s just a burp as in the ‘c’ at location #9 or if there’s a serious problem.  And if you need to resize your terminal window, MTR will adjust what it displays with ease.  Above it’s got room to show the last 57 pings, but if I widened it, it would quickly change accordingly.

    So, as traceroute is handy, it’s not constant, it gives a snapshot and things may be fine at that moment.  Ping is okay, but does not provide very much info.   MTR is the all around tool to replace both.

  • Web Server

    Posted on June 20th, 2009 lance No comments

    Web Pages

    So now you’ve got an older computer on your home or business network with Linux running on it.  It’s not doing much, perhaps monitoring your network.  What else can you do?  Oh, as I find every day, the possibilities are endless.

    One thing that most may think is hard to do, is set up a web server.  Yes, you can serve up web pages without having to sign up for a web-hosting service.  Do it yourself.

    You can have them available on the net even if you don’t have a static IP address or even a domain name, just by using a dynamic dns service.  Or you can keep them available just to your private network.  Each user can have their own section to themselves.  I use one of mine for testing before moving them to whatever web hosting server that hosts the working site.  I have another one just for my personal site that I share with family & friends.

    APACHE

    Geronimo

    Apache

    One of the most famous of Apache is Geronimo, but we are not going to be discussing that Apache, but rather the most widely distributed and used web server software available.  It’s no accident that it holds this top spot, it not only works, but does a great job.  Much like myself.

    Get it.  Install it.

    Now if you’ve got Debian or Ubuntu (or derivitive) you can install with:  aptitude install apache2.  If you have a distro such as Red Hat, Fedora or Mandrake, you can use: yum install apache2.

    I’m not going to go over the whole installation and configuration process here, but a wealth of that knowledge can be found here.  However, once you get the installation completed, you’ll be able to host your own web pages.

    Additional Web Apps

    Now that you’ve got your Web Server up and running, you can do so much more.  For starters, you can install Nagios for keeping tabs on your network.  You can install webalizer to keep stats on your web server.  I installed coppermine for serving up picture galleries (although, this also involved having PHP and mySQL being installed as well).  The possibilities are never ending.  Anything you’ve seen on the net, you can pretty much find an open source app to add to your own server.

  • Using DNS to block access to unwanted websites on your network.

    Posted on May 5th, 2009 lance No comments

    Why block sites from your network?

    Some businesses need to protect themselves from sexual harassment suits, so certain sites need to be blocked.  Just because they have a no harassment policy does not mean ALL employees are going to obey it.  Trust me, I work with some of these boneheads.  Companies also attempt to block time wasting on the computers as well.  They have the right, and some exercise it, to monitor net traffic on their network, but sometimes it’s just easier and cheaper to block certain websites.

    I read a post one day where a man was allowing his daughter and deadbeat son-in-law to live in his attached apartment while the son-in-law supposedly was looking for a job.  He allowed them to use his wireless Internet connection since the son-in-law claimed it was necessary in finding a job.  The father was suspicious of the Internet activities so as the Internet provider for his daughter and son-in-law, he wanted a way in which he could limit certain activities.

    Categories

    Categories

    Parents too may feel the need to block certain sites for obvious reasons, but then they may want to also be more specific in what’s blocked.

    There are several options available.

    One option is a little more involved and I hope to be able to play with it and post my experience here.  That would involve setting up a proxy server such as squid, and then setting up either SquidGuard or DansGuardian to block unwanted content.

    Another option would work for windows and mac users.  That would be NetNanny.  The basic Family Pack Special at the time of this writing is under $60 for 3 Windows PCs for a year.  I’ve looked at it a while back and is quite configureable.  If you want to spend the money, this looks like a great option.  But we’ll see if we can find anything cheaper that fits the bill.

    The one we’re going to look at today is OpenDNS.  Can you say “FREE“?  Okay, why are we waiting?  No, I am not paid by OpenDNS, but for a freebie, it is definitely worth interrogating.

    The nice thing about OpenDNS is that it replaces your current DNS servers, so what operating system you use is a non issue.  Also, if you want your router to provide DNS listing, you’re covered there as well.  Nifty, I must say.   So, how does this work?  What do I need to do?  After reading these steps and you decide this is an option you wish to explore, go to OpenDNS, of course, and create an account.

    How does OpenDNS work?

    Just to recap from my post on Dynamic DNS, when you ask for a website through your browser, your computer does not know where to get it from, so it asks a DNS server, for example, where technopotomus.com resides.  The DNS server then tells your computer the IP address of the requested URL and then your computer makes a request for a web page from that particular IP address it was given.

    Does it matter what DNS server you use?  Mostly yes, sometimes no.  Or is it the other way around?  Anyway, the closer to you that your DNS server is, the faster the response to your request will be.  Also, most DNS servers are constantly being updated with the IP addresses of all the domains on the Internet.  So normally, you’d want the DNS server that your Internet provider provides for you.  This is normally given to your computer or router automatically through DHCP as it also grabs its dynamic IP address.

    Identification through IP address.

    If now, you change your DNS server to OpenDNS’ servers, will everything work okay?  NO.  How will they be able to differentiate your requests from mine?  By your IP address.  This provides a dilemma, considering most people use dynamic IP addresses.  It changes anytime they reconnect to their Internet provider.  Even if you have a broadband connection and never disconnect, you still run that risk.  The power in your area could experience a momentary hit, causing your router to be powered off  long enough to have to reconnect, thereby getting a new assigned dynamic IP.

    How do we fix this?  Dynamic DNS.  Even if you are not interested in a domain name to connect to your computer or network, it is necessary in order to use OpenDNS.  Why?  Because they said so!!  That’s why!  Oh . . . wait, no that’s not why.  It’s so when your IP address changes, your computer or router logs into your Dynamic DNS service, therefore updating with them what YOUR IP address is at any given moment (except for that moment the power went out for a minute and your computer/router logged back on to the net).  That service can be setup to then update your IP address with OpenDNS.  NOW they know your IP address. And NOW they know who is making the request for a specific web site.

    Okay.  Do we have that all cleared up now?   Good.  Let’s move on.

    All your base are belong to us.

    networks

    Networks

    What does that mean?  Okay, wikipedia has the answer to this one.  Let me rephrase that.   Now that OpenDNS knows what your IP address is, their DNS server can then give you the IP addresses of the sites and only the sites that you desire per your settings.

    Even if you have more than one IP address, you can add it and configure different settings for any computers using that address.  It is quite configurable I must say.  This opens up a larger number of possible scenarios.

    Create a Shortcut

    Create a Shortcut

    Another nice customization they offer is that of shortcuts.  Let’s say you have a URL that you go to alot, but it’s a long one to type.  Say for instance TECHNOPOTOMUS.COM.  Now that’s too many letters for your tired fingers and of course you don’t know how to user bookmarks in your browser, right?   Okay, sarcasm aside, this is still a cool little feature.  Instead of typing in the URL you want, you pre configure a shorter version, say in this instance: TECH.   Now all you have to do is type in TECH in your brower and click send, hit enter, do whatever it is you desire to send those bits in a blazing flash to the DNS server so that you can recieve your data at light speed.

    Managing and Reporting

    Manage your account

    Manage your account

    Now that you have everything all set up, you can enjoy being able to see that it’s working.  Of course, one way is to try to access a site that should deny you access.  You should get a page from OpenDNS telling you why the page was denied.  That is if everything is setup right.  Of course don’t test it out by visiting a site you don’t want the kids to see while they’re standing there.  Just in case you forgot to change your DNS servers.   Oh yeah, we didn’t get to that did we?  In a minute.

    Top Domain List

    Top Domain List

    With your account all setup, you can access the dashboard to manage your account and check stats.  The stats can show you all the web traffic from you network including what was blocked.  What’s nice is being able to specify a range of days, type of domain and then filter what you want your report to display.

    Action

    Action

    Once that’s done, you can go through the list and click on action for a particular URL to either block it in the future, or unblock it if the site was originally blocked and you desire it not to be.  It’s these individual exceptions that are nice to have easy access to.

    Configuring your DNS servers.

    Normally, as was mentioned earlier, your computer or router gets the DNS server information automatically through DHCP.  However, if you are using different DNS servers than what your ISP wants to assign to you, you’ll need to configure them on your device manually.

    LINUX – Yeah, this is easy.  Change the nameservers listed in your /etc/resolv.conf file to your new OpenDNS DNS server addresses.

    DNS settings

    DNS settings

    Windows – Access the properties for your network card, be it wired or wireless, then click on Internet Protocol in the list of items your connection uses, then click on the properties button.  At the bottom of this new panel you should have an option to obtain your DNS server addresses automatically or you can set them yourself.  Are you reading ahead?  No?  Then how did you know I was going to tell you to click on the “Use the following DNS server addresses” option?   You are one smart cookie.  Okay, then configure the addresses, smarty.

    Mac –  Mmmm, sorry, as nice as Macs are, my exposure to them is about every six months.  Just long enough to be reminded that I don’t know my way around one very well.  I’ll bet if you don’t know how to change your DNS settings on your Mac, you could find information on the Internet.  Oops, I guess this page is on the internet.  Okay, elsewhere on the Interntet.  One day I will have a Mac and you can teach me.

    Linksys setup

    Linksys setup

    Linksys Router –  Okay, I only have information for Linksys Routers.  Mainly because it’s the more common one out there.  If your router is a different brand, you too should be able to find the info you look for by searching Google.  However, you may be able to find it easy enough on your own.  Now on the Linksys main setup page, there should be settings toware the bottom for entering in your DNS server addresses.  Wow, could it be any harder?

    Summing up.

    OpenDNS does allow you to make exceptions to the rules.  So if you wanted to block ALL blogs, except this one, you would select blogs in your categories to block, but then at the bottom of the page add whatever exceptions you want.

    I have experienced a site that should not have come through.  This is possible seeing as how someone has to maintain the database and it will not be 100% perfect.  But I do know it’s more thorough than a business hiring someone to sift through a gazillion web pages to determine what category they belong to.  If you do hit a site that should’ve been blocked, OpenDNS provides a means to enter that in so that others can benefit from your find.  You can search for sites and see what category they fit into, if any.

    Keep in mind though, they are a free service and you can expect to get what you pay for.  However I do believe here you’re getting alot more.

    They do though have this little quip on their site.  Read into it however you wish.

    Note: Domain blocking is not intended to be a category blocking service, like phishing or adult site blocking. It’s intended to give you pinpoint control over what’s on your network.

  • How can Dynamic DNS help you?

    Posted on April 19th, 2009 lance No comments

    What is DNS? (domain name system)

    Let me put it in terms most people can relate to.  The phone book.  When you want to call someone who’s phone number you don’t have, you grab the white pages (or yellow if it’s a business) and then you find their name and listed phone number.  You now have a number to call and so then you dial it on your phone.  In the world of networks, the internet being the biggest, connections are made by IP addresses, not the URL (i.e. technopotomus.com).

    Phone Book

    With DNS, it’s all taken care of for you.  Your computer is programmed with a DNS server either statically or dynamically when when it obtains its temporary IP address.  Now when you enter a web address that your computer does not know the IP for, it asks the DNS server what the IP address is for the URL you requested.  It then will tell your computer the number and your browser then uses that IP address to communicate with the web server.  Much like a 411 operator can connect your call after you ask for someones number.

    The benefit of this to you and I is that we don’t have to remember the IP address for google.com, ubuntu.com or technopotomus.com.  We just have to remember their name, and that’s alot easier.  Especially when devices start using IPV6, you do NOT want to remember those numbers.

    What is dynamic DNS?

    Now if you want to connect to your home network from work, your buddies house or wherever else you have an internet connection, how are you going to do that?  Most people do not have a static IP address for their home internet connection.  Why?  Because your ISP has a pool of addresses and when your computer or your router logs into the internet with your local provider, it gives your device a temporary IP address and then when you disconnect, the IP address goes back into the pool.  The next time you connect, your IP address is likely to be different from the last time.  For most people, this is no big deal.  It’s been that way for some time without many people knowing, or caring, just so long as they can surf the net.

    Again, how are you going to connect to your home network from work?  Dynamic DNS!!

    How Dynamic DNS can be of help to you.

    If you have your own domain name, this can work.  If you don’t, this can still work.

    Keep in mind now there is a slew of Dynamic DNS providers.  Most of them provide this service for free.  Hey what could be better than that?  I suppose if they paid us to use their service, that would be better, but lets keep things on the side of reality here.  Most new household routers also provide a spot where you can enter your Dynamic DNS information (after you’ve signed up with a provider).  If you don’t have a router that will accommodate, or you’d rather not use a router for whatever reasons, you can install a small client on your computer which will do the same thing for you.

    How to get service.

    DynDNS service

    DynDNS is just one service.  I am using them as a sample only because that’s a service I have used an am familiar with them.  I imagine the others will be as simple to setup and use.  Once you create an account, you get to chose from a variety of domain names such as blogdns.com, dnsalias.com, hobby-site.com, is-a-geek.com and many, many others.  You then chose your 3rd level name to append to the front of your choice (if it’s available).  So imagine choosing birdhouses.hobby-site.com, then you can refer to your network as such.  And if you chose to setup a web server, you can give this URL out to direct traffic to your website.

    Screenshot of Linksys Dynamic DNS setup

    Your next step is to enter your login name, password and your new hostname into your router.   If you chose to use an IP update client for your computer, make sure the service you chose has a client for your operating system.  DynDNS has a client for Linux, MacOS and Windows.

    How does it work?

    Once you have completed your configuration, go make a sandwich or two and eat them.  It will take some time to update.

    The process now is that your router or client will periodically connect to your DDNS service with username and password.  When this happens, it grabs your IP address from the packets and now assigns your hostname with your IP address.  (don’t worry if your client is on a machine behind a router, the DDNS service will still obtain your public IP address)

    Once the update is complete, requests for birdhouses.hobby-site.com will route to your IP address.  Keep in mind though, that if you try to connect TO your public IP address FROM your public IP address, it will not work. Apparently routers don’t like to try to send out requests for something that it knows is NOT OUT THERE.  I found that out when my DDNS service did not work, then I gave it one last try from work  and it was working.

    Be Careful.

    Keep in mind now, that if you publish your hostname, it will be more noticeable to others, perhaps people wanting to compromise your network.  Be careful what you put on there, and what security measures you need to take to keep things secure.  If you log into your computer, be sure not to use TELNET.  It sends everything in clear text, so if you log into your computer remotely, anyone using a packet sniffer that comes upon your transmission will see your IP address, username and password.  Wow, now you’ve got a big problem.  To avoid that, use Secure Shell (SSH).  One such client is putty.  You will however have to make sure that you have an SSH server installed on the device you plan to connect to.

    So when your IP address changes, for whatever reason, you’ll never be out of your system or users denied access to your website.   As your IP address is Dynamic, so will your Domain.  Cheers.

    techno