这是我的防火墙规则:
deny outgoing
deny incoming
allow out from any to any on tun0 (alow just the traffic from the VPN)
Run Code Online (Sandbox Code Playgroud)
但是,当我想从 gnome 网络管理器启动 VPN 连接时,我被迫禁用 ufw。然而,我尝试过类似的事情:
allow out from any to any on wlan0 port 1194
Run Code Online (Sandbox Code Playgroud)
但这不起作用。
有什么建议 ?
解决方案 :
以下几行使您能够阻止所有传出的非 VPN 流量。换句话说,只允许 VPN 流量。此外,如果您的 VPN 连接失败,您无需禁用防火墙即可重新连接。
1 - 在终端中运行以下命令:
sudo tail -f /var/log/ufw.log
Run Code Online (Sandbox Code Playgroud)
2 - 尝试连接到您的 VPN
3 - 查看所有带有 Ip 地址的“[UFW BLOCK]”行在我的例子中,我有两个带有 DST= 的地址 ip 。。.240 和 DST=" . . .241.
然后我的 VPN 给出的 IP …