
Network Diagnostic Tools
101
15.3.7. Using an HTTP client
To perform a packet dump using an HTTP client, you first construct an appropriate URL that contains standard
HTTP URL form-style parameters from the list shown in Table 15.1. Then you retreive the dump from the
FB2700 using a tool such as
curl
.
The URL is
http://<FB2700
IP
address
or
DNS
name>/pcap?
parameter_name=value[¶meter_name=value ...]
The URL may include as many parameter name and value pairs as you need to completely specify the dump
parameters.
Packet capturing stops if the output stream (HTTP transfer) fails. This is useful if you are unable to determine
a suitable timeout period, and would like to run an ongoing capture which you stop manually. This is achieved
by specifying a very long duration, and then interrupting execution of the HTTP client using Ctrl+C or similar.
Only one capture can operate at a time. The HTTP access fails if no valid interfaces or sessions etc. are specified
or if a capturing is currently running.
15.3.7.1. Example using curl and tcpdump
An example of a simple real-time dump and analysis run on a Linux box is shown below :-
curl --silent --no-buffer --user name:pass
'http://1.2.3.4/pcap?interface=LAN&timeout=300&snaplen=1500'
| /usr/sbin/tcpdump -r - -n -v
Note
Linebreaks are shown in the example for clarity only - they must not be entered on the command-line
In this example we have used username name and password pass to log-in to a FireBrick on address 1.2.3.4
- obviously you would change the IP address (or host name) and credentials to something suitable for your
FB2700.
We have asked for a dump of the interface named
LAN
, with a 5 minute timeout and capturing 1500 byte
packets. We have then fed the output in real time (hence specifying
--no-buffer
on the
curl
command)
to
tcpdump
, and asked it to take capture data from the standard input stream (via the
-r -
options). We have
additionally asked for no DNS resolution (
-n
) and verbose output (
-v
).
Consult the documentation provided with the client (e.g. Linux box) system for details on the extensive range
of
tcpdump
options - these can be used to filter the dump to better locate the packets you are interested in.