Linux 配置 Wireguard 服务

Posted by koocyton on 2025-07-16
Estimated Reading Time 1 Minutes
Words 77 In Total
Viewed Times

Linux 配置 Wireguard 服务

1
2
3
4
5
6
7
8
9
10
[Interface]
Address = 10.14.0.2/24
PrivateKey = {Server PrivateKey}
ListenPort = 51821
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
AllowedIPs = 10.14.0.0/24
PublicKey = {Peer PublicKey}

如果您喜欢此博客或发现它对您有用,则欢迎对此发表评论。 也欢迎您共享此博客,以便更多人可以参与。 如果博客中使用的图像侵犯了您的版权,请与作者联系以将其删除。 谢谢 !