Configuring TSO and z/OS UNIX Remote Execution servers to use the same port

Because the remote execution servers are generic servers, they attempt to bind to INADDR_ANY when they are started. This allows them to listen on all defined IP addresses. However, this prevents both the TSO and z/OS® UNIX Remote Execution servers from listening on the same port, and one of the servers would have to use a nonstandard port. Using the BIND parameter on the PORT reservation statement in the TCPIP profile data set allows both the TSO and z/OS UNIX Remote Execution servers to bind to the same ports using different IP addresses. The following steps illustrate how this can be done. For more information on the PORT reservation statement, see z/OS Communications Server: IP Configuration Reference.

  1. Define a VIPA address to the TCPIP profile data set. This example shows a static VIPA address, but either a static or dynamic VIPA can be used.
    DEVICE VIPAD1 VIRTUAL 0       
    LINK   VIPA1  VIRTUAL 0 VIPAD1 
    
    HOME                 
    134.134.134.36       VIPA1   
  2. Add PORT statements to the TCP/IP profile for both the TSO and z/OS UNIX Remote Execution servers. One of the servers will bind to the VIPA address. The other can bind to INADDR_ANY by not specifying the BIND parameter. In this example, the z/OS UNIX Remote Execution servers will bind to the VIPA address. Also update the /etc/services file so that exec uses 512 and shell uses 514.
    512 TCP OMVS BIND 134.134.134.36 ; z/OS Unix REXECD
    514 TCP OMVS BIND 134.134.134.36 ; z/OS Unix RSHD  
    512 TCP RXSERVE                  ; TSO REXECD 
    514 TCP RXSERVE                  ; TSO RSHD
    It is important that the server with the BIND parameter is listed before the one without the BIND parameter. This setup directs all requests to ports 512 or 514 with a destination IP address of 134.134.134.36 to the z/OS UNIX Remote Execution servers. Requests to ports 512 or 514 with a local destination IP address that is not 134.134.134.36 are directed to the TSO Remote Execution server.

To verify this setup:

  1. Start the stack with the TCP/IP profile changes described above and start RXSERVE and INETD.
    Note: INETD listens for the REXEC and RSH servers under z/OS UNIX.
  2. Issue NETSTAT and it should show that both the REXEC servers are listening on port 512 and both RSH servers are listening on port 514. INETD, which listens for the z/OS UNIX Remote Execution servers, listens only on the VIPA address.
    MVS TCP/IP NETSTAT CS V1R2       TCPIP NAME: TCPCS            21:34:41
    User Id  Conn     Local Socket           Foreign Socket         State 
    -------  ----     ------------           --------------         ----- 
    INETDCS1 0000000D 134.134.134.36..514    0.0.0.0..0             Listen
    INETDCS1 0000000E 134.134.134.36..512    0.0.0.0..0             Listen
    RXSERVE  00000019 0.0.0.0..514           0.0.0.0..0             Listen
    RXSERVE  00000018 0.0.0.0..512           0.0.0.0..0             Listen