I was trying to test TLS and JES2 NJE, and needed to get JES2 NJE working. I did not have remote system to use, so I used Python NJE, I also used openssl s_server to act as a server – just for the connection.
For more information on setting up JES 2 NJE with TLS see:
- Setting up JES2 input NJE node (server) and AT-TLS
- Setting up a JES2 output NJE TCPIP node using AT-TLS as a client
Setting up NJE on JES2
You can use static (defined in the JES2PARM member) or define them dynamically using commands.
The bits you need
TCP/IP work is done in a net server NETSRV task. You can define more than one of these to allow you to partition the work.
The net server needs a SOCKET definition. This socket definition needs the IP address on the local system, and the port used to connect to the socket code. If you let it default to the local IP address, it may not pick the IP address you want to use.
You need a NODE definition for the remote end.
You need a TCP/IP LINE definition for the connection to the remote system.
You need a SOCKET for the remote connection, giving the IP address of the remote end, the port to be used at the remote end, the LINE definition to be used, and the NODE to be used.
These have to be started before they can be used.
I had firewall problems on my Linux server, where it was not forwarding packets to the remote system. Once I fixed this, the connection was easy.
Static definition
The address of my z/OS is 10.1.1.2. The address of the remote end is 10.1.0.2
In the JES2 parmlib members I added
NODE(2) NAME=LAPTOP
SOCKET(LOC) NODE=1,IPADDR=10.1.1.2,netsrv=1,PORT=175
NETSRV(1) SOCKET=LOC
SOCKET(LAPTOP) NODE=50,IPADDR=10.1.0.2,LINE=2,NETSRV=1,port=22
LINE(2) UNIT=TCP
Dynamic definitions
I used the following operator commands to define the resources, rather than define them statically
$ADDSOCKET(LOC),NODE=1,IPADDR=10.1.1.2,netsrv=1,PORT=175
$Addnetsrv(1),socket=LOC
$addline(2),unit=tcp
$ADDSOCKET(LAPTOP),IPADDR=10.1.0.2,line=2,netsrv=1,node=50
You need to use a statically defined NODE.
Starting them up
I then issued
- $SNetsrv1 This starts an address space with name JES2S001.
- $SLNE2 to start the line
- $Sn,socket=LAPTOP
Other useful commands
- $DNETSRV1
- $DNetsrv1,sessions this gave output like
- $HASP898 NETSRV1 SESSIONS=(LNE2/LAPTOP/S6)
- $DNetsrv1,socket this displays which socket the net server is using.
- $DSOCKET to display all sockets
- $DSOCKET(LAPTOP4)
- $TSOCKET(LOC),SECURE=YES,PORT=2275