Skip to main content

Route Work by IP Address with QSYS2.SET_SERVER_SBS_ROUTING() Service

In this iCan blog post, IBM i expert Dawn May explains how to route work by client IP address without Navigator for i. 

iCan blog in white text on purple

In the post Subsystem Configuration for Prestart Jobs, I reviewed how you could route work by client IP addressfor prestart server jobs. Until recently, the only way to implement this configuration required Navigator for i. 
 
IBM has enhanced the QSYS2.SET_SERVER_SBS_ROUTING()procedure to route work to a specified subsystem by IP address; this can be a specific IP address or a range of IP addresses. This is the same service used to route work by user profile. There’s also a new service to review the configuration by IP address, QSYS2.SERVER_SBS_CONFIGURATION.
 
Using the SQL procedure to route work by IP address gives you a programmatic way to do the same configuration previously done with Navigator. If you defined your configuration to route by IP address using this service, you will see that configuration displayed in the Navigator GUI. Likewise, if you had done the configuration in the GUI, you can review the configuration with the QSYS2.SERVER_SBS_CONFIGURATION service.  
 
The following SQL statement results in routing all requests from IP address 24.34.131.129 for the Remote Command Server (QZRCSRVS) to the DAWNMAY subsystem. If subsystem DAWNMAY isn’t active, the request is rejected and the user cannot connect to the server.  
 
Thought should be given to the ALLOW_ROLLOVER setting. If you’re configuring subsystems to better manage server jobs on your system, why would you allow the users to connect if their configured subsystem wasn’t active? In addition, if the configured subsystem was not active, ALLOW_ROLLOVER => ‘YES’ results in the connection running in a batch immediate job (BCI), so you lose the advantages of prestart jobs as well. 
 

CALLQSYS2.SET_SERVER_SBS_ROUTING(AUTHORIZATION_NAME =>'*ALL',

                        SERVER_NAME =>'QZRCSRVS',

                        IP_ADDRESS_START =>'24.34.131.129'

                        SUBSYSTEM_NAME =>'DAWNMAY')

                        ALLOW_ROLLOVER =>'NO');

Using the Navigator for i Network → Servers interface to review the properties for the Remote Command Server, the subsystem configuration will be displayed:

I have configured several servers to route work by a specific IP address; the following SELECT statement shows me the configuration:

SELECTFROMQSYS2.SERVER_SBS_CONFIGURATION

WHEREIP_ADDRESS_START NOT LIKE'';

Note that if your configuration routes traffic by both client IP address and user profile, routing by IP address takes precedence. 

Note that the procedure does not work for the secure servers, such as QZDASSINIT.

IBM Systems Webinar Icon

View upcoming and on-demand (IBM Z, IBM i, AIX, Power Systems) webinars.
Register now →