The Penguin's Practical Network Troubleshooting Guide, Part 2 - page 3
Tracking Down Network Congestion
There are options to replay or save your capture. This is a great feature that will help you quickly pinpoint Web server problems.
A powerful command-line program with similar features is
curl is one of those amazing tiny programs that can do great feats, if only you can figure out how. This command fetches the HTTP headers only, using the
$ curl -I webserver.com HTTP/1.1 200 OK Date: Wed, 03 May 2006 00:39:20 GMT Server: Apache/2.0.54 (Ubuntu) Content-Type: text/html; charset=UTF-8
curl does a
$ curl --trace trace.txt webserver.com
Open the trace.txt file to see what
curl captured. This is a great way to make sure your SSL is working as it's supposed to:
$ curl --trace trace.txt https://webserver.com
curl has many more uses, such as testing LDAP and FTP servers. If the stars line up correctly, someday a detailed
curl howto might appear here.
netstat command is invaluable for testing and troubleshooting services. This particular incantation gives a detailed picture of which services are running, and which ports they are listening to:
# netstat -plunte
This is especially valuable on a multi-homed system, as it shows which interfaces your services are listening on, and the program names and process IDs. You need this information to test your application-level security, to ensure that no LAN services are exposed to the Internet.
The first step to repairing any sort of network troubles is diagnosing the problem. With these two articles you're well-equipped to diagnose most common network troubles.
- Spy on Yourself with tcpdump
- Spy on the Spyware with tcpdump
- Chapter 20 of the Linux Cookbook goes into detail on using telnet to test mail servers
- RFC 821 - Simple Mail Transfer Protocol
- RFC 2616 - Hypertext Transfer Protocol - HTTP/1.1
This article originally appeared on Enterprise Networking Planet, a JupiterWeb site.