VyOS Policy Based Routing with OpenVPN

Make a selection of hosts use a vpn connection

VyOS Policy Based Routing with OpenVPN

UPDATE:
On newer versions og VyOS, it is not possible to have OpenVPN tunnels without certificate based authentication. This kills the possibility of using PIA without patching the image. I've created a new guide for the 1.4-rolling-202101300218 releade using Mullvad and WireGuard instead.

VyOS Policy Based Routing with WireGuard + Mullvad
Here is a quick guide to setting up policy based routes for VyOS or other Vyatta variants such as EdgeOS.

Sometimes you want some hosts on your network to use a vpn connection. This is where policy based routing comes in to play. Here is how i got it to work on VyOS 1.3 with PIA VPN.

This may work on the LTS releases of VyOS. I however need features only available in the 1.3.x releases, so results may vary. This config was successful on 1.3-rolling-202010260327, but not on the newer 1.3-rolling-202011070217 as this version introduced bugs in OpenVPN.