Sample Header Ad - 728x90

socket statistics (ss) program weird ipv6 listening socket address format

1 vote
0 answers
1249 views
I have two services listening on TCP/IPv6 sockets, ssh and mysql. ss shows this:
$ ss -tl6
State     Recv-Q    Send-Q    Local Address:Port    Peer Address:Port               
LISTEN    0         128       [::]:ssh              [::]:*                     
LISTEN    0         80        *:mysql               *:*
Why is the "Local Address" and "Peer Address" displayed differently for ssh and mysql? I.e. what if anything is the meaning behind "[::]" vs "*"? Note netstat shows no difference ("::" for both):
sudo netstat -natlp6
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address  Foreign Address  State      PID/Program name    
tcp6       0      0 :::22          :::*             LISTEN     26240/sshd          
tcp6       0      0 :::3306        :::*             LISTEN     23933/mysqld
--- **UPDATE** As @Amir pointed to in comments, there is actually a difference between the two services: sshd has two open sockets one for ipv4 only and one for ipv6, where as mysqld only has one ipv6 socket:
$ pgrep mysqld
23933
$ pgrep sshd
26240
$ sudo lsof -a -p 23933 -i
COMMAND   PID  USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
mysqld  23933 mysql   27u  IPv6 6062236      0t0  TCP *:mysql (LISTEN)
$ sudo lsof -a -p 26240 -i
COMMAND   PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
sshd    26240 root    3u  IPv4 6106855      0t0  TCP *:ssh (LISTEN)
sshd    26240 root    4u  IPv6 6106857      0t0  TCP *:ssh (LISTEN)
I disabled ipv4 in SSH config and ss still displays the two differently, but it maybe different type of ipv6 / ipv4 support as @Amir mentioned?
Asked by spinkus (500 rep)
Dec 2, 2020, 12:53 PM
Last activity: Apr 17, 2022, 10:24 PM