Displays the information about each active TCP connection and UDP socket. COnn/-c is the default parameter.
Provide the report for a specific 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 specific TCP/IP address space by using -p tcpname. See The Netstat command target for more information about the TCp 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 which it used as filters.
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 (') or double (") quotation marks. For example, to use an asterisk (*) in the IP address, 10.*.0.0 for the -I filter, issue the command as: netstat -c -I '10.*.0.0' or netstat -c -I "10.*.0.0".
NETSTAT CONN
Display information for all active TCP connections and UDP sockets in the default TCP/IP
stack.
NETSTAT CONN TCP TCPCS6
Display information for all active TCP connections and UDP sockets in TCPCS6 stack.
NETSTAT CONN TCP TCPCS8 (IPADDR 9.43.1.1 9.43.2.2
Display information for these active TCP connections and UDP sockets in TCPCS8 stack
whose local or remote IP addresses match the specified filter IP address values.
NETSTAT CONN (PORT 2222 6666 88
Display information for those active TCP connections and UDP sockets in the default
TCP/IP stack whose local or remote ports match the specified filter port numbers.
netstat -c
netstat -c -p tcpcs6
netstat -c -p tcpcs6 -I 9.43.1.1 9.43.2.2
netstat -c -P 2222 6666 88
The following examples are generated by using TSO NETSTAT command. Using the z/OS UNIX netstat command displays the data in the same format as the TSO NETSTAT command.
NETSTAT CONN
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
APPV4 00000015 0.0.0.0..2049 9.42.103.99..1234 UDP
SYSLOGD1 00000010 0.0.0.0..514 *..* UDP
NETSTAT CONN
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
APPM 00000017 UDP
Local Socket: ::ffff.0.0.0.0..2051
Foreign Socket: ::ffff.9.42.103.99..1234
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: *..*