我有一个ISP提供的运行自定义固件的D-Link路由器。我正在尝试启用对WAN上路由器Web服务器的访问。虽然路由器确实在“ TCP / IP设置”>“ WAN接口”下提供了此选项,但该设置似乎无法使用,因为我无法使用公共IP访问Web服务器。
令人惊讶的是,其他功能(如在WAN上启用ICMP或SAMBA)也有效。启用后者后,将在WAN上打开端口445和139。iptables条目如下:(当然,IP已更改。)
#iptables -nL -v --line-numbers
Chain INPUT (policy DROP 18 packets, 2447 bytes)
num pkts bytes target prot opt in out source destination
1 128 17459 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 86.96.111.32 tcp dpt:80
3 0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 10.137.158.217 tcp dpt:80
4 0 0 DROP udp -- ppp0 * 0.0.0.0/0 86.96.111.32 udp dpt:1900
5 0 0 ACCEPT tcp -- eth1 * 0.0.0.0/0 10.137.158.217 tcp dpt:!80
6 0 0 ACCEPT udp -- eth1 * 0.0.0.0/0 10.137.158.217 udp dpt:!1900
7 0 0 DROP icmp -- ppp0 * 0.0.0.0/0 86.96.111.32 icmp type 8
8 0 0 ACCEPT 2 -- ppp0 * 0.0.0.0/0 0.0.0.0/0
9 133 17435 ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0
10 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
11 0 0 ACCEPT tcp -- ppp0 * 0.0.0.0/0 86.96.111.32 tcp dpt:51005
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 39 2128 TCPMSS tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp flags:0x06/0x02 TCPMSS clamp to PMTU
2 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:1701
3 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:1701
4 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:1723
5 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp spt:1723
6 0 0 ACCEPT 47 -- * * 0.0.0.0/0 0.0.0.0/0
7 0 0 ACCEPT udp -- eth1 * 0.0.0.0/0 224.0.0.0/4 udp
8 646 47785 ACCEPT all -- br0 * 0.0.0.0/0 0.0.0.0/0
9 0 0 ACCEPT udp -- ppp0 br0 0.0.0.0/0 0.0.0.0/0 udp dpt:500
10 0 0 ACCEPT udp -- ppp0 * 0.0.0.0/0 224.0.0.0/4 udp
11 0 0 ACCEPT esp -- ppp0 br0 0.0.0.0/0 0.0.0.0/0
12 823 1055K ACCEPT all -- ppp0 * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
13 0 0 MINIUPNPD all -- ppp0 !ppp0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 211 packets, 61932 bytes)
num pkts bytes target prot opt in out source destination
Chain MINIUPNPD (1 references)
num pkts bytes target prot opt in out source destination
如果未选中“通过WAN访问Web服务器”选项,则上面INPUT链中的规则#2更改为DROP,这意味着它确实起作用,但是由于某些原因,我无法从WAN访问Web服务器。请提出想法。