wg-quick: Add option TableDefaultGW

Rene 'Renne' Bartsch, B.Sc. Informatics ml at bartschnet.de
Sat Dec 29 15:13:32 CET 2018


Hi,

We're in the situation in which we want to use the default routing table but need another routing table
for a policy-based routing of public static IP-Adresses with a wireguard default gateway in the VPN.
"Table <uint|name>" is no option as it would create all routes in the new table.

My current idea is to use

PostUp =  wg set %i peer <pubkey> allowed-ips ::/0, 0.0.0.0/0
PostUp =  ip -4 route add default dev %i table <uint|name>"
PostUp =  ip -6 route add default dev %i table <uint|name>"
PreDown = ip -4 route del default dev %i table <uint|name>"
PreDown = ip -6 route del default dev %i table <uint|name>"

and use "ip rule"-statements in PostUp/PreDown.

To simplify such a VPN setup with a default gateway I suggest a wg-quick option "TableDefaultGW <uint|name>"
which adds a routing table for the default gateway only.

Regards,

Renne


More information about the WireGuard mailing list