Idiot's Guide to Configuring Wireguard - Client Tunnel

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
davood.1983
DD-WRT Novice


Joined: 17 Aug 2019
Posts: 8

PostPosted: Sun Aug 18, 2019 8:24    Post subject: Reply with quote
Hellakenut wrote:
Did you see marbius's post on page 2? His version of DD-WRT also didn't support curl and this was his solution:

marbius wrote:
This DD-WRT version (Firmware: DD-WRT v3.0-r37305 std ( 10/10/18 ) does not support curl ssh commands, so for the putty commands I just had to put the command line in the windows command prompt and it gave me the IP.


This is assuming you have a Windows PC to test this. I tried it just now and it worked for me. If you don't have curl already installed, here's an install tutorial:

https://develop.zendesk.com/hc/en-us/articles/360001068567-Installing-and-using-cURL#install

Also, did you try part 2-B of the Wireguard guide? It's a workaround specifically for the off-chance that you can't get an IP with your public key. Even if curl worked, sometimes you won't get a response from Mullvad because their servers are down or something.



Dear Hellakenut Hi!! Smile Smile
Finally I Use this command in power shell to get ip from Mullvad
here you are
curl.exe https://api.mullvad.net/wg/ -d account=xxxxxxxxxxxxxxxx --data-urlencode pubkey=lRqGzRVEfFxtAM1KsNCidR0UdEs0qMA6Pzx8122Slz8=

just added curl.exe at the first and before all this I enabled developer mode
now it's Okay and I'm able to use mullvad servers in my router

thank you so much for your help Surprised Cool
Sponsor
Hellakenut
DD-WRT Novice


Joined: 22 Mar 2019
Posts: 27
Location: Gamma Quadrant

PostPosted: Sun Aug 18, 2019 8:31    Post subject: Reply with quote
Great! Glad it worked for you. Very Happy
davood.1983
DD-WRT Novice


Joined: 17 Aug 2019
Posts: 8

PostPosted: Sun Aug 18, 2019 8:57    Post subject: Reply with quote
Hellakenut wrote:
Great! Glad it worked for you. Very Happy


Thank You My dear friend

Best regards from Iran
davidm71
DD-WRT Novice


Joined: 12 Dec 2010
Posts: 41

PostPosted: Wed Sep 11, 2019 0:08    Post subject: Did Wrt also run as Wireguard server? Reply with quote
Hi,

Love the tutorial but have to apologize for my noobiness and wonder can DDWrt run as a Wireguard Server? And if so how do you do it?

Thank you
Hellakenut
DD-WRT Novice


Joined: 22 Mar 2019
Posts: 27
Location: Gamma Quadrant

PostPosted: Wed Sep 11, 2019 0:30    Post subject: Reply with quote
As far as I know, yes it is possible to set up a Wireguard server in DD-WRT. Unfortunately, doing that is beyond the scope of this guide and my own knowledge, so I personally can't help you with that specific setup. Sad Since this guide was meant to be a client setup tutorial, I'm not sure how much the info here will aid with a server setup.

However, in one of the topics I linked, ersterhernd referred to the following guide for setting up his Wireguard server. Albeit, it's rather vague and assumes you know your way around a Linux terminal to do the tasks (you must also know how to incorporate this information with DD-WRT):

https://www.ckn.io/blog/2017/11/14/wireguard-vpn-typical-setup/

Maybe you'll have some luck with it!
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 1441
Location: WCentral Indiana USA

PostPosted: Wed Sep 11, 2019 0:35    Post subject: Reply with quote
Your router/build will need wireguard at .../eop-tunnel.asp to use this.

https://wiki.dd-wrt.com/wiki/index.php/The_Easiest_Tunnel_Ever

also https://wiki.dd-wrt.com/wiki/index.php/Wireguard

_________________
STUBBY DoT install guide----Forum Guide Lines (Please read!) --- How to get help the right way
davidm71
DD-WRT Novice


Joined: 12 Dec 2010
Posts: 41

PostPosted: Wed Sep 11, 2019 0:58    Post subject: Reply with quote
Hellakenut wrote:
As far as I know, yes it is possible to set up a Wireguard server in DD-WRT. Unfortunately, doing that is beyond the scope of this guide and my own knowledge, so I personally can't help you with that specific setup. Sad Since this guide was meant to be a client setup tutorial, I'm not sure how much the info here will aid with a server setup.

However, in one of the topics I linked, ersterhernd referred to the following guide for setting up his Wireguard server. Albeit, it's rather vague and assumes you know your way around a Linux terminal to do the tasks (you must also know how to incorporate this information with DD-WRT):

https://www.ckn.io/blog/2017/11/14/wireguard-vpn-typical-setup/

Maybe you'll have some luck with it!


I appreciate your reply. Seems like a complicated process. All the guides I could find are for client setups but I would like to run a Windows Server behind the vpn and have clients access that server . Will have to research this. Thanks.
so333
DD-WRT Novice


Joined: 05 Apr 2018
Posts: 13

PostPosted: Fri Sep 27, 2019 10:29    Post subject: Reply with quote
davidm71 wrote:
Seems like a complicated process. All the guides I could find are for client setups but I would like to run a Windows Server behind the vpn and have clients access that server . Will have to research this.


That is not complicated at all, just follow the above mentioned link: https://wiki.dd-wrt.com/wiki/index.php/The_Easiest_Tunnel_Ever.

The main issue is that the integration seems not to be further supported or developed by the DD-WRT team, i.e., the performance of the Wireguard server is underwhelming in contrast to OpenVPN, and there is no status or dedicated logging mechanism for the Wireguard connections Crying or Very sad
cmer
DD-WRT Novice


Joined: 05 Nov 2019
Posts: 2

PostPosted: Tue Nov 05, 2019 15:41    Post subject: Reply with quote
Thanks a lot for the guide. I am really struggling to get this to work with my own server instead of Mullvad...

Any idea what might be wrong? Traffic doesn't seem to get routed through Wireguard. (ie: can't ping, it just hangs)

Iptables: https://gist.github.com/cmer/b39cf395ac85c829a73907ecf6896ac6

Slightly modified custom.sh script to support dynamic DNS hostnames instead of IPs: https://gist.github.com/cmer/4ec912134758a0bac54ea65a22d29c5e

Code:
wg showconf oet1

Code:

[Interface]
ListenPort = 51820
PrivateKey = g-----------------------------------=

[Peer]
PublicKey = F-------------------------------=
PresharedKey = 1----------------------------------=
AllowedIPs = 0.0.0.0/0
Endpoint = ip-to-wg-server:51820
PersistentKeepalive = 25
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6361
Location: Netherlands

PostPosted: Thu Nov 28, 2019 9:32    Post subject: Reply with quote
For all of you who want to use Wireguard as a server (actually it is a peer to peer protocol and the role of server or client is only defined by the routing and IP tables rules (well perhaps the use of an endpoint))

I am working on a setup guide, see:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=322206

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Hellakenut
DD-WRT Novice


Joined: 22 Mar 2019
Posts: 27
Location: Gamma Quadrant

PostPosted: Sun Dec 01, 2019 19:56    Post subject: Reply with quote
Thanks, egc! Very Happy I'll add a link to your topic at the top of my guide since a few people looking for server setups have been drawn to this thread.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 6361
Location: Netherlands

PostPosted: Thu Dec 05, 2019 11:24    Post subject: Reply with quote
I am currently working on a PBR script for Wireguard which can be used when you are setting up DDWRT as a Wireguard client.

If you are interested have a look at the third post of this thread: https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135

It is still in Alpha state

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
OpenVPN Policy Based Routing: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Wireguard Server setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1183135
Wireguard Client setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324624
Wireguard Advanced setup guide:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324787
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
saucier
DD-WRT Novice


Joined: 18 Mar 2020
Posts: 1

PostPosted: Thu Mar 19, 2020 13:22    Post subject: Reply with quote
Have never tinkered with the router except for GUI settings.

Followed your guide. Upgraded to latest dd-wrt (never done this before either).

Worked first time. Thank you!
Hellakenut
DD-WRT Novice


Joined: 22 Mar 2019
Posts: 27
Location: Gamma Quadrant

PostPosted: Wed Mar 25, 2020 15:47    Post subject: Reply with quote
Glad to hear it! Wireguard functionality continues to be going strong on my end as well.

I went ahead and made some updates to the guide. Mullvad has switched up their website's UI a bit, so the screenshots for generating Wireguard config files are now current.
tembares
DD-WRT Novice


Joined: 10 Jul 2012
Posts: 26
Location: Sint Maarten, D.W.I

PostPosted: Wed Apr 01, 2020 14:14    Post subject: Use of 'downloaded file' Reply with quote
Good day,

Thank you for your time to make the script. Although it doesn't work for me yet (I want to use TunSafe) I am still busy editing to find the issue.

That made me come up with this suggestion, to make it dummy-proof.
Is it an idea to copy/paste the results of the downloaded file like below into your script, so that the values are taken into the setup easily?

Downloaded file like:
[Interface]
PrivateKey = i...=
Address = 10.110.209.100/8
DNS = 1.1.1.1

[Peer]
PublicKey = F...=
Endpoint = 190.2.141.162:51840
AllowedIPs = 0.0.0.0/0

Thank you in advance. Maybe I am coming back for answers from you all Very Happy
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 3 of 6
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum 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