8.12. 使用图形界面在 WireGuard 服务器上配置 firewalld
您必须在 WireGuard 服务器上配置 firewalld
服务,以允许来自客户端的传入的连接。另外,如果客户端能够使用 WireGuard 服务器作为默认网关,并通过隧道路由所有流量,则必须启用伪装。
流程
-
按 Super 键,输入
firewall
,然后从结果中选择 Firewall 应用程序。 -
在 Configuration 列表中选择
Permanent
。 -
选择
public
区域。 允许到 WireGuard 端口的传入连接:
- 在 Ports 选项卡上,单击 。
- 输入您为传入 WireGuard 连接设置的端口号:
-
从
Protocol
列表中选择udp
。 - 点 。
如果客户端应该通过隧道路由所有流量,并使用 WireGuard 服务器作为默认网关:
- 导航到 public 区域的 Masquerading 选项卡。
-
选择
Masquerade zone
。
-
选择
。
验证
显示
public
区域的配置:# firewall-cmd --list-all public (active) ... ports: 51820/udp masquerade: yes ...