Search code examples
linuxfirewallports

Linux; How do I find logs if a program I'm running uses certain ports?


I am running CentOS 5 with csf firewall. I'm running a program that can't connect to another server (using some port that is blocked by csf I presume). Where is the log file for 'ports'?


Solution

  • Netstat is the command to use to get ports and network activity. To diagonise server processes I usually use:

    netstat -tln
    

    This yields port numbers in tcp mode listening. To identify associated processes you can also use -p to grab the pid. Here is the IANA ports list.