Luciogi

Wireguard Split Tunnel

Table of Contents



Published on

Scenario

I want to achive, when I connect to vpn server, it should not route all traffic throught the VPN server. I want to whitelist ip’s that are blocked in my country, and when I access that website, only that traffic should use VPN server.

Wireguard split tunnel diagram

Wireguard split tunnel diagram

How to

As I am low on budget, I will use Proton VPN with wireguard configuration. You can use any vpn service that provides wireguard configuration.

  1. Download wireguard configuration from vpn provider.

  2. Copy config into /etc/wireguard/

  3. Edit config like following

    1[Interface]
    2...
    3DNS = 9.9.9.9 # or 8.8.8.8
    4
    5
    6[Peer]
    7...
    8AllowedIPs = 217.197.84.140/8, 2a0a:4580:103f:c0de::1
    9...
    In my case vpn provider’s dns was not resolving hosts, so I changed it to Quad9 DNS. Set AllowedIPs to address that are blocked or you just want them to access through VPN server. Be careful, if website server changes ip addresses, then you have to take care of updating AllowedIPs

  4. Now start wireguard with above config

I hope it will work for you.




Related Posts