Displays information for open TCP and/or UDP sockets associated with a client name.
Restriction: This command displays socket information only for sockets that are bound to a port or an IP address. TCP connections that have been shutdown or aborted are not displayed.
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.
.----------------. V | >>-+-CLIent------clientname---+--------+----------------------->< +-HOSTName--hostname----------------+ | .-----------------------. | | V | | +-IPAddr----+-ipaddr------------+-+-+ | +-ipaddr/prefixLen--+ | | '-ipaddr/subnetmask-' | | .----------------. | | V | | +-IPPort----ipaddr+portnum-+--------+ +-NOTN3270--------------------------+ | .-------------. | | V | | '-POrt------portnum---+-------------'
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---+--------+ +- -H--hostname------------------+ | .-----------------------. | | V | | +- -I----+-ipaddr------------+-+-+ | +-ipaddr/prefixLen--+ | | '-ipaddr/subnetmask-' | | .-------------. | | V | | +- -P------portnum---+-----------+ '- -T----------------------------'
Result: At the end of the report, Netstat will display 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 a port to which the socket is bound or connected.
The filter value for CLIent/-E and IPAddr/-I 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 -s -I '10.*.0.0' or netstat -s -I "10.*.0.0".
NETSTAT SOCKETS
Display information about each client using the socket interface in the default
TCP/IP stack.
NETSTAT SOCKETS TCP TCPCS6
Display information about each client using the socket interface in TCPCS6 stack.
NETSTAT SOCKETS TCP TCPCS8 (IPADDR 9.43.1.1 9.43.2.2
Display information for these clients using the socket interface in TCPCS8 stack
whose IP addresses to which the socket is bound or connected match the specified
filter IP address values.
NETSTAT SOCKETS (PORT 2222 6666 88
Display information for those active TCP connections and UDP sockets in the
default TCP/IP stack whose port numbers to which the socket is bound or connected
match the specified filter port numbers.
netstat -s
netstat -s -p tcpcs6
netstat -s -p tcpcs6 -I 9.43.1.1 9.43.2.2
netstat -s -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 SOCKETS
MVS TCP/IP NETSTAT CS V2R1 TCPIP NAME: TCPCS 17:40:36
Sockets interface status:
Type Bound to Connected to State Conn
==== ======== ============ ===== ====
Name: FTPD1 Subtask: 007E6408
Stream 0.0.0.0..21 0.0.0.0..0 Listen 0000003B
Stream 9.37.65.146..21 9.67.115.5..1026 Establsh 0000003D
Stream 9.37.65.146..21 9.27.13.21..3711 Establsh 0000003F
Name: SYSLOGD1 Subtask: 007E6408
Dgram 0.0.0.0..514 *..* UDP 00000010
Name: TAPPV4 Subtask: 007E6460
Dgram 0.0.0.0..2049 9.42.103.99..1234 UDP 00000015
Name: TCPCS Subtask: 007E2A40
Stream 0.0.0.0..23 0.0.0.0..0 Listen 0000000F
Name: TCPCS Subtask: 007E08D0
Stream 9.67.115.5..23 9.27.11.182..4886 Establsh 0000000C
NETSTAT SOCKETS
MVS TCP/IP NETSTAT CS V2R1 TCPIP NAME: TCPCS 17:40:36
Sockets interface status:
Name: FTPD1 Subtask: 007E6330
Type: Stream Status: Listen Conn: 0000004A
BoundTo: ::..21
ConnTo: ::..0
Type: Stream Status: Establsh Conn: 00000052
BoundTo: ::ffff:9.67.115.5..21
ConnTo: ::ffff:9.67.115.65..1026
Type: Stream Status: Establsh Conn: 00000058
BoundTo: 2001:0db8::9:67:115:66..21
ConnTo: 2001:0db8::9:67:115:65..1027
Name: SYSLOGD1 Subtask: 007E6438
Type: Dgram Status: UDP Conn: 0000002C
BoundTo: 0.0.0.0..529
ConnTo: *..*
Name: TAPPV4 Subtask: 007E6460
Type: Dgram Status: UDP Conn: 00000015
BoundTo: 0.0.0.0..2049
ConnTo: 9.42.103.99..1234
Name: TAPPV6 Subtask: 007E6480
Type: Dgram Status: UDP Conn: 00000016
BoundTo: ::..2050
ConnTo: 12ab::1..1235
Name: TCPCS Subtask: 007E1930
Type: Stream Status: Listen Conn: 0000001A
BoundTo: 0.0.0.0..23
ConnTo: 0.0.0.0..0
Type: Stream Status: Establsh Conn: 0000001E
BoundTo: 9.67.115.5..23
ConnTo: 9.27.11.182..4665
Name: USER3 Subtask: 007B93D0
Type: Stream Status: Establsh Conn: 0000005F
BoundTo: 2001:0db8::9:67:115:5..1079
ConnTo: 2001:0db8::9:67:115:65..21
Name: USER6 Subtask: 007B93F0
Type: Stream Status: Establsh Conn: 000000C7
BoundTo: 9.67.115.5..1027
ConnTo: 9.37.65.146..21