I need to block specific ports temporarily on AIX 7.2 to simulate an application using this port. I am developing a workaround for an application ignoring the entries in /etc/services and using otherwise dedicated ports anyway.

I could use a localized firewall ("IP Security Filter Rule" in AIX lingo) but I would rather have a process using the port that I can start and stop at a moment's notice.

Reconfiguring IP filters takes more time to set up a convincing testbed.

The ideal solution would be a binary that binds to a configurable port number/protocol and which can be started and stopped from the command line.

I can relatively easy install all the software from IBMs "Toolbox for Open Source Software". Compiling programs on AIX on your own, though, is a strenuous activity as this thread emphasizes. It corresponds with my own experiences in this regard. If at all possible I'd rather forego compiling something longer than a few lines myself.

The mentioned Toolbox actually has:

  • ncat: "Nmap's Netcat replacement"
  • socat: Bidirectional data relay between two data channels ('netcat++')

1 Answer 1


Actually @roaima's question helped me find the solution myself. Here it is, maybe someone else may find it helpful.

Background of my problem: some DB-Software captured port 39021/udp, which is allocated to NIM (NIMAUX, actually) in our environment, ignoring the entry in /etc/services. This prevents our weekly system backups, which are done as mksysb-Images via the NIM-server.

To find some workaround i installed a test system but needed to simulate the behavior of the software in question and block port 39021/udp for IPv4.

Solution: install the ncat.ppc package from the IBM Toolbox for Open Source Software (see the question for the link). These are precompiled packages in rpm format one can download and install in AIX systems.

Then issue this command:

 /opt/freeware/bin/ncat -p <portnr> -uU4 <some_host> &

Resulting output of netstat -Aan:

root@lpar:/> netstat -Aan | grep <portnr>
f100050003020000 udp4       0      0  <ip>.<portnr>   <ip>.<portnr>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .