问题原文
原帖链接 · tcurdt · CC BY-SA 4.0
The ss command seems to distinguish between * and 0.0.0.0. While the listing of ssh with 0.0.0.0:22 and [::]:22 is clear, *:7946 and *:80 is not quite as much.
$ ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 128 *:7946 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 [::]:22 [::]:*
Why isn't it 0.0.0.0:7946 and 0.0.0.0:80? What's the difference here?
已采纳解答
原帖链接 · Martin · CC BY-SA 4.0
The difference lies inside the address family:
0.0.0.0:22 : This is a listen socket which accepts connections on any interface, port 22 for IPv4 connections only.
[::]:22 : Same here, but for IPv6 connections.
LISTEN 0 128 *:80 *:*
And this is a listen sockets which accepts IPv4 as well as IPv6 connection requests.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
