LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Reading output from netstat (https://www.linuxquestions.org/questions/linux-networking-3/reading-output-from-netstat-678765/)

the_gripmaster 10-24-2008 04:18 AM

Reading output from netstat
 
This is a n00b question, please bear with me. Can you please confirm if I am reading the netstat output right:

Code:

[root@mx2 ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address              Foreign Address            State      PID/Program name
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                  LISTEN      5115/mysqld
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                  LISTEN      5164/sendmail: acce
tcp        0      0 :::80                      :::*                        LISTEN      5944/httpd
tcp        0      0 :::22                      :::*                        LISTEN      4963/sshd
tcp        0      0 :::443                      :::*                        LISTEN      5944/httpd

This is what I understand:

Code:

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                  LISTEN      5115/mysqld
means mysql port (3306) is open on all interfaces (0.0.0.0) of the server and it is listening for connections from all hosts (0.0.0.0) and all ports of the host (*).

Code:

tcp        0      0 :::22                      :::*                        LISTEN      4963/sshd
means ssh port (22) is open for all interfaces of the server ( ::: ) and it is listening for connections from all hosts ( ::: ) from any port (*).

I am a bit confused about the difference between 0.0.0.0 and :::. Do they mean the same? And are all my other interpretations correct?

estabroo 10-24-2008 12:38 PM

That output seems altered. Generally you see the ::: notation for services that have a tcp6 port open, it means the same as 0.0.0.0. Things like ssh will typically open a tcp4 and a tcp6 listener so it'll show up in netstat twice, once with 0.0.0.0 and once with :::


All times are GMT -5. The time now is 03:44 AM.