我最近将 RaspberryPi 3 配置为仅允许通过 VPN 连接。不过,我想从任何地方打开它以进行 SSH 连接。下面的规则应该允许端口 22 上的流量,但是一旦我启用 ufw,我就无法再从本地 IP 之外的任何地方进行连接(配置本地访问的规则工作正常)。 (路由器防火墙配置正确)
root@raspberrypi:~# ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), deny (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
192.168.178.0/24 ALLOW IN Anywhere
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
Anywhere ALLOW OUT Anywhere on tun0
192.168.178.0/24 ALLOW OUT Anywhere
31.13.190.247 443/tcp ALLOW OUT Anywhere
Anywhere (v6) ALLOW OUT Anywhere (v6) on tun0
答案1
我的错误是让 openvpn 处于活动状态。