OpenVPN client and PBR causing local subnet routing issue

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking
Author Message
plawlor
DD-WRT Novice


Joined: 26 Dec 2015
Posts: 19

PostPosted: Thu Mar 08, 2018 1:14    Post subject: OpenVPN client and PBR causing local subnet routing issue Reply with quote
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.

Please help!

Peter
Sponsor
plawlor
DD-WRT Novice


Joined: 26 Dec 2015
Posts: 19

PostPosted: Thu Mar 08, 2018 11:52    Post subject: Reply with quote
Thanks. This article describes my problem to a "T", so I suspect it will work. I'll try it tonight when I get home.

Question: Does this rely on the OpenVPN connecting upon router startup? Or will it execute after the VPN connects whenever that happens? Even if I disconnect it manually and reconnect?

Reason I ask is that I cannot get mine to connect on startup. I need to manually disable the OpenVPN client, save and apply, then re-enable, save and apply in order to kick it into gear.

Anyone know how to resolve this?

Thanks,
Peter
plawlor
DD-WRT Novice


Joined: 26 Dec 2015
Posts: 19

PostPosted: Sat Mar 10, 2018 19:12    Post subject: Reply with quote
Applied this script and it works perfectly. Thanks!
plawlor
DD-WRT Novice


Joined: 26 Dec 2015
Posts: 19

PostPosted: Mon Mar 19, 2018 18:43    Post subject: Reply with quote
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.

Any thoughts?

Peter
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum