Site Map - skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr1654 :: Using AS numbers to identify where you are on the Internet

ASN uniquely identifies each network on the Internet

<< First, < Previous, Latest >>

Host Image
Hosted by Ken Fallon on 2014-12-04 is flagged as Clean and is released under a CC-BY-SA license.
Listen in ogg, spx, or mp3 format. | Comments (1)

I have a laptop and I want it to use different configurations depending on where I am. If I’m on wifi at home, I don’t want my NAS mounted, but if I’m on a wired connection I do. If I’m at work I want to connect to various servers there. If I’m in the train I want to setup a vpn tunnel. You get the idea.

My solution to this was to approach it from the laptop and go out. So to look around and see what network I was on. There are a few ways to approach this, you could look at your IP address, the arp tables, try and ping a known server in each location. The issue with looking at an IP address is that most networks use Private Networks. Very soon you will find that the wifi coffee shop happens to have picked the same range as you use at home and now your laptop is trying to backup to their cash register.

Then I was thinking that I’m approaching this problem from the wrong angle. Why not start with my public IP address range, which has to be unique, and work back from there to my laptop. From there I was planning on maintaining a look-up table of public IP addresses, along the lines of the GeoIP tools developed by MaxMind.

By Accident I found out that geoiplookup supports AS Number

From WikiPedia: Autonomous System (Internet)
http://en.wikipedia.org/wiki/Autonomous_System_%28Internet%29
ISP must have an officially registered autonomous system number (ASN). A unique ASN is allocated to each AS for use in BGP routing. AS numbers are important because the ASN uniquely identifies each network on the Internet.

So what that is saying is that every network in the Inter(connected)Net(work), must have it’s own unique AS Number. From there I was able to write a script to easily manage my laptops behaviour based on both location and connection type

See http://kenfallon.com/scripts-based-on-your-network-location/ for the complete article and scripts.


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2015-01-08T04:47:09Z by Klaatu

Very informative

This is the kind of show I love: hard facts provided as straight-forward information in plain english. Well done, sir!

Leave Comment

Powered by Comment Script