Install Wireguard on Ubiquiti Edgerouter EdgeOS

Wireguard can be installed on Edgerouter systems by Ubiquiti. You may need to fiddle a little bit in order to get it working due to some missing functionality. This guide will help you set it up on your EdgeOS device and how to configure it.

Where to download Wireguard

You can get an EdgeOS build for Wireguard by going here. Here, you will find a list of supported devices and their model numbers. You will then download the corresponding Debian package file according to your router under Assets.

In this case, I will be using wireguard-e100.deb file which is for the Edgerouter Lite(model E100). You’ll need to download this file to your Edgerouter by using curl, since wget is not available:

curl -O

This will place the package in your default home folder. Now we are ready to install Wireguard.


You are now going to use the dpkg program to install the deb package that we’ve just downloaded:

sudo dpkg -i wireguard-e100-0.0.20191219-2.deb

At this point, Wireguard should be ready for configuration. We are now going to add an interface to our Edgerouter with this:

sudo ip link add dev wg0 type wireguard

After, lets add an IP address for the router’s Wireguard interface:

sudo ip addr add dev wg0

Generate the needed keys to use for our Wireguard connection:

sudo wg genkey | tee privatekey | wg pubkey > publickey

You will then create your wg0.conf file and add in the following to it:

PrivateKey = The contents of your privatekey file here.
ListenPort = 51820

PublicKey = The contents of your publickey file here.
AllowedIPs = the IP of your Wireguard server/peer's interface)
Endpoint = Wireguard server/peer IP and port goes here.

Once you’re finished setting up your config, run the following:

sudo wg setconf wg0 /home/$USER/wg0.conf

When ready, turn on Wireguard by running this command:

sudo ip link set up dev wg0

On EdgeOS, Wireguard doesn’t configure the routes automatically. They will all need to be manually configured using the ip route command. Go ahead and add in the following route(s) for both our peer and local:

sudo ip route add dev wg0 && sudo ip route add dev wg0

You will need to do this for any additional network that you’ll want to access.


If your Edgerouter is the server and you would like to give clients access to its network, you will need to configure NAT. To be specific, NAT should be configured for masquerading on wg0 if the client, other interface(s) if the server.

Bash script

Wireguard doesn’t automatically start or save the configuration prop on EdgeOS, as there is no wg-quick program to work with. An alternate solution would be to create a script and make it run at boot. Add the following to the script:


/bin/ip link add dev wg0 type wireguard
/bin/ip addr add dev wg0
/usr/bin/sudo /usr/bin/wg setconf wg0 /home/$USER/wg0.conf
/bin/ip link set up dev wg0
/bin/ip route add dev wg0
/bin/ip route add dev wg0
/bin/ip route add dev wg0
/usr/bin/sudo /sbin/ifconfig wg0 mtu 1300

Full paths will need to be used in order for everything to work properly. Make this script and executable with chmod +x and place it in the /config/scripts/post-config.d/ folder.


If you’re having problems accessing anything at the other end of the peer, set the MTU for the Wireguard interface on both ends to 1300 with this:

sudo ifconfig wg0 mtu 1300

This should solve any issues that you might have with TCP connections.

56 thoughts on “Install Wireguard on Ubiquiti Edgerouter EdgeOS”

  1. Pingback: Google

  2. Pingback: online pharmacies

  3. Pingback: canadianpharmacy

  4. Pingback: weruybsd.fireblogz.com39575666four-issues-to-do-immediately-about-online-pharmacies

  5. Pingback:

  6. Pingback: canadian pharmacys

  7. Pingback:

  8. Pingback:

  9. Pingback:

  10. Pingback:

  11. Pingback: canadian pharmacy viagra brand

  12. Pingback:

  13. Pingback:

  14. Pingback:

  15. Pingback: canadian pharcharmy online

  16. Pingback:

  17. Pingback:

  18. Pingback:

  19. Pingback:

  20. Pingback: kerbiss.wordpress.com2022042714

  21. Pingback: top rated online canadian pharmacies

  22. Pingback: sernert.estranky.skclankyconfidential-information-on-online-pharmacies.html

  23. Pingback: canada medication

  24. Pingback:

  25. Pingback: canada pharmacies

  26. Pingback:

  27. Pingback: canadadrugs

  28. Pingback:

  29. Pingback:

  30. Pingback: kerntyas.gonevis.comthe-mafia-guide-to-online-pharmacies

  31. Pingback:

  32. Pingback:

  33. Pingback:

  34. Pingback: best canadian pharmacy

  35. Pingback:

  36. Pingback:

  37. Pingback:

  38. Pingback:

  39. Pingback: canadian rx world pharmacy

  40. Pingback: canadian pharmacies online

  41. Pingback:

  42. Pingback:

  43. Pingback:

  44. Pingback:

  45. Pingback: canada drugs online

  46. Pingback:

  47. Pingback: uertbx.livejournal.com402.html

  48. Pingback:

  49. Pingback:

  50. Pingback:

  51. Pingback: cialis canadian pharmacy

  52. Pingback: canadian drug

  53. Pingback: canadian pharmacy meds

  54. Pingback:

  55. Pingback: lasert.gonevis.comrecommended-canadian-pharmacies-2

  56. Pingback:

Comments are closed.