Page 236 - Hacking Roomba
P. 236
Chapter 11 — Connecting Roomba to the Internet 217
Debugging Network Devices Continued
www.wiley.com has address 208.215.179.146
% host www.wiley.cmo
Host www.wiley.cmo not found: 3(NXDOMAIN)
If you want to test a particular DNS server, append its IP address to your command. For
example, if your router is at 192.168.1.1 and it runs a DNS server, typing the following will
cause host to explicitly query that nameserver:
% host www.wiley.com 192.168.1.1
Debugging IP Addresses
You may not be using a DNS server on your home network, but you most certainly are
using IP addresses. Every device must have an IP address to be a network citizen. Your
home network is likely a private network with an address starting with 192.168 and your
router translates requests between your private network and the Internet. This has the
effect of giving your household one public address, but inside your house you can have as
many networked gizmos as you like.
The first tool to turn to is ping. Sort of like a submarine’s sonar, ping makes a special noise
(an echo request packet) and listens for the echo. Network devices aren’t required to
respond to pings, but most do. If your router is at 192.168.1.1, then pinging it looks like:
% ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=2.125 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.012 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.787 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.787/1.952/2.125/0.128 ms
Usually you either ping something you know about and want to see if it’s still there (like the
preceding example), or you want to see what is on your Internet. In the latter case, the
nmap tool is a great resource. You could ping each address from 192.168.1.1 to
192.168.1.254, but that would take too long. Some operating systems and routers support
a broadcast ping to the special broadcast address of 192.168.1.255, but it’s not consistent.
nmap solves the problem by pinging each IP address in turn for you and then summarizing
the results. On a sample network (192.168.0.x), the network scan looks like the following;
the notation 192.168.0/24 is how you specify the 192.168.0.x network, whereas -sP tells
nmap to perform a ping scan:
% sudo nmap -sP 192.168.0/24
Starting Nmap 4.03 ( http://www.insecure.org/nmap/ ) at i
2006-06-28 11:42 PDT
Continued