**已关闭。**此问题为not about programming or software development。目前不接受答案。
此问题似乎与a specific programming problem, a software algorithm, or software tools primarily used by programmers无关。如果您认为此问题与another Stack Exchange site相关,您可以留下评论,说明在何处可以找到此问题的答案。
2天前关闭。
Improve this question
目前我可以通过wireguard和互联网访问局域网。如何配置wg0访问局域网,但不通过VPN路由互联网流量?
我的当前配置(wg0):
Address = 10.0.0.1/32
ListenPort = 51820
PrivateKey = {key}
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
MTU = 1500
[Peer]
PublicKey = {key}
PresharedKey = {key}
AllowedIPs = 10.0.0.2/32
[Peer]
PublicKey = {key}
PresharedKey = {key}
AllowedIPs = 10.0.0.3/32
[Peer]
PublicKey = {key}
PresharedKey = {key}
AllowedIPs = 10.0.0.4/32
[Peer]
PublicKey = {key}
PresharedKey = {key}
AllowedIPs = 10.0.0.5/32
[Peer]
PublicKey = {key}
PresharedKey = {key}
AllowedIPs = 10.0.0.6/32
1条答案
按热度按时间kx1ctssn1#
我发现的一个解决方法是手动将PublicDNS服务器(例如8.8.8.8)添加到CLIENT配置的[Interface]部分下的“DNS=”行。