[ Team LiB ] |
Recipe 9.17 Observing Network Traffic (GUI)9.17.1 ProblemYou want to watch network traffic via a graphical interface. 9.17.2 Solution9.17.3 DiscussionProlonged perusing of tcpdump output [Recipe 9.16] can lead to eyestrain. Fortunately, alternatives are available, and Ethereal is one of the best. Ethereal is a GUI network sniffer that supports a number of enhancements beyond the capabilities of tcpdump. When Ethereal starts, it presents three windows:
Ethereal uses the same syntax as tcpdump for capture filter expressions. However, it uses a different, more powerful syntax for display filter expressions. Our previous tcpdump example, to select packets related to FTP transfers to or from a server: [Recipe 9.16] tcp port ftp or ftp-data and host server.example.com would be rewritten using Ethereal's display filter syntax as: ftp or ftp-data and ip.addr == server.example.com The display filter syntax is described in detail in the ethereal(1) manpage.
Ethereal provides a GUI to construct and update display filter expressions, and can use those expressions to find packets in a trace, or to colorize the display. Ethereal also provides a tool to follow a TCP stream, reassembling (and reordering) packets to construct an ASCII or hexadecimal dump of an entire TCP session. You can use this to view many protocols that are transmitted as clear text. Menus are provided as alternatives for command-line options (which are very similar to those of tcpdump). Ethereal does its own packet capture (using libpcap), or reads and writes network trace files in a variety of formats. On Red Hat systems, the program is installed with a wrapper that asks for the root password (required for packet sniffing), and allows running as an ordinary user (if only display features are used). The easiest way to start using Ethereal is:
Ethereal is amazingly flexible, and this is just a small sample of its functionality. To learn more, browse the menus and see the Ethereal User's Guide for detailed explanations and screen shots. tethereal is a text version of Ethereal, and is similar in function to tcpdump, except it uses Ethereal's enhanced display filter syntax. The -V option prints the protocol tree for each packet, instead of a one-line summary. Use the tethereal -b option to run in "ring buffer" mode (Ethereal also supports this option, but the mode is designed for long-term operation, when the GUI is not as useful). In this mode, tethereal maintains a specified number of network trace files, switching to the next file when a maximum size (determined by the -a option) is reached, and discarding the oldest files, similar to logrotate. [Recipe 9.30] For example, to keep a ring buffer with 10 files of 16 megabytes each: # tethereal -w ring-buffer -b 10 -a filesize:16384 9.17.4 See Alsoethereal(1), tethereal(1). The Ethereal home page is http://www.ethereal.com. |
[ Team LiB ] |