I am running software on a server that may be turning off some ports and need to find out what it is. I have the ports I need to check. I just need to find out what is turning them off. How can I do this?
If you are using Windows, you can use Tcpview, a very convenient utility developed by Mark Russinovih before he became VP of Microsoft. It will refresh itself every 2 (??) seconds.
If you are on Linux, the command
will show you all connected ports, except for those where your system is listening, which are instead displayed by the command
Both commands show the process and Process ID which is using the port in question. If you wish to monitor your ports continuously, the command is
and likewise for the other version: it will refresh itself every two seconds.
On Mac OS, you use
or some slight variant, depending on the exact version of your OS, as discussed here.