DDWRT & Wireguard - WAN Access Server Setup

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


Joined: 01 Dec 2016
Posts: 15

PostPosted: Mon Jul 19, 2021 10:53    Post subject: DDWRT & Wireguard - WAN Access Server Setup Reply with quote
I have a DD-WRT router at home set up as a Wireguard server, which I am trying to access via WAN. Router sits behind my ISP's modem which forwards port 51820, and the client connects to a DDNS address since my IPS's IP is dynamic, resulting in the following setup

DD-WRT Router <> ISP Modem (Port Forward) <> Internet <> Client

Now, from he client I can connect and send data to the Server, but am unable to receive anything. The ISP modem has port-forwarding for UDP 51820 enabled and the WireGuard configuration file is a 1:1 copy from my Ubuntu server where things work just fine. If I were to hazard a guess, I'd say there is either a Firewall issue / IP Address conflict / DD-WRT Tunnel issue that prevents the router from sending out traffic to the client.

Configuration as follows:

DD-WRT Router:
DD-WRT v3.0-r40559 std (08/06/19)
D-Link DIR 868L
LAN IP: 192.168.0.1
WAN IP: 10.0.0.3

WireGuard Server
Code:
[Interface]
ListenPort = 51820
PrivateKey = <PRIVATE_KEY> 

[Peer]
PublicKey = <CLIENT_PUBLIC_KEY>
PresharedKey = U8PSn4PxYzg1l6FGMmIfkMpHHb6s7v06RDk8m1oSP4w=
AllowedIPs = 10.66.66.2/32
Endpoint = xxx.xxx.xxx.xxx:51820  # This is my clients dynamic IP, it appears automatically, I did not set this
PersistentKeepalive = 25


Please note that the Endpoint is something that cannot be configured in the DDWRT GUI, I don't know where that one comes from but it is in fact the ISP assigned IP of my client.

Client
Code:
[Interface]
PrivateKey = <CLIENT_PRIVATE_KEY>
ListenPort = 51820
Address = 10.66.66.2/32
DNS = 8.8.8.8
MTU = 1420 

[Peer] PublicKey = <SERVER_PUBLIC_KEY>
PresharedKey = U8PSn4PxYzg1l6FGMmIfkMpHHb6s7v06RDk8m1oSP4w=
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = my.ddns.address.com:51820
PersistentKeepalive = 25


Long story short, can someone kindly help me with the following:

    How can I check whether my WireGuard connection on port 51820 is SENDING data?
    How can I open UDP traffic on port 51820 and allow it to be sent to any external IP?
    How do I configure my IPTABLES firewall to allow the above traffic?


Appreciate any help with this, its been a few days now and I cannot seem to figure this out...

Thanks
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12917
Location: Netherlands

PostPosted: Mon Jul 19, 2021 11:21    Post subject: Reply with quote
Your DDWRT version is old, bad, deprecated and has security issues.

Step up to a recent build as of now we are using 47040.

DDWRT WireGuard documentation see the link in my signature at the bottom, have a look at the WireGuard Server setup guide.

Other then a port forward on your ISP router (or placing it in the DMZ) and following the setup guide nothing else should be necessary Smile

To get the best out of DDWRT and the forum read the forum guidelines with helpful pointers:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087

Edit: we are actually now on build 47073

_________________
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
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Mon Jul 19, 2021 11:27    Post subject: Reply with quote
Would be helpful to know which revision of DIR-868L. I second not using 40559, had I noticed that information when I was re-sizing your obnoxiously huge image, I would've just deleted the post. We do not wish to entertain discussion or support r40559 in this forum.

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/07-12-2021-r47040/dlink-dir868l-reva/

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/07-12-2021-r47040/dlink-dir868l-revb/

https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2021/07-12-2021-r47040/dlink-dir868l-revc/

47073 was released today as well.

Please flash an report in the appropriate forum thread. Thank you.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
patrickmau
DD-WRT Novice


Joined: 01 Dec 2016
Posts: 15

PostPosted: Mon Jul 19, 2021 11:56    Post subject: Reply with quote
Quote:
I second not using 40559, had I noticed that information when I was re-sizing your obnoxiously huge image, I would've just deleted the post. We do not wish to entertain discussion or support r40559 in this forum.


Always love attitudes like this, really helps a lot in finding out whats wrong here and what I should do. Especially the "I would have just deleted your post without telling you why" bit is really good to know, thanks a lot.


Quote:
Your DDWRT version is old, bad, deprecated and has security issues.

Step up to a recent build as of now we are using 47040.

DDWRT WireGuard documentation see the link in my signature at the bottom, have a look at the WireGuard Server setup guide.

Other then a port forward on your ISP router (or placing it in the DMZ) and following the setup guide nothing else should be necessary Smile


Thank you egc, will get my router updated ASAP and see how things go then. Appreciate you pointing me in the right direction. Cheers.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Mon Jul 19, 2021 13:02    Post subject: Reply with quote
And we still have no clue which version of DIR-868L you have. Please refer to the forum rules and guidelines, and re-read the router database landing page in it's entirety, including the disclaimer.

P.S. I would've PM'ed you if I had gone to that extreme of deleting your post. Sarcasm does not translate well in text.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
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