Wireguard endpoint DDNS

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page 1, 2  Next
Author Message
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 4:56    Post subject: Wireguard endpoint DDNS Reply with quote
There seems to be a bug with the endpoint field.

I've entered my DDNS address and DDWRT accepts it, yet when I scan the QR code with my phone, the config still has my WAN IP.

_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Apr 12, 2021 11:16    Post subject: Re: Wireguard endpoint DDNS Reply with quote
unknownsoldierx wrote:
There seems to be a bug with the endpoint field.

I've entered my DDNS address and DDWRT accepts it, yet when I scan the QR code with my phone, the config still has my WAN IP.


I am not sure what you are doing.

You scan the QR code on the WireGuard server for that particular peer, there is no endpoint for a servers peer that is when you setup a WireGuard client not a servers peer.

A servers peer has no endpoint.

The QR code makes an endpoint to reach your server which is the servers WAN IP address.
Of course that is not always right ( I have an internal server ) or you do not want the WAN ip address if you have a dynamically allocated IP address and so you have to adapt it to your liking as described in the documentation 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
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 17:00    Post subject: Reply with quote
This is a working config I'm trying to input into DDWRT.

I'm supposed to put mydyndnsaddress.net into the 'Endpoint Address' field for the my peer, right?

Code:
[Interface]
Address = 192.168.12.2/24
ListenPort = 51820
PrivateKey = [key]
DNS = 192.168.11.1

[Peer]
PublicKey = [key]
PresharedKey = [key]
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = mydyndnsaddress.net:51820



_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Apr 12, 2021 17:17    Post subject: Reply with quote
See my signature at the bottom for Wireguard documentation.

Not sure what you want, if you are setting up a server on your router to connect with your phone to then see the server setup guide.

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


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 17:22    Post subject: Reply with quote
What is the function of the 'Endpoint Address' field under each peer?
_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Apr 12, 2021 17:36    Post subject: Reply with quote
If you set up your ddwrt router as a wireguard client e.g. to connect to your VPN provider then that is the address of the server of the VPN provider.

See the wireguard client setup guide.

It really is in the documentation.

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


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Apr 12, 2021 17:39    Post subject: Reply with quote
@egc said it, but I'll say it again so he doesn't have to. The Endpoint is for the server IP when you are setting up a client. I use wireguard as a client to connect to an AzireVPN server, so I put the IP of their server in that spot. For a server, which you seem to be trying to set up, you leave the field empty.

Notice there are no server and client buttons in the dd-wrt wireguard setup. Wireguard is inherently symmetric. So all the fields you'd need for either application are there. Some will stay empty.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 18:07    Post subject: Reply with quote
I have the DDWRT Wireguard server, and I have clients that connect to it. How do I make the QR codes in DDWRT tell my clients to connect to DDNS address (mydyndnsaddress.net) instead of my WAN IP?
_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Apr 12, 2021 18:16    Post subject: Reply with quote
unknownsoldierx wrote:
I have the DDWRT Wireguard server, and I have clients that connect to it. How do I make the QR codes in DDWRT tell my clients to connect to DDNS address (mydyndnsaddress.net) instead of my WAN IP?

I use the iOS wireguard app in my phone, and once it's set up with the QR code, I just push the edit button and edit the configuration a little. I replace the Endpoint IP address (in the phone!) with the foo.bar.com domain name that the DDNS has made point to dd-wrt's actual IP address. Works great.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 18:22    Post subject: Reply with quote
SurprisedItWorks wrote:
I use the iOS wireguard app in my phone, and once it's set up with the QR code, I just push the edit button and edit the configuration a little. I replace the Endpoint IP address (in the phone!) with the foo.bar.com domain name that the DDNS has made point to dd-wrt's actual IP address. Works great.


But you previous wrote:

Quote:
The Endpoint is for the server IP when you are setting up a client.


What can't we enter 'foo.bar.com' there so we don't have to manually edit the config on our devices?

_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12877
Location: Netherlands

PostPosted: Mon Apr 12, 2021 18:27    Post subject: Reply with quote
You cannot, you have to do that manually (click on the pencil in the WG interface on your phone).

It really is outlined in the server setup guide page 6.

(Thanks @Surpriseditworks could not have formulated it any better 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
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 18:33    Post subject: Reply with quote
I'm aware that we can't because DDWRT doesn't currently work that way. The entire point of this thread is that it could/should work that way.

Is there any reason why it shouldn't?

_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Apr 12, 2021 19:34    Post subject: Reply with quote
There's a good reason: because Endpoint IP always means the IP of the OTHER END of the connection from where we are editing.
_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
unknownsoldierx
DD-WRT User


Joined: 21 Dec 2007
Posts: 80

PostPosted: Mon Apr 12, 2021 22:44    Post subject: Reply with quote
Not sure why where the editing takes place matters.

The endpoint for my peers would be my router. The QR code is already passing along my WAN IP to those peers, so why shouldn't there be an option to take DDNS into account and have the QR code pass that address along instead?

_________________
Netgear R7800
DD-WRT v3.0-r51011 std (12/12/22)
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1447
Location: Appalachian mountains, USA

PostPosted: Mon Apr 12, 2021 23:05    Post subject: Reply with quote
Getting outside my knowledge zone a bit here, but I believe the QR code for this is a part of the wireguard standard and not something the dd-wrt implementers have that level of control over. In our example, both dd-wrt and the WireGuard iOS/Android app would have to have shared knowledge of how this information is encoded. So talk to the WireGuard project I suppose. Keep in mind that part of the WireGuard philosophy is minimalism, not loading the system with all sorts of bells and whistles. It's why the wireguard code is about 1% the length of the OpenVPN code.
_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
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