Posted: Thu Mar 08, 2018 1:14 Post subject: OpenVPN client and PBR causing local subnet routing issue
Here's my setup:
The subnet upon which all my streaming devices reside is 192.168.5.x. My router is 192.168.5.1. I have an OpenVPN client running on it. Because I don't want all of my streaming devices to use the VPN, I'm using Policy Based Routing to define which IPs go through the VPN. All other IPs go out the WAN interface. This is all working fine.
I have a second subnet in my network - 192.168.1.x. My Plex Server is on this subnet - 192.168.1.22. I have a bridge between the two networks (192.168.1.202 to 192.168.5.2). I have static routes setup on both subnet's main routers that enable routing between the subnets. This all works fine. I can hit 192.168.5.x addresses from the 192.168.1.x network. And those devices that are NOT specified in PBR and, therefore, do NOT use the VPN, can connect to 192.168.1.x addresses fine, including my Plex Server.
The issue is with my devices that are specified in PBR to use the VPN. When trying to hit a 192.168.1.x address, they route out through the VPN. My understanding is that they ignore the main routes table, so everything goes out the VPN tunnel. How can I correct this and force the target of 192.168.1.0/24 back to the bridge interface at 192.168.5.2?
I thought I read that you could add custom routes like this to the "Additional Config" section of the OpenVPN Client setup, but I can't seem to get the context right.
UPDATE: Okay, things not working so well now. Everything worked fine for a few days, then all of the sudden, those devices that are not routing over the VPN lose all ability to connect to the Internet. It's as if they aren't even being NAT'ed anymore. And even a router reboot doesn't solve the problem. Only way to resolve is a factory reset and reconfigure from scratch.