Have you ever wanted to be able to restrict the ephemeral port ranges configured on IBM i, clear the local DNS cache, or view the entries stored in the local DNS cache?
IPCONFIG is a tool that allows you to view or modify IP configuration settings that aren’t accessible through standard TCP/IP menus. This may be the first time you’ve heard of IPCONFIG because the existing settings are a mix of features that should never be changed, but a toggle was added “just in case.” Now we’ve added some actual useful and interesting features into the mix. These new features provide the capability to work with ephemeral port ranges as well as the local DNS cache.
Ephemeral Port Options
The default ephemeral port range on the IBM i is 5000 through 65535 for both TCP and UDP. This broad range may allow applications using ephemeral ports to bind to a port used by a server application causing the application to fail on startup because the server’s port is already in use. IPCONFIG’s new ephemeral port options provide a solution to this problem. The ephemeral port range for both TCP and UDP can now be uniquely configured.
These options set the lowest and highest valid ephemeral port to be used by TCP or UDP. The value must be in the range of 5000 to 65535. The ephemeral port ranges can be modified at anytime; however, the newly configured values will not apply until after TCP has been restarted.
TCP Ephemeral Port Range Options
UDP Ephemeral Port Range Options
Displaying Ephemeral Port Ranges
The -display option displays the current configuration values for all the IPCONFIG options. The TCP and UDP ephemeral port ranges can be viewed using this option. Shown in the green screen below, the configured (and active) TCP ephemeral port range is 20000 through 65535. The UDP ephemeral port range is configured to 25000 through 55000; however, this value will not apply until TCP/IP has been restarted. The active UDP ephemeral port range that applies until TCP/IP is restarted is 20000 through 65535.
DNS Cache Option
IPCONFIG provides a new DNS option with two sub options: display and reset. These functions allow you to work with the DNS cache.
-dnsCache:display <-t, -d>
This sub option displays a list of the DNS cache entries. The optional parameters -t and -d offer further display choices. By default, the cache entries are output in a list format. Using the -t parameter, the cache entries can be printed in a table format that’s simple to search and use to compare particular cache entries. In addition to displaying the cache entries, the –d parameter will create an informational local sockets LIC log (major code 2C00; minor code 9900) containing the command output. The LIC log can be used with both list and table formats. A LIC log can be dumped to a spooled file for further analysis.
Each cache entry contains the query sent to the DNS server and the response received. The entry will also include the original time to live and the remaining time to live in the cache as indicated by the DNS server.
List format is shown below.
Table format is shown below.
The reset sub option will clear all of the entries stored in the DNS cache.
The following PTFs provide the support for these IPCONFIG enhancements:
7.1 – MF52889
6.1.1 – MF52891
6.1 – MF52869
Support for IPCONFIG is in the base operating system in all subsequent releases.
You use the System Service Tools (STRSST) Display/Alter/Dump function to invoke the IPCONFIG Advanced Analysis feature. You must be authorized to use System Service Tools and you also must be authorized to use the Display/Alter/Dump service function.
To change the settings with the STRSST command, use the following steps:
- Open a character-based interface.
- On the command line, type STRSST.
- Type your service tools user name and password.
- Select option 1 (Start a service tool).
- Select option 4 (Display/Alter/Dump).
- Select option 1 (Display/Alter storage).
- Select option 2 (Licensed Internal Code (LIC) data).
- Select option 14 (Advanced Analysis).
- Select option 1 (IPCONFIG).
I’d like to thank Ashley Good, Lindsay Reiser, and Tim Mullenbach for writing this blog article. Ashley, Lindsay, and Tim all work on the TCP/IP Networking team in the IBM i development lab.
This blog post was originally published on IBMSystemsMag.com and is reproduced here by permission of IBM Systems Media.