New Perspectives On Web Design

(C. Jardin) #1
By Paul Tero CHAPTER 8

using a process called network address translation, making sure requests and
information go out and come back to the right local IP address.
You can find out your broadband router’s public IP address by visiting
a website like whatismyipaddress.com. Alternatively, you can run the
command curl ipinfo.io/ip on Mac or Linux, or wget -O- -q ipinfo.io/
ip on Linux. Both curl and wget retrieve a Web page (http://ipinfo.io/ip)
from the Internet. The -O- option (that’s a letter O, not zero) tells wget to
output the result to the screen (signified by a single hyphen) rather than
save it to a file, and -q tells it to do it quietly. curl automatically outputs to
the screen. To use curl on Windows you have to download and install it
first. All these methods go outside your local network and look back. There
is no way to find out your router’s public IP address from the inside. The
output is quite simple:


$ curl ipinfo.io/ip
85.106.118.199


wheRe aRe TheY?


Websites like whatismyipaddress.com and ipinfo.io do more than just
tell you your public IP address. They also provide geolocation services.
It is interesting to take the IP addresses from the traceroute mentioned
earlier on page 187 and copy and paste them in. Geolocation guesses at
the physical location of the router, and can also tell you who owns the IP
address. The address 62.253.185.81 is in southern England but the next one
crosses the Channel to 80.81.193.117 in Frankfurt, Germany. This type of
geolocation relies on databases of IP address ownership.
In fact, there are websites which can map this all out for you, such as
DNStools.ch^13 and YouGetSignal^14. The starting points for these traceroutes
will be the Web server hosting the tool, rather than your own computer.


13 http://smashed.by/visual-traceroute
14 http://smashed.by/visual-tracert

Free download pdf