HP-UX HB v13.00 Ch-09 - Networking Basics
HP-UX Handbook – Rev 13.00 Page 24 (of 27)
Chapter 09 Network Basics
October 29, 2013
to the value of the “–tm” option.
You can use the –n option to specify the number of output files. The default is 2.
# nettl –tn pduin pduout –e ns_ls_ip –n 8 –tm 99999 –f /tmp/my-trc
We have to format it to get a readable trace output or to view the binary output with some viewer
tools like ethereal (see below). We can format the binary output files from nettl (both – trace and
log files) with the netfmt command. The simplest way to do this is the following command line:
# netfmt –nNl –f /tmp/my-trc.TRC00 > /tmp/my-trc.TRC00.txt
If we have to check for specific traffic, it helps to use some filters. A filter is a text file
containing filter conditions. That is to see all traffic from or to a specific interface we can use the
condiction “ip_saddr” (= IP source address) and “ip_daddr” (= IP destination address).
We create a text file called “filter” with the following two lines:
filter ip_saddr 10.10.10.111
filter ip_daddr 10.10.10.111
and start the netfmt command with this filter as an additional option:
# netfmt –c filter –nNl –f /tmp/my-trc.TRC00 > /tmp/my-trc.TRC00a.txt
The output of this command contains only those network packages which have the named IP
addresses as source or destination.
For available filter options, please refer to the man page of the netfmt command.
Some options which we can use for nettl:
Option
Explanation
-tn
== “trace on” ; it starts tracing
-tf
== “trace off”, it stops tracing
-e <entity>
It defines from which part of network stack the information is taken.
“–e ns_ls_ip” takes it from IP-layer which is enough for most issues. If
you use “–e all” you will see your packages in each part of the
network stack. To find the available entities to trace use the option –ss,
i.e. # nettl -ss
-c <interface>
nettl by default takes all packages of all interfaces. This option allows
you to restrict it to one specific interface.
-m <# byte>
Normally nettl catches all bytes of the network packets but often it is
enough to see just header information. This option allows you to
specify the number of bytes to be captured in the trace packet. The
maximum value for bytes is 2000.
-tm <maxsize>
It defines the maximal size of output of trace. The default value for
combined file sizes (maxsize) is 1000 KB. The possible range for
maxsize is 100 to 99999.
There are a lot of additional options for nettl and netfmt, please read the man pages to get the