为什么端口转发在我的网络中不起作用?

Why is port forwarding not working in my network?

我正在尝试在我的路由器 (ZTE F660) 中启用端口转发,但由于某种原因它根本无法工作。首先,我在我的 ubuntu 机器上启动了我的服务器应用程序,并将其 ip 地址固定为 192.168.1.2。然后,我将规则设置如下:

没用。所以,我尝试在我的路由器设置中禁用防火墙:

它也不起作用,然后我通过键入禁用了主机的防火墙:

sudo ufw disable

它没有用。然后,我尝试使用许多不同的端口,但都没有用! :(

我试过使用一些端口转发测试器(比如这个:https://hidemy.name/en/port-scanner/),它总是说端口的状态是“已过滤”。我打电话给我的互联网供应商,他们说端口转发应该是 运行 但他们没有提供技术帮助。谁能帮我这个?想不出还有什么可做的。

您的 ISP 使用 CGN(运营商级 NAT),因为您的 WAN 地址在共享地址 space (100.64.0.0/10) 中。即notpublic地址space,定义为RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space:

Abstract

This document requests the allocation of an IPv4 /10 address block to be used as Shared Address Space to accommodate the needs of Carrier- Grade NAT (CGN) devices. It is anticipated that Service Providers will use this Shared Address Space to number the interfaces that connect CGN devices to Customer Premises Equipment (CPE).

Shared Address Space is distinct from RFC 1918 private address space because it is intended for use on Service Provider networks. However, it may be used in a manner similar to RFC 1918 private address space on routing equipment that is able to do address translation across router interfaces when the addresses are identical on two different interfaces. Details are provided in the text of this document.

This document details the allocation of an additional special-use IPv4 address block and updates RFC 5735.

地址块详见第7节:

7. IANA Considerations

IANA has recorded the allocation of an IPv4 /10 for use as Shared Address Space.

The Shared Address Space address range is 100.64.0.0/10.

地址 space 也在 IANA IPv4 Special-Purpose Address Registry.

中找到

这意味着您拥有 home/residential ISP 协议。 ISP 正在使用 CGN 为愿意为其付费的企业保存他们宝贵的 public 地址。 ISP NAT 还需要配置为将端口转发到您的 WAN 地址共享 space,但 ISP 不能这样做,因为 CGN 后面的其他人可能也希望将该端口转发给他们。

ISP 并不真正关心这会破坏您想要做的事情,因为您的住宅 ISP 合同包含禁止您从您的网络到 public Internet 的 运行 服务的条款。您需要一个 public 地址和 ISP 许可才能执行您想要的操作,这可能意味着商业合同。 CGN 的激增是托管公司的一大推动力,这是实现这一目标的另一种方式。