[SOLVED] concurrent Wireguard server and client

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
Wizo
DD-WRT User


Joined: 08 Jun 2023
Posts: 104
Location: Essex. England.

PostPosted: Mon May 19, 2025 19:29    Post subject: [SOLVED] concurrent Wireguard server and client Reply with quote
I have a working WG Server tunnel and a working surfshark VPN tunnel each works great one at a time.

If I turn both on at the same time, the Server tunnel connects remotely, but I can't access remote devices.
If I disconnect the WG VPN then I can.

I am thinking is a PBR rule for surfshark tunnel, but what it should look like is a complete mistry to me.

I have downloaded all the wireguard documents but I’m getting lost.

Some advise would be great.


Latest ver of DD-WRT “DD-WRT v3.0-r61337 std (05/17/25) “
Netgear XR700



Surfshark VPN.png
 Description:
 Filesize:  103.3 KB
 Viewed:  328 Time(s)

Surfshark VPN.png



WG Server1.png
 Description:
 Filesize:  88.58 KB
 Viewed:  328 Time(s)

WG Server1.png



WG Server2.png
 Description:
 Filesize:  77.78 KB
 Viewed:  328 Time(s)

WG Server2.png


Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13656
Location: Netherlands

PostPosted: Tue May 20, 2025 5:58    Post subject: Reply with quote
WireGuard Client setup guide see paragraph about "Route selected sources via the WAN"
_________________
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
Wizo
DD-WRT User


Joined: 08 Jun 2023
Posts: 104
Location: Essex. England.

PostPosted: Tue May 20, 2025 6:09    Post subject: Reply with quote
Quote:
Routed selected sources via the WAN
This does the opposite, everything entered in the PBR box will be routed via the WAN and everything
else will be routed via the VPN.
This can be useful if you have only a few IP addresses you want to route via the WAN and is also very
useful if you also run a concurrent WireGuard or OpenVPN server.
DDWRT Wireguard client setup guide by egc, last modified: 2-May-25 page 16
As the WireGuard/OpenVPN server must be using the WAN you can add sport 1194/51820 and now
this port will be using the WAN., e.g.:
sport 1194
You can make it universal (only for recent builds) with for OpenVPN server add to the PBR field:
sport $(nvram get openvpn_port)
For a WireGuard server (if it is the first tunnel you are using as Server) add to the PBR field:
sport $(nvram get oet1_port


sport $(nvram get oet1_port) I think.... sport oet 3 maybe?
Wizo
DD-WRT User


Joined: 08 Jun 2023
Posts: 104
Location: Essex. England.

PostPosted: Tue May 20, 2025 6:12    Post subject: Reply with quote
Sorry EGC, I'm old and silly... but I do try.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13656
Location: Netherlands

PostPosted: Tue May 20, 2025 6:26    Post subject: Reply with quote
It depends on the tunnel you are using

if the server is the third tunnel it is oet3

"nvram get oet3_port" will show you the port you are using for the tunnel e.g. 51820 or another value you are using for the listen port of the WireGuard server


You can also directly use the listen port e.g. "sport 51820" instead of "sport $(nvram get oetX_port)"

_________________
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
Wizo
DD-WRT User


Joined: 08 Jun 2023
Posts: 104
Location: Essex. England.

PostPosted: Tue May 20, 2025 6:35    Post subject: Reply with quote
root@Router:~# nvram get oet3_port
51810


So I should change the PBR in my VPN tunnel to "sport oet3"

Source Routing (PBR) or Destination Routing?

I'm guessing Source Routing.
Wizo
DD-WRT User


Joined: 08 Jun 2023
Posts: 104
Location: Essex. England.

PostPosted: Tue May 20, 2025 8:22    Post subject: Reply with quote
Ok. Thanks, EGC, I think I've finally got it.


Leave my VPN (oet1) alone, only change my WG Server (oet3).


I have added Source Routing (PBR) = Route Selected sources via WAN

Source for PBR = sport 51810
Destination Routing = Route All Destinations via Default Route


Seems to be working, does that look about right to you?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13656
Location: Netherlands

PostPosted: Tue May 20, 2025 8:49    Post subject: Reply with quote
Wizo wrote:
Ok. Thanks, EGC, I think I've finally got it.


Leave my VPN (oet1) alone, only change my WG Server (oet3).


I have added Source Routing (PBR) = Route Selected sources via WAN

Source for PBR = sport 51810
Destination Routing = Route All Destinations via Default Route


Seems to be working, does that look about right to you?


👍

_________________
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
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