Changing TCP/IP Application Port Numbers on IBM i

时间:2016-06-16 ┊ 阅读:3,955 次 ┊ 标签: 分享 , 系统 , 配置

Last week I was faced with a situation in which I needed one of my training customers to be able to access my IBM i for Telnet access for an upcoming hands-on System i technical training class. If they couldn't access the system, there wouldn't be any hands-on labs, which was not an acceptable situation.

The problem was that this person's network security firewall policy blocks all traffic on port 23. This isn't unusual, but port 23 is the standard port used for Telnet workstation access. No port 23 access equals no IBM i Telnet access for students. Another problem arose in that I was blocked myself from port 2001(the HTTP admin port), so I couldn't configure SSL for Telnet, which uses port 992. This would have been acceptable to the customer's security team, but I was blocked.

I was told that if I changed my IBM i Telnet port from 23 to 22, that would be acceptable to the security team. So that's what I did, from my hotel room late that night.

Before attempting to change the Telnet port, I needed to make sure I wouldn't lock myself out of the system and make a bad situation worse. Because I was changing Telnet, I needed to make sure I had an alternate access method to make configuration changes using some avenue other than Telnet, in case I broke Telnet. I decided on using the remote command server as my backup access method.

You can send CL commands to the IBM i through the remote command server. The client software is accessible using the PC command RMTCMD from a PC loaded with IBM's System i Access for Windows. (Go to a Windows command prompt[Start>CMD].) The PC executable is named RMTCMD.exe.

The RMTCMD.exe command has the following basic syntax:

RMTCMD CL-Command //IP-Address or System-Name

The //IP-Address is optional. If you only connect to one system, you can omit the directive.

Changing the TELNET Port Number

From the IBM i command line, you can use the command Work with Service Table Entries (WRKSRVTBLE) to view the current port numbers used for TCP/IP services. Using this command I noticed that the Telnet server was set for port 23 for both tcp and udp protocols, as shown here:

Work with Service Table Entries System: CILASOFT
Type options, press Enter.
1=Add 4=Remove 5=Display
Opt Service Port Protocol
telnet 23 tcp
telnet 23 udp
telnet-ssl 992 tcp
tftp 69 tcp
tftp 69 udp
time 37 tcp
time 37 udp
wbem-exp-https 5990 tcp
wbem-exp-https 5990 udp
wbem-http 5988 tcp
wbem-http 5988 udp
More... Parameters for options 1 and 4 or command
===>
F3=Exit F4=Prompt F5=Refresh F6=Print list F9=Retrieve F12=Cancel F17=Top F18=Bottom

Having a udp port assignment didn't make much sense to me because Telnet runs over tcp, but I wanted to make sure I wasn't missing something, so I configured the new port 22 for both tcp and udp using the following commands:

Add the entries to set Telnet to use Port 22 for tcp and udp
ADDSRVTBLE SERVICE('telnet') PORT(22) PROTOCOL('tcp') TEXT('Customized Telnet') ALIAS('TELNET' 'Telnet') ADDSRVTBLE SERVICE('telnet') PORT(22) PROTOCOL('udp') TEXT('Customized Telnet') ALIAS('TELNET' 'Telnet')
Remove the old entries that set Telnet to use Port 23 for tcp and udp
RMVSRVTBLE SERVICE('telnet') PORT(23) PROTOCOL('udp') RMVSRVTBLE SERVICE('telnet') PORT(23) PROTOCOL('tcp')
I then needed to stop and restart the Telnet server for the port change to take effect.

Using the remote command facility, I then ended and restarted the Telnet server:

RMTCMD ENDTCPSVR *TELNET RMTCMD STRTCPSVR *TELNET
I configured my Telnet client to use the new port 22 and all was right with the world. The students could now connect to the system using the approved port number 22. When this class is over, I'll surely set Telnet back to port 23.

Caution: Before changing any port on your production system, I encourage you to test, test, and then test again on a test or development system. And always make sure you have a way to change the settings back to the original settings in case of unexpected results.

文章评论

添加新评论

温馨提醒:如果您是第一次在本站留言,需要审核后才能显示哦!

相关文章

Whatsapp只能查看最近三天的聊天记录了怎么办?

Whatsapp只能查看最近三天的聊天记录了怎么办?

今天突然发现电脑上的WhatsApp只能查看最近3天的聊天记录了,显示要查看3天前的记录请到手机上查看。很是吃惊,以前一直是所有记录都自动同步到电脑版的啊,不论换电脑了还是换手机了,聊天记录从来没丢过。 查询一翻也没有找出来原因,怎么也同步不过去。 电脑版app重新安装了,也不行。 有个方法说...
阅读全文>>
网页路径中的'.'和'..'还有'./'和'../'区别

网页路径中的'.'和'..'还有'./'和'../'区别

. 表示当前目录 .. 表示当前目录的上一级目录。 ./表示当前目录下的某个文件或文件夹,视后面跟着的名字而定 ../表示当前目录上一级目录的文件或文件夹,视后面跟着的名字而定。 例如: 文件夹 a 下面有 文件夹b c 和文件 d。 文件夹b下面有e.php 和文件f。 则e中的 . 表示...
阅读全文>>
Introduction to ILE RPG Activation Groups

Introduction to ILE RPG Activation Groups

Learn how activation groups can help your ILE RPG programs run more efficiently, how to specify the type of group to use, and closing and reclaimin...
阅读全文>>
T480自动关机无法启动(解决办法)

T480自动关机无法启动(解决办法)

周五升级更新后,用一会就关机,还开不了,怎么按开机键也没有反应。 周六折腾一上午,拔电源,断电,20秒复位,把电池都拿下来了。都不行。 下午实在没办法了,给售后打电话让拿去检测一下。 然后拿售后去了,给检测一会没问题,说内存不干净给擦一下好了,开机正常了。 付款50块检测费,开心的拿回家,一...
阅读全文>>
Office 2016 Client Software License Management Tool

Office 2016 Client Software License Management Tool

Office 2016 Client Software License Management Tool Usage cscript ospp.vbs /Option:Value ComputerName User Password ComputerName: Name of remote c...
阅读全文>>