Setting up WireGuard without it being default route (for wg-quick)

Written by

in

Was configuring a WireGuard interface to be solely for split-tunneling qBittorrent and it took me a day to figure out how to actually set it up 💔

So you just turn off route table setting that wg-quick did automatically with Table = off
and create a new route table on PostUp

Example configuration to be pasted in [Interface] section
the table ID here is 100, change it to whatever you want ig
with 10.0.0.2 being your WireGuard interface IP
Table = off
PostUp = ip route add default dev %i table 100
PostUp = ip rule add from 10.0.0.2 table 100
PostDown = ip rule del from 10.0.0.2 table 100

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.