19.1. Building a Network Diagnostic and Repair Laptop

You want to set up an old laptop as a portable network diagnostic station. What should you have on it?

This is a fine and endlessly useful thing to have. It doesn't have to be a super-duper brand-new laptop; any one of reasonably recent vintage that supports USB 2.0 and Linux will do. It should have:

Most laptops don't have a serial port, so you can use a USB-to-serial adapter instead.

Another great thing to have is a PATA/SATA-to-USB 2.0 adapter for rescuing failing hard drives. This lets you plug in either 2.5" or 3.5" PATA or SATA hard drives, and then do a direct copy to save your data. Use the excellent GNU ddrescue utility for this. If your primary hard drive isn't big enough to hold the data, hook up a second one with another PATA/SATA-to-USB 2.0 adapter, or copy it over your network. Why not just copy it over the network in the first place? Because a failing drive is going to take the networking stack down along with everything else.

Install whatever Linux distribution you want, and these applications:

OpenSSH

Secure remote administration.

sshfs

Securely mount remote filesystems.

telnet

Insecurely login to servers; useful for several kinds of tests.

Nmap

Port scanner and network exploration.

tcptraceroute; traceroute

Show routes taken to other hosts.

tcpdump; Wireshark

Packet sniffers.

Netstat

Show listening and connected ports.

netstat-nat

Display NAT connections.

ping

Send ICMP ECHO_REQUEST to network hosts.

fping

Send ICMP ECHO_REQUEST to multiple network hosts.

echoping

Test that a server is listening.

ssmping

Test multicast connectivity.

ngrep

Packet sniffer that does plaintext and regular expression filtering, rather than filtering on hosts, protocols, and TCP flags.

etherwake

Send Wake-on-LAN packets to WOL-compliant computers.

iptraf

Console-based network statistics utility.

httping

Ping-like program for http-requests.

iftop

Display bandwidth usage on an interface.

iperf

Measure TCP and UDP bandwidth performance.

host

Find hostnames or IP addresses.

dig

Query name servers.

arping

Send ARP REQUEST to check for duplicate IP addresses, and to see if a host is up.

GNU ddrescue

Excellent dd-type block copier for rescuing failing hard drives. GNU ddrescue is written by Antonio Diaz; don't confuse it with the older dd-rescue, authored by Kurt Garloff. That is also a good rescue utility, but the newer GNU ddrescue is faster and does a better job.

net-tools package; iproute2 package

See the Introduction to Chapter 6 for additional information on the net-tools and iproute2 packages.

Get these utilities for wireless troubleshooting:

Kismet

802.11b wireless network sniffer.

wireless-tools

Userspace tools for Linux wireless extensions.

madwifi-tools

Userspace tools for the Atheros Wireless driver.

hostapd

Wireless authenticator.

aircrack-ng

Crack and recover WEP/WPA passwords.

airsnort

WLAN sniffer.

wpasupplicant

Key negotiation with your WEP/WPA Authenticator.

Doubtless you will find others that you must have; just fling 'em in there and go to work.

Don't forget to pay extra attention to security. Be sure to keep all of your packages updated, especially security updates, and be finicky with access controls. You can always run a firewall, but this often gets in the way, so your best strategy is to configure it as though you were always going to run it without a firewall. You shouldn't need to run any services anyway, except sshd, so a firewall isn't strictly necessary.