[solved] Wireguard Client on 2nd rtr/subnet behind Gtwy rtr

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


Joined: 19 Mar 2025
Posts: 2

PostPosted: Mon Mar 31, 2025 18:55    Post subject: [solved] Wireguard Client on 2nd rtr/subnet behind Gtwy rtr Reply with quote
Hello,

I’m having trouble setting up a wireguard client on a 2nd router on a different subnet from my main/gateway router. I suspect this may be an iptables issue (likely an omission on my part) since I’m a network beginner, but I’m not sure and my searches on the forum don't appear (to me atleast) to address my issue.

My wireguard server is running on a VPS (Vultr hosted) and when I connect my router that is running the WG client directly to the internet (as a gateway router), everything works fine over WG. But when I add my primary router to the configuration and move my router that is running WG client to a different subnet, I am no longer able to even get a handshake from the WG server.

I am looking at the sticky DD-WRT Wireguard client setup guide (https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624) and the post about configuring a secondary DD-WRT router for the networking config (https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1265434) but I’m not seeing the fix to my problem. Any pointers to relevant threads or direct feedback based on my configs below would be greatly appreciated. Thanks in advance for any help.


This is a crude network diagram of my config:
RTR B (WG client) <---> RTR A (Gateway) <---> Internet <---> VPS running WG server

Router B
----------------------------
Asus RT-AC5300
DD-WRT v3.0-r58881
WAN port – static ip address 10.1.30.2/24
WAN gateway 10.1.30.1
WAN port physically connected to RTR A LAN port
LAN IP address: 10.1.50.1
LAN & WLAN subnet 10.1.50.0/24
Operating mode: Router (also tried Gateway)
SPI Firewall disabled
firewall rules: none added
Desired Behavior of RTR B: All LAN & WLAN connections funneled through WG


Router A:
-------------------------------
Asus RT-AC3100
DD-WRT v3.0-r58881
WAN port address – DHCP from ISP
LAN IP address: 10.1.30.1/24
LAN & WLAN subnet: 10.1.30.0/24
Operating mode: Gateway
SPI Firewall Enabled
Firewall rules:
iptables –t nat –A POSTROUTING –o ‘get_wanface’ –j MASQUERADE
iptables –I FORWARD –s 10.1.0.0/16 –j ACCEPT
Static route: destination 10.1.50.0/24
Static route: gateway addr 10.1.30.2
Desired Behavior of RTR A: ALL LAN @ WLAN connections sent direct to internet


Last edited by pm8587y on Wed Apr 02, 2025 19:07; edited 1 time in total
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6899
Location: UK, London, just across the river..

PostPosted: Tue Apr 01, 2025 9:24    Post subject: Reply with quote
59881 was build pulled out, bad build...the next to it is 59887...after build 60121/60137 firewall behaves different last build is 6523 probably new build is coming...

in general WG guide is here ---> https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 58184 WAP
TP-Link WR1043NDv2 -DD-WRT 61848 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 61915 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x2VLAN,Vanilla
Netgear R7800 --DD-WRT 61915 Gateway/DNSCryptv2,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 61848 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Dynalink DL-WRX36-DDWRT 61745
Broadcom
Netgear R7000 --DD-WRT 61745 Gateway/DNScrypt-proxy2/AD-Block,IPset Firewall,Forced DNS,x4VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13692
Location: Netherlands

PostPosted: Tue Apr 01, 2025 9:50    Post subject: Reply with quote
The second router should be setup in normal gateway mode with its firewall enabled.
_________________
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
pm8587y
DD-WRT Novice


Joined: 19 Mar 2025
Posts: 2

PostPosted: Wed Apr 02, 2025 19:05    Post subject: Reply with quote
I took both suggestions and installed r59887 and left the 2nd router in gateway mode with the firewall enabled, and that resolved the issue.

Many thanks to egc and Alozaros!
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