IBM i has a built-in function for capturing packets. The following command syntax is a good place to start, and can help with diagnosing network performance issues. This is most useful when you capture packets at two or more points in the network (at a minimum, on the remote host and the LPAR) so that you can verify if packets are making it across the network.
To start a packet capture, copy the syntax below and update the TRCTBL (trace table) name to something meaningful that you will be able to identify at a later time. We recommend using hostnameYYYYMMDDsequence so that it's easy to identify where the PCAP came from and when. The trace table name is restricted to letters and numbers. We recommend against filtering traffic by IP address, as this will cause ICMP messages not originating from the filter list to be dropped by the capture, which can mask issues occurring on the network.
TRCCNN SET(*ON) TRCTYPE(*IP) TRCTBL(hostnameYYYYMMDDsequence) SIZE(200000)
TRCCNN SET(*OFF) TRCTBL(hostnameYYYYMMDDsequence) OUTPUT(*STMF) TOSTMF('hostnameYYYYMMDDsequence.pcap')