Netstat PORTList/-o report

Displays the list of reserved ports and the port access control configuration for unreserved ports. To configure port access control for unreserved ports, replace the port number value with the keyword UNRSV. For more information about port access control see the port access control information in z/OS Communications Server: IP Configuration Guide. For ports that are reserved by the PORTRANGE profile statement, only one output line is displayed for each range. For ephemeral port specifications, see the Netstat CONFIG/-f report description.

TSO syntax

Read syntax diagramSkip visual syntax diagram
>>---NETSTAT PORTList--| Target |--| Output |--| (Filter |-----><

Target

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.

Output

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.

Filter

Read syntax diagramSkip visual syntax diagram
         .---------.   
         V         |   
>>-POrt----portnum-+-------------------------------------------><

z/OS UNIX syntax

Read syntax diagramSkip visual syntax diagram
>>---netstat -o--| Target |--| Output |--| Filter |------------><

Target

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.

Output

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.

Filter

Read syntax diagramSkip visual syntax diagram
        .---------.   
        V         |   
>>- -P----portnum-+--------------------------------------------><

Filter description

POrt/-P portnum
Filter the output of the PORTList/-O report using the specified port number portnum or the keyword UNRSV. You can enter up to six filter values. The port number range is 1-65535.
Restriction: For a UDP endpoint socket, the filter value only applies to the local or source port.

Command syntax examples

From TSO environment

NETSTAT PORTLIST
Display the port reservation list in the default TCP/IP stack. 
NETSTAT PORTLIST TCP TCPCS6
Display the port reservation list in the TCPCS6 stack.

From UNIX shell environment

   netstat -o
   netstat -o -p tcpcs6 

Report examples

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.

Not IPv6 enabled (SHORT format)

NETSTAT PORTLIST
MVS TCP/IP NETSTAT CS V2R1       TCPIP Name: TCPCS           15:24:23 
Port# Prot User     Flags    Range       IP Address      SAF Name      
----- ---- ----     -----    -----       ----------      --------      
UNRSV TCP  A*       L                                                  
UNRSV TCP  *        FL                                   GENERIC       
00020 TCP  FTPD1    D                                                  
00021 TCP  FTPD1    DA                                                 
00023 TCP  TCPCS    DA                                                 
00025 TCP  SMTP     DA                                                 
04000 TCP  OMVS     DABU                 9.67.113.10                   
04001 TCP  OMVS     DABFU                9.67.113.12     BS4TOMVS      
04004 TCP  *        DAF                                  S4TALL        
04005 TCP  *        DABU                 9.67.113.11                   
04017 TCP  *        DABFU                9.67.113.17     BS4TALL       
04020 TCP  DCICSTS  DAN                 
05000 TCP  *        DARN     05000-05001
UNRSV UDP  *        XI                                                 
00161 UDP  OSNMPD   DA                                                 
00162 UDP  OMVS     DA                                                 
00514 UDP  SYSLOGD1 DA                                                 
04020 UDP  OMVS     DABF                 9.67.43.70      BS4UOMVS                    
04030 UDP  *        DAF                                  S4UALL  
05000 UDP  MUD      DAR      05000-05002                               

IPv6 enabled or request for LONG format

NETSTAT PORTLIST
MVS TCP/IP NETSTAT CS V2R1       TCPIP Name: TCPCS           15:24:23 
Port# Prot User     Flags    Range       SAF Name                      
----- ---- ----     -----    -----       --------                      
UNRSV TCP  *        FL                   GENERIC                       
00020 TCP  FTPD1    D                                                  
00021 TCP  FTPD1    DA                                                 
00023 TCP  TCPCS    DA                                                 
00025 TCP  SMTP     DA                                                 
04000 TCP  OMVS     DABU                                               
      BindSpecific: 9.67.113.10                                        
04001 TCP  OMVS     DABFU                BS4TOMVS                      
      BINDSPECIFIC: 9.67.113.12                                        
04002 TCP  OMVS     DABU                                               
      BindSpecific: ::6:2900:1dc:21bc                                  
04020 TCP  DCICSTS  DAN                 
05000 TCP  *        DARN     05000-05001
UNRSV UDP  *        FI                   GENERIC                       
00514 UDP  SYSLOGD1 DA                                                 
04020 UDP  OMVS     DAB                                                
      BindSpecific: 9.67.43.70                                         
04022 UDP  *        DAB                                                
      BindSpecific: 1::8                                               
04030 UDP  *        DA                                                 
05000 UDP  MUD      DAR      05000-05002                               

Report field descriptions

Display the following port reservation information defined in the PORT or PORTRANGE profile statements. For more information about each field, see the PORT or PORTRANGE profile statements in the z/OS Communications Server: IP Configuration Reference.

Port#
nnnn
For ports reserved by the PORT profile statement, this value is the number of the port that was reserved. For ports that are reserved by the PORTRANGE profile statement, this value is the number of the first port in the range. Valid values are in the range 1 – 65535.
UNRSV
Indicates any unreserved port; that is, any port number in the range 1-65535 that has not been reserved by a PORT or PORTRANGE statement. For applications that explicitly bind to an unreserved port and match the protocol and jobname value on this PORT statement, permission to access the unreserved port is controlled according to the value of the flags for that entry. However, when the RESTRICTLOWPORTS parameter is configured on the TCPCONFIG or UDPCONFIG profile statement, access only to unreserved ports with port numbers greater than 1023 is controlled by the PORT UNRSV statements.
Prot
The protocol that was specified in the PORT profile statement. The valid protocol values are TCP and UDP.
User
The MVS™ job name that can use the port. See Client name or User ID descriptions in Netstat report general concept for detailed descriptions.
Flags
The flags represent parameter values defined on the PORT or PORTRANGE profile statement.
A
Autolog
B
Bind
D
DelayAcks
F
SAF
I
WhenBind
L
WhenListen
N
Port is disabled for SMC-R. For more information about SMC-R support, see Shared Memory Communications over Remote Direct Memory Access in the z/OS Communications Server: IP Configuration Guide.
R
Port is reserved by range.
S
Share port
U
Reuse port. This flag is set for TCP sockets when the BIND keyword is specified (both B and U are set).
W
Shareport with WLM server-specific weights is being used.
X
Deny
Range
This field is significant only for port entry reserved by the PORTRANGE profile statement (flag R in the Flags field).
IP address or BindSpecific
This field is significant only for port entries with the BIND parameter specified on the PORT profile statement.
SAF Name
The final qualifier of a security product resource name.