Starting Ethereal

You can start Ethereal from the command line under UNIX, but it can also be started from most Window managers as well. In this section we will look at starting it from the command line.

Before looking at the command line parameters Ethereal understands, lets look at Ethereal itself. Figure 1 shows Ethereal as you would usually see it.

Figure 1. Ethereal is comprised of three main windows

Ethereal is comprised of three main windows, or panes.

  1. The top pane is the packet list pane. It displays a summary of each packet captured. By clicking on packets in this pane your control what is displayed in the other two panes.

  2. The middle pane is the tree view pane. It displays the packet selected in the top pane in more detail.

  3. The bottom pane is the data view pane. It displays the data from the packet selected in the top pane, and highlights the field selected in the tree view pane.

In addition to the three main panes, there are four elements of interest on the bottom of the Ethereal main window.

  1. The lower leftmost button labeled "Filter:" can be clicked to bring up the filter construction dialog.

  2. The left middle text box provides an area to enter or edit filter strings. This is also where the current filter in effect it displayed. You can click on the pull down arrow to select past filter string from a list. More information on display filter strings is available in the Section called Filtering packets while viewing

  3. The right middle button labeled "Reset" clears the current filter.

  4. The right text box displays informational messages. These message may indicate whether or not you are capturing, what file you have read into the packet list pane if you are not capturing. If you have selected a protocol field from the tree view pane and it is possible to filter on that field then the filter label for that protocol field will be displayed.

Ethereal supports a large number of command line parameters. To see what they are, simply enter the command ethereal -h and the help information shown in Example 1 should be printed.

Example 1. Help information available from Ethereal

This is GNU ethereal 0.8.19, compiled with GTK+ 1.2.10, with GLib 1.2.10, with libpcap 0.6, with libz 1.1.3, with UCD SNMP 4.2.1
ethereal [ -vh ] [ -klpQS ] [ -B <byte view height> ] [ -c <count> ]
	[ -f <capture filter> ] [ -i <interface> ] [ -m <medium font> ] 
	[ -n ] [ -N <resolving> ]
	[ -o <preference setting> ] … [ -P <packet list height> ]
	[ -r <infile> ] [ -R <read filter> ] [ -s <snaplen> ] 
	[ -t <time stamp format> ] [ -T <tree view height> ] [ -w <savefile> ]
We will examine each of these possible command line options in turn.

The first thing to notice is that issuing the command ethereal by itself will bring up Ethereal. However, you can include as many of the command line parameters as you like. Their meanings are as follows ( in alphabetical order ):

-B <byte view height>

This option sets the initial height of the byte view pane. This pane is the bottom pane in the Ethereal display

-c <count>

This option specifies the number of packets to capture when capturing live data. It would be used in conjunction with the -k option.

-b <bold font>

This option sets the name of the bold font that Ethereal uses for data in the byte view pane when it is highlighted (ie, selected in the protocol pane

-D

This option changes the way Ethereal deals with the original IPv4 TOS field, so that rather than treating it as the Differentiated Services Field, it is treated as a Type of Service field.

-f <capture filter>

This option sets the initial capture filter expression to be used when capturing packets.

-h

The -h option requests Ethereal to print its version and usage instructions and exit.

-i <interface>

The -i option allows you to specify, from the command line, which interface packet capture should occur on if capturing packets.

An example would be: ethereal -i eth0.

To get a listing of all the interfaces you can capture on, use the command ifconfig -a or netstat -i. Unfortunately, some versions of UNIX do not support ifconfig -a, so you will have to use netstat -i in these cases.

-k

The -k option specifies that Ethereal should start capturing packets immediately. This option requires the use of the -i parameter to specify the interface that packet capture will occur from.

-l

This option turns on automatic scrolling if the packet list pane is being updated automatically as packets arrive during a capture ( as specified by the -S flag).

-m <medium font>

This option sets the name of the font used for most text displayed by Ethereal.

-n

This option specifies that Ethereal not perform address to name translation nor to translate TCP and UDP ports into names.

-N <resolving>

Turns on name resolving for particular types of addresses and port numbers; the argument is a string that may contain the letters m to enable MAC address resolution, n to enable network address resolution, and t to enable transport-layer port number resolution. This overrides -n if both -N and -n are present.

-o <preference settings>

Sets a preference value, overriding the default value and any value read from a preference file. The argument to the flag is a string of the form prefname:value, where prefname is the name of the preference (which is the same name that would appear in the preference file), and value is the value to which it should be set. Multiple instances of -o <preference settings> can be given on a single command line.

An example of setting a single preference would be:

ethereal -o mgcp.display_dissect_tree:TRUE

An example of setting multiple preferences would be:

ethereal -o mgcp.display_dissect_tree:TRUE -o mgcp.udp.callagent_port:2627

-p

Don't put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, -p cannot be used to ensure that the only traffic that is captured is traffic sent to or from the machine on which Ethereal is running, broadcast traffic, and multicast traffic to addresses received by that machine.

-P <packet list height>

This option sets the initial height of the packet list pane, ie, the top pane.

-Q

This option forces Ethereal to exit when capturing is complete. It can be used with the -c option. It must be used in conjunction with the -i and -w options.

-r <infile>

This option provides the name of a capture file for Ethereal to read and display. This capture file can be in one of the formats Ethereal understands, including:

  • libpcap

  • Net Mon

  • Snoop

  • NetXray

For a complete list, see the Ethereal man pages (man ethereal).

-R <read filter>

This option specifies a capture filter to be applied when reading packets from a capture file. The syntax of this filter is that of the display filters discussed in the Section called Filtering packets while viewing. Packets not matching the filter are discarded.

-s <snaplen>

This option specifies the snapshot length to use when capturing packets. Ethereal will only capture <snaplen> bytes of data for each packet.

-S

This option specifies that Ethereal will display packets as it captures them. This is done by capturing in one process and displaying them in a separate process.

-t <time stamp format>

This option sets the format of packet timestamps that are displayed in the packet list window. The format can be one of:

  • r, which specifies timestamps are displayed relative to the first packet captured.

  • a, which specifies that actual dates and times be displayed for all packets.

  • d, which specifies that timestamps are relative to the previous packet.

-T <tree view height>

This option sets the initial height of the tree view pane.

-v

The -v option requests Ethereal to print out its version information and exit.

-w <savefile>

This option sets the name of the savefile to be used when saving a capture file.