技术解析
我用 ufw 配置了防火墙,信息如下:
$sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
To Action From
-- ------ ----
443 ALLOW IN Anywhere
2000 ALLOW IN Anywhere
如果我没理解错的话,配置后的 ufw 就是放行 ipv4 的 443 、2000 端口进来的流量,其他端口进来的流量(默认)被拒绝,发出的流量(默认)全部允许。但是内部有个容器打开了 2004 端口(用 -p 2004:2004 参数),不过不作对外用途。但是当我用 macOS 的 Network Utility 应用扫描我这台主机,居然输出:
Port Scan has started…
Port Scanning host: hostname.com
Open TCP Port: 2000 callbook
Open TCP Port: 2004 mailbox
Port Scan has completed…
然后我用 Windows 的 Zenmap 也扫一下,发现也是有暴露的:
端口 协议 状态 服务 版本
2004 tcp open daap mt-daap DAAP
请问,问题出在哪里?