OpenVPN Simple Policy Based Routing Problem

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


Joined: 10 Jan 2018
Posts: 9

PostPosted: Fri May 18, 2018 20:40    Post subject: OpenVPN Simple Policy Based Routing Problem Reply with quote
Hi all,
So this one is driving me mad.
Simple set up - Wireless router with 2 Wireless AP's and Single Subnet LAN connected to Cable Modem.

All I am trying to do is to use OpenVPN Client and use Policy Based Routing to send just one of the hosts on my network out via the vpn, the rest go in the clear.

But.

As soon as I put something in the PBR settings such as
192.168.1.50/32
All web based traffic seems to no longer work for 192.168.1.50 and all other LAN IP's
I can still traceroute and ping from 192.168.1.50 out onto the internet and the traceroute is saying it is going out via the VPN.



Any ideas?
Latest DDWRT on a Linksys 1900ACS
Sponsor
thefunkygibbon
DD-WRT Novice


Joined: 10 Jan 2018
Posts: 9

PostPosted: Sat May 19, 2018 8:37    Post subject: Reply with quote
ah ok, thanks. I've just rolled back about a year and it seems to work ok. is it just one person developing ddwrt? seems a bit off that regression bugs are taking this long to resolve.

I think i'm going to have to do something a bit more complex with PBR to be honest though after all.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12911
Location: Netherlands

PostPosted: Sat May 19, 2018 8:37    Post subject: Reply with quote
Yes start by disabling Shortcut Forwarding Engine on the setup page that is not compatible with PBR (there is a solution though)

Furthermore I am not sure about your Network setup, you state LAN connected to your cable modem, but normally you should connect the cable modem to your router via the WAN port, unless you are using your router as a Wireless Accces Point.

When using PBR also disable any kill switch you are using (there is a kill switch for PBR but first get it working)

Kong builds are working for BS builds probably use 35531 or earlier, maybe latest version 35927 might work

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
thefunkygibbon
DD-WRT Novice


Joined: 10 Jan 2018
Posts: 9

PostPosted: Sat May 19, 2018 9:27    Post subject: Reply with quote
thanks, yes it is connected to wan port. i meant the router is connected to a cable modem not that the lan port was specifically.

i've arbitarily rolled back to r32170 and PBR is indeed working. i hadn't tried SFE disabling, but I didn't even know the 'feature' existed let alone knew if it was worthwhile disabling. i don't see any bandwidth/connection issues to justify needing it though.

i've set it up like this to be for accessing netflix in the US but i've found that when i do that for a certain IP, Amazon Prime doesnt work at all, so more complex it needs to be.

Also also, what is the script/command that turning on/off the OpenVPN client via the webUI runs? I've been looking into being able to turn it on/off via SSH script to be able to let the wife easily turn it off if she needs to use Prime video, but there doesn't seem to be an on/off command, despite being able to do it via the webUI.. which doesn't make sense. I've tried to search the device for *.asp or script files but have had no luck so far. any ideas?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12911
Location: Netherlands

PostPosted: Sat May 19, 2018 11:27    Post subject: Reply with quote
You can turn OpenVPN client off in the gui by just disabling it, your settings are retained when you enable it iit just starts to work (of course Save and Apply)

From CLI to stop openvpn:
Code:
killall openvpn

To start :
Code:
openvpn --config /tmp/openvpncl/openvpn.conf --route-up /tmp/openvpncl/route-up.sh --route-pre-down /tmp/openvpncl/route-down.sh --daemon


I have not tested the above @Eibgrad will know better Smile

With PBR you route your own clients by their IP address, it is also possible to route by destination IP address e.g. always route netfilx via the VPN but nothing else. Problem is that Netfilx or Amazon usually use a lot of different IP addresses and you do not know them.

You can not use PBR and IP destination routing together from the GUI, there is however a really neat solution for this crafted by @Eibgrad, he has made a script to route anything but the kitchen sink but I do not think this can route by domain name and that is probably what you want.

I am sure he will chime in and enlighten us on the subject Smile

I think it is possible if you install ipset-dns but I have never tried it (must ask @James2k about that he is our resident ipset guru Smile )

EDIT: here is the link: https://www.dd-wrt.com/forum/viewtopic.php?p=1088734&sid=2cef9cca334ace3e8a63b917963d7732

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
thefunkygibbon
DD-WRT Novice


Joined: 10 Jan 2018
Posts: 9

PostPosted: Mon May 21, 2018 18:46    Post subject: Reply with quote
ok thanks. I'll look into using the script. Truth be told , I bought an app off of the Android app store which claimed to be able to make changes to a dd-wrt router, but it has seemingly got loads of flaws, one being that it forces a reboot of the router when it turns off/on the openvpn client or server. so now i know that you can turn it on or off via ssh (which is what it uses) without doing that, I'm just going to write some scripts and fire them off using dash buttons or something Smile

cheers
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT 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