Provides information for all TCP connections and UDP sockets, including recently closed ones.
Provide the report for a specified TCP/IP address space by using TCp tcpname. See The Netstat command target for more information about the TCp parameter.
The default output option displays the output on the user's terminal. For other options, see The TSO NETSTAT command syntax or Netstat command output.
>>-+-APPLD--appldata------------------------------+------------>< | .----------------. | | V | | +-CLIent------clientname---+-------------------+ +-HOSTName--hostname---------------------------+ | .-----------------------. | | V | | +-IPAddr----+-ipaddr------------+-+------------+ | +-ipaddr/prefixLen--+ | | '-ipaddr/subnetmask-' | | .----------------. | | V | | +-IPPort----ipaddr+portnum-+-------------------+ +-NOTN3270-------------------------------------+ | .-------------. | | V | | +-POrt------portnum---+------------------------+ +-SMCID--+-smcid-+-----------------------------+ | '-*-----' | '-CONNType--+-NOTTLSPolicy-------------------+-' '-TTLSPolicy--+----------------+-' +-CURRent--------+ +-GRoup--groupid-+ '-STALE----------'
Provide the report for a specified TCP/IP address space by using -p tcpname. See The Netstat command target for more information about the -p parameter.
The default output option displays the output to z/OS UNIX shell stdout. For other options, see The z/OS UNIX netstat command syntax or Netstat command output.
.----------------. V | >>-+- -B----ipaddr+portnum-+-----------------+----------------->< | .----------------. | | V | | +- -E------clientname---+-----------------+ +- -G--appldata---------------------------+ +- -H--hostname---------------------------+ | .-----------------------. | | V | | +- -I----+-ipaddr------------+-+----------+ | +-ipaddr/prefixLen--+ | | '-ipaddr/subnetmask-' | | .-------------. | | V | | +- -P------portnum---+--------------------+ +- -T-------------------------------------+ +- -U--+-smcid-+--------------------------+ | '-*-----' | '- -X--+-NOTTLSPolicy-------------------+-' '-TTLSPolicy--+----------------+-' +-CURRent--------+ +-GRoup--groupid-+ '-STALE----------'
Result: At the end of the report, Netstat displays the host name that the resolver used for the resolution and the list of IP addresses returned from the resolver that it used as filters.
Guideline: The port number can be either a local or remote port.
The filter value for CLIent/-E, IPAddr/-I, and APPLD/-G can be a complete string or a partial string using wildcard characters. A wildcard character can be an asterisk (*), which matches a null string or any character or character string, at the same position. A wildcard character can be a question mark (?), which matches any single character at the same position. For example, a string searchee matches with *ar?he*, but the string searhee does not match with *ar?he*. If you want to use the wildcard character on the IPAddr/-I filter, you must specify the value in the ipaddr format. The wildcard character is not accepted for the ipaddr/prefixlen or ipaddr/subnetmask format of IPAddr/-I values.
When you use z/OS UNIX netstat/onetstat command in a z/OS® UNIX shell environment, take care if you use a z/OS UNIX MVS™ special character in a character string. It might cause an unpredictable result. To be safe, if you want to use a z/OS UNIX MVS special character in a character string, surround the character string with single quotation marks. For example, to use an asterisk (*) in the IP address, 10.*.0.0 for the -I filter, issue the command as: netstat -a -I '10.*.0.0'.
NETSTAT ALLCONN
Display information for all TCP connections and UDP sockets, including recently closed
ones in the default TCP/IP stack.
NETSTAT ALLCONN TCP TCPCS6
Display information for all TCP connections and UDP sockets, including recently closed
ones in TCPCS6 stack.
NETSTAT ALLCONN TCP TCPCS8 (IPADDR 9.43.1.1 9.43.2.2
Display information for these TCP connections and UDP sockets, including recently closed
ones in TCPCS8 stack whose local or remote IP addresses match the specified filter IP
address values.
NETSTAT ALLCONN (PORT 2222 6666 88
Display information for those TCP connections and UDP sockets, including recently closed
ones in the default TCP/IP stack whose local or remote ports match the specified filter
port numbers.
netstat -a
netstat -a -p tcpcs6
netstat -a -p tcpcs6 -I 9.43.1.1 9.43.2.2
netstat -a -P 2222 6666 88
The following examples are generated using the TSO NETSTAT command. The z/OS UNIX netstat command displays the data in the same format as the TSO NETSTAT command.
NETSTAT ALLCONN
MVS TCP/IP NETSTAT CS V2R1 TCPIP NAME: TCPCS 17:40:36
User Id Conn Local Socket Foreign Socket State
------- ---- ------------ -------------- -----
FTPD1 0000003B 0.0.0.0..21 0.0.0.0..0 Listen
FTPD1 0000003D 9.37.65.146..21 9.67.115.5..1026 Establsh
FTPD1 0000003F 9.37.65.146..21 9.27.13.21..3711 Establsh
TCPCS 0000000F 0.0.0.0..23 0.0.0.0..0 Listen
TCPCS 0000000C 9.67.115.5..23 9.27.11.182..4886 Establsh
USER1 00000027 9.67.115.67..1027 9.67.115.5..21 ClosWait
USER1 00000029 9.67.115.69..1028 9.67.115.5..20 ClosWait
APPV4 00000015 0.0.0.0..2049 9.42.103.99..1234 UDP
SYSLOGD1 00000010 0.0.0.0..514 *..* UDP
NETSTAT ALLCONN
MVS TCP/IP NETSTAT CS V2R1 TCPIP NAME: TCPCS 17:40:36
User Id Conn State
------- ---- -----
FTPD1 0000004A Listen
Local Socket: ::..21
Foreign Socket: ::..0
FTPD1 00000052 Establsh
Local Socket: ::ffff:9.67.115.5..21
Foreign Socket: ::ffff:9.67.115.65..1026
FTPD1 00000058 Establsh
Local Socket: 2001:0db8::9:67:115:66..21
Foreign Socket: 2001:0db8::9:67:115:65..1027
TCPCS 0000001A Listen
Local Socket: 0.0.0.0..23
Foreign Socket: 0.0.0.0..0
TCPCS 0000001E Establsh
Local Socket: 9.67.115.5..23
Foreign Socket: 9.27.11.182..4665
USER3 0000005F Establsh
Local Socket: 2001:0db8::9:67:115:5..1079
Foreign Socket: 2001:0db8::9:67:115:65..21
USER6 000000C7 Establsh
Local Socket: 9.67.115.5..1027
Foreign Socket: 9.37.65.146..21
USER8 000000B7 ClosWait
Local Socket: 9.67.115.5..1027
Foreign Socket: 9.37.65.146..21
USER8 000000B8 FinWait2
Local Socket: 2001:0db8::9:67:115:5..21
Foreign Socket: 2001:0db8::9:67:115:65..1083
APPM 00000017 UDP
Local Socket: ::ffff.0.0.0.0..2051
Foreign Socket: ::ffff.9.42.103.99..1236
APPV4 00000015 UDP
Local Socket: 0.0.0.0..2049
Foreign Socket: 9.42.103.99..1234
SYSLOGD1 0000002C UDP
Local Socket: 0.0.0.0..529
Foreign Socket: *..*