[SOLVED] Wireguard and PBR

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Mon Mar 06, 2023 20:00    Post subject: [SOLVED] Wireguard and PBR Reply with quote
Hi all...I'm hoping you can help me out here. I have WindScribe VPN (using Wireguard)...it works great...but I can't seem to get certain web pages from bypassing the VPN to use the WAN address.

If I visit Facebook for example....It still shows the Wireguard given IP address. (causes login issues at times) How do I get my list of PBR sites to bypass VPN?

Yes...I have read the Wireguard guide.

This is an XR500 running 51937. (but it's been doing this all along.)


redhawk


[Edited for clarification]


Last edited by redhawk0 on Mon Mar 06, 2023 20:59; edited 1 time in total
Sponsor
dale_gribble39
DD-WRT Guru


Joined: 11 Jun 2022
Posts: 1941

PostPosted: Mon Mar 06, 2023 20:31    Post subject: Reply with quote
All sources via VPN would mean all clients in your LAN would use the VPN, regardless of destination, perhaps?
_________________
"The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep." - Robert Frost

"I am one of the noticeable ones - notice me" - Dale Frances McKenzie Bozzio

<fact>code knows no gender</fact>

This is me, knowing I've ruffled your feathers, and not giving a ****
Some people are still hard-headed.

--------------------------------------
Mac Pro (Mid 2012) - Two 2.4GHz 6-Core Intel Xeon E5645 processors 64GB 1333MHz DDR3 ECC SDRAM OpenSUSE Leap 15.5
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Mon Mar 06, 2023 20:39    Post subject: Reply with quote
The way I understand it...it sets all sources to use the VPN IP address...except when the "Route Selected Destinations via WAN" is selected then the entered addresses are only to be routed through the WAN address.

I also have the line

server=/facebook.com/marlinowners.com/fedex.com/michaels.com/etsy.com/ebay.com/serengetifashions.com/kohls.com/jcpenney.com/usps.com/express-scripts.com/1.1.1.1"

in my DNSMasq Additions section on the Services page. Only because I read that this should be setup from the Wireguard document.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Tue Mar 07, 2023 7:23    Post subject: Reply with quote
To make sure it is not a DNS problem add the interface to the DNSMasq options (your WAN interface is eth0 I assume)

server=/facebook.com/marlinowners.com/fedex.com/michaels.com/etsy.com/ebay.com/serengetifashions.com/kohls.com/jcpenney.com/usps.com/express-scripts.com/1.1.1.1@eth0

Facebook (and amazon/netflix etc.) use a lot of different domains and subdomains so you have to take care you route them all.

Second problem is that the IP addresses change over time (other servers are added etc) and the IP address is only resolved when the tunnel starts so it can be that right after the tunnel starts it will work but after some time not as your client which is resolving facebook.com at that moment gets another IP address.

Both problems can be mitigated by the use of IPSET which dynamically creates a list of resolved IP addresses and routes this list, this also will catch subdomains on the fly.

You can manually implement this (see IPSET documentation a sticky in this forum) or wait till it is added to WireGuard (I have it running already but have to test it , see attachment Smile )

_________________
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


Last edited by egc on Tue Mar 07, 2023 15:37; edited 1 time in total
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Tue Mar 07, 2023 15:35    Post subject: Reply with quote
Thanx egc....I'll have to wait I guess...I did add "@eth0" to my DNSMasq line...but it didn't help. (yes...eth0 is the correct interface for WAN on the XR500....verified)

This is just a bit frustrating...I'm not proficient with command line rules...if it's in the configuration...I can understand it...but if it's changing the code or manually entering the code....I get lost very quickly.

[EDIT] - I found I missed a quote the first time around...This has fixed it....(see image)

redhawk
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Tue Mar 07, 2023 15:40    Post subject: Reply with quote
Great to hear you solved it 👍
_________________
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
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Tue Mar 07, 2023 18:32    Post subject: Reply with quote
Well....now its back to not working....so....semi-solved.

I know where the problem is...just haven't been able to get consistent results.

redhawk
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