大网数据广告活动
服务器运维问答

difference between 0.0.0.0 and * network in ss output

· 52CE 我爱测

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 L…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-03-01)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。