我在我的 Mikrotik 上设置了一个 L2TP VPN 服务器。当我在路由器后面时连接到 VPN 是可行的,但是一旦我从 WAN 端连接,它就不行了。我记录了我的防火墙,看看我是否使用默认的删除规则删除了它,它是:
WANDROP input: in:ether1-gateway out:(none), src-mac 00:00:5e:00:01:66, proto UDP, 5.6.7.8:38211->1.2.3.4:500, len 412
但是我的规则是这样设置的:
add action=accept chain=input dst-address=1.2.3.4 dst-port=500,1701,4500 in-interface=ether1-gateway log=yes protocol=udp src-address=0.0.0.0
add action=accept chain=input dst-address=1.2.3.4 in-interface=ether1-gateway log=yes protocol=ipsec-esp src-address=0.0.0.0
add action=drop chain=input comment="default configuration" in-interface=ether1-gateway log=yes log-prefix=WANDROP
add action=accept chain=input comment="default configuration" connection-state=established,related
add action=accept chain=forward comment="default configuration" connection-state=established,related
add action=drop chain=forward comment="default configuration" connection-state=invalid
add action=drop chain=forward comment="default configuration" connection-nat-state=!dstnat connection-state=new in-interface=ether1-gateway log=yes log-prefix=DROP
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=1.2.3.4 dst-port=80 in-interface=ether1-gateway protocol=tcp to-addresses=192.168.88.232 to-ports=80
add action=masquerade chain=srcnat comment="default configuration" out-interface=ether1-gateway
不知道我做错了什么或错过了什么。
您的接受规则将源地址设置为
0.0.0.0
没有掩码,这就是它们不匹配任何内容的原因。如果有0.0.0.0
,路由器会尝试仅匹配特定于0.0.0.0
地址的数据包。既然你想匹配一切(我假设)它应该是0.0.0.0/0
.