[Home] IP Address Basics


Explain the basics of networking to a person familiar with a Western-US-style grid system such that he can properly set the ip address of a gumstix overo manually when dhcp is not available.

It's important to understand not just how to set up one gumstix, but other network devices that are laying around might need to be set up too, hence the explanation.

WARNING: This needs major revision before it meets that goal.

An IP Address is like a Street Address

If you've lived in the west you may be familiar with the grid system. There's Center St, Main St, and perhaps State St or University Ave in every city. From Center St and north all streets are called Nth North. Likewise south of center are all Nth South. East and West of main all streets are called Nth East and Nth West.

Likewise, ip addresses tell one computer where it can find another.

Common IP addresses

A Gateway is like State St (in the west anyway)

In the west you can get (almost) anywhere in the city without needing a map. You may need directions to get from one city to the next (or to the interstate), but often you can count on State St to take you there.

The gateway is somewhat like State St, it helps you get to the next network over - such as the large internet.

Common Gateway address

* 10.x.x.1 - large private network
* 192.168.x.1 - small private network
* yyy.yyy.yyy.yyy - public network
* automatic networks have no gateway

A computer which does not connect to the internet does not have a gateway

Netmask is like city limits

Let's say you're 2 miles into your 30 mile trip to get to a certain 2900 N (along State St rather than the interstate - for example's sake). You just passed a 2500 N and all of the sudden you're at 1700 S. What!? Weren't you trying to get to 2900 N?

You've crossed the city limit! But that's okay, right? The 2900 N you're looking for is in a city another 28 miles away.

A netmask is like a city limit. It tells the computer how far it can expect to be able to search before going to the gateway.

Literally, the netmask is the value that gets bitwise ANDed with the ip of the computer to determine the network size.

Common Netmasks

* - small private network
* - large private network, automatic network
* - 16 leased public (internet) addresses in a multi-office complex is almost always a safe value if you're not sure what to put. There are plenty of Online Network Calculators to help with advanced settings.

DNS is like a GPS

For those of you from the east, you might find it difficult to tell Tom that Dick lives on 200 E, 300 N... or was it 300 E, 200 N... (people from the west are all too familiar with that problem) anyway, you'd remember Jefferson Ave and 15 Sidney Lane a lot easier if Dick lived at that address. Harry's GPS would allow you to put in easy-to-remember coordinates and give back exact grid-system coordinates.

www.google.com is like Jefferson Ave. is like 200 E, 300N.

DNS is like GPS that translates web names to addresses.

Lucky for us, the only two DNS we need are both gri-system and easy-to-remember (too bad they aren't the pre-loaded defaults)

Example 1

Let's say that we have a small public network in a multi-office complex. For this senario we'll pretend that we're the cool kids at the googleplex.

In an ad-hoc (transient) configuration that it lost on reboot or when the network cable is unplugged:

# We have a working network card
ping -c 1 >/dev/null

# We're on a network with this gateway
ifconfig eth0 netmask up
ping -c 1 >/dev/null

# Our gateway takes us to the internet
route add default gw
ping -c 1 >/dev/null

# We can resolve human-readable addresses
sh -c 'echo "nameserver" >> /etc/resolv.conf'
sh -c 'echo "nameserver" >> /etc/resolv.conf'
ping -c 1 www.google.com >/dev/null

In a more permanent configuration:


auto eth0 eth0:0 eth0:3
# no DHCP, no static IP. Great OOBE
iface eth0 inet static

# what customers are already familiar with
iface eth0:0 inet static

# an address to use for testing on the internet
iface eth0:3 inet static

Example 2

A computer with the address of and a netmask of knows that it can only find computers within the 192.168.yyy.yyy network. If the netmask were it would only look within 192.168.254.yyy. If the netmask were it would assume that it needed to go to the gateway to reach any computer not between and The network would be literally and the broadcast would be In each subnet you lose 2 addresses.

Your gateway would most likely be - the first available address on the subnet.

Updated at 2010-07-30
blog comments powered by Disqus