DEV Community

Getting Started with WireGuard

Miguel on April 05, 2020

WireGuard is a relatively new VPN tunnel protocol that aims to be very fast and easy to setup. It follows the Unix Philosophy closely in that it on...
Collapse
 
atrull profile image
Alex Trull

Great analysis of the steps involved. I absolutely love Wireguard.

If you're interested in integrating wireguard with an existing aws infra I recommend looking at the terraform module github.com/jmhale/terraform-aws-wi... (I made some contributions to this).

Collapse
 
oshanwisumperuma profile image
Oshan Wisumperuma

thanks for the comprehensive article @miguelmota . I tried server setup using ansible scripts(algo). it take few minutes to setup the server configurations. I was looking for something fast so I can dispose the server instance and re create quickly whenever I want. this shell script just do the job
github.com/angristan/wireguard-ins...

Collapse
 
zaffacy profile image
Zafar Karimov

Experiencing problem with CORS headers. It says:
Access to XMLHttpRequest at '' from origin 'https://drive.google.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Anybody experienced such problem?

Collapse
 
shawnngtq profile image
Shawn Ng • Edited

@miguelmota

Nice tutorial, I managed to set it up.

I noticed that despite the IP address shows the correct server IP (via ipchicken.com/), I am still unable to bypass my country's firewall, and Google home page still display my home country instead of the server's country. Am I missing something?

Collapse
 
prashanthmgvr profile image
Prashanth Mogaveera

Great Blog!!

I was able to setup the till wg-quick up wg0. When I ran systemctl status wg-quick@wg0.service getting error as systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

Any Idea what might be the reason here? I'm not able to get the logs for wireguard. Any help would be appreciated!

Collapse
 
jeffprod profile image
JeffProd

Great article. Some suggestions :

In "Generating client keys", you wrote:

[root@archlinux ~]# mkdir /etc/wireguard/keys
[root@archlinux ~]# umask 077
...
[root@archlinux keys]# wg genkey | tee privatekey | wg pubkey > publickey

you missed "cd /etc/wireguard/keys"

In "Starting WireGuard service on server", when i type on Ubuntu "wg-quick up wg0" I had the error "RTNETLINK answers: Operation not supported".
If it helps, the solution found on StackOverflow is "apt-get install wireguard-dkms wireguard-tools linux-headers-$(uname -r)"

Collapse
 
miguelmota profile image
Miguel

The post has the corrections and error solution now. Thanks!

Collapse
 
rizowski profile image
Rizowski

This is the longest most extensive article that doesn't just end before the point is made. Well done. I applaud the effort. 👍👏

Collapse
 
starpebble profile image
starpebble

Fantastic quick start. My little feedback: Looks like connecting is the most fun part. 😇

Collapse
 
greenteabiscuit profile image
Reishi Mitani

Thanks so much for the great tutorial! I was able to connect my raspberry pi and my EC2 instance from your instructions.
I had a bit of problems with the modules but it worked out fine in the end.

Collapse
 
artis3n profile image
Ari Kalfus

I would also recommend tailscale.com/ to abstract away the wireguard internals. Makes it really simple for the everyday person.

Collapse
 
hamza1006 profile image
Hamza1006

Hello
Please you can install WireGuard in my cloud AWS I will pay you
Please help me !

Collapse
 
ahmedfarag36_33 profile image
Ahmed-farag36

Great post thank you
What about the reversed process, I want to access my local computer from internet through the tunnel
Should I use server configuration in my local computer?