LoginSignup
3
5

More than 3 years have passed since last update.

WireGuard で LAN内通信は VPN を経由させない

Posted at

Quick Startそのままだとすべての通信が WireGuard 経由になるので、同じLANに接続しているローカルデバイスに接続できない。

AllowedIPs をいじる

WireGuard 経由にする設定AllowedIPsがすべて(0.0.0.0/0)になっているのが原因。

全部WireGuard経由
AllowedIPs = 0.0.0.0/0

この設定値をパブリックIPアドレスに絞れば、

  • LANはダイレクトに通信(WireGuard を経由しない)
  • WANは WireGuard 経由

となる。

パブリックIPアドレスだけの設定例
AllowedIPs = 0.0.0.0/5,8.0.0.0/7,11.0.0.0/8,12.0.0.0/6,16.0.0.0/4,32.0.0.0/3,64.0.0.0/2,128.0.0.0/3,160.0.0.0/5,168.0.0.0/6,172.0.0.0/12,172.32.0.0/11,172.64.0.0/10,172.128.0.0/9,173.0.0.0/8,174.0.0.0/7,176.0.0.0/4,192.0.0.0/9,192.128.0.0/11,192.160.0.0/13,192.169.0.0/16,192.170.0.0/15,192.172.0.0/14,192.176.0.0/12,192.192.0.0/10,193.0.0.0/8,194.0.0.0/7,196.0.0.0/6,200.0.0.0/5,208.0.0.0/4

参考

Can't connect to local devices on Windows 10 · Issue #1709 · trailofbits/algo · GitHub

3
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5