跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[宽带症候群] 监听本地 IP 的服务居然可以被公网访问

发表于
[环境]
路由器拨号(局域网 IP192.168.1.1 公网 IP123.12.12.12 )
主机 Ubuntu 24.04.1 LTS (局域网 IP192.168.1.2 ,与路由器 DMZ )

[异常情况]
在主机上运行有一些服务,有的是直接跑,有的用 Docker 部署。监听地址为本机局域网 IP192.168.1.2 ,期望只允许内网访问。但实际上外网设备可以通过公网 IP+端口的形式访问这些服务。

[做过的尝试]
1.关闭了 UTUN 接口,由于本机采用 Sing box 的 tun 模式入站,猜测可能有关系。关了 UTUN 接口依然如此。
2.使用 Pyhone 起了一个最简单的文件服务,监听本地 IP ,依然可以被公网访问,说明与服务无关。
3.在阿里云服务器上测试,服务监听局域网 IP ,也可以被公网访问(排除本机故障)

[一些猜想]
1.DMZ 引起的,但是查到 DMZ 不涉及 NAT ,而且服务日志可以看见正确的外网访问的源 IP 。目前没有条件关闭 DMZ 测试,一关就失联
2.安装 Singbox 时的一些设置所引起的。例如开启了 IP 转发;修改了转发规则(源 IP 伪装);防火墙放行了所有 TUN 接口的流量。
3.安装了 snell 服务端,这是和阿里云服务器唯一的共同点,但是不认为这会有什么影响


目前先用 UFW 防火墙只允许内网子网 IP 访问这些端口。
虽然这是一个很基础的问题,但是由于本人能力水平实在有限,反请各位高手指点一二!

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.