Http://chenm.blogbus.com/logs/52906888.html
The HP-UX provides its own packet capture tool, Nettl. It comes in handy when tcpdump is not available (for example, tcpdump won't be able to catch the package on the loop on the HP-UX. Summarize the main usage of Nettl for future reference.
Start packet capture
:
# Nettl-Tn all-e all-maxtrace 99999-F/tmp/tixiang
# Nettl-Tn loopback-e ns_ls_tcp-maxtrace 99999-F/tmp/tixiang
# Nettl-Tn pduin pduout-e ns_ls_loopback-TM 100000-F/tmp/local
# Nettl-Tn pduin pduout-e ns_ls_loopback-M 56-TM 100000-F/tmp/local
# Nettl-Tn pduin-e ns_ls_loopback-M 56-TM 100000-F/tmp/local
-M size: the size of each package is limited. We are not necessarily interested in all packages. This option is very effective when we are only interested in headers.
The FDB protocol uses a packet header of 16 bytes, plus 20 bytes of the IP header and 20 bytes of the TCP header, that is, we only need a total of 56 bytes to determine the basic information of a package.
-E subsytem: the type of the packet to be captured, which can be obtained using Nettl-status.
Ns_ls_loopback
Ns_ls_ip
Ns_ls_tcp
Ns_ls_udp
Ns_ls_icmp
-TM maxsize: the maximum size of each file. If the maximum size is exceeded, the next packet capture file is used. Unit: kb. Valid value: 100 ~ 99999
The output file of the captured packets is/tmp/tixiang. xxxx. Use LS-L/tmp/tixiang. * to check
Note:
If you specify pduin and pduout for packet capture on ns_ls_loopback, two copies will be taken for each package, because one copy is used for one copy and two copies for one output.
If-Tn all-e all is specified, multiple copies will be caught because one package may belong to different subsystems. For example, a TCP package belongs to both TCP and IP.
You can use Wireshark to open and analyze captured packets. You can also use the netfmt built-in HP-UX for analysis.
View the status and-entity available information:
# Nettl-status
Stop packet capture
:
# Nettl-TF-e all
Package Analysis
We can use netfmt to view captured packages:
Netfmt-N-l-f/tmp/nettl_t * | more
We can filter the packages we are interested in and use-C to pass in the filter file.
Netfmt-N-l-C filter-F/tmp/nettl_t * | more
Filter is used to filter files. The file content is similar to the following:
Filter tcp_sport 1234
Filters tcp_dport 1234
Each row is a filtering condition, and the relationship between rows is or.
Display in row mode (In this mode, the specific data of the package is not displayed)
Netfmt-N-l-1-F/tmp/nettl_t * | more
Add a timestamp before the display of each line
Netfmt-T-N-l-1-F/tmp/nettl_t * | more
Refer:
Http://www.compute-aid.com/nettl.html
Http://docs.hp.com/en/B2355-60105/nettl.1M.html
Http://docs.hp.com/en/B2355-60105/netfmt.1M.html