Ubuntu ultra-fast server deployment wireguard

New out of a lot of people want to try Wireguard,Here VPN over the wall in the end it is appropriate for us to discuss not,Let's look at how fast service from a wireguard on vps。Many people have heard of this service particularly complex to configure,So discouraged,Actually quite simple。

The environment

Here I use the latest ubuntu 18.04.2 To configure,First you have to have a vps,After the best as I created After purchasing a VPS you should spare security measuresConfiguring credentials in ssh access。

installation

wireguard is promising to provide installation package ubuntu,But not integrated in the official source in,So we have to add their own ppa,Then install。

Configuration

Enter the configuration directory cd /etc/wireguard ,Execute the following two commands to generate a key pair:

Open traffic forwarding:

If you want to add the boot,Then:

use ifconfig Commands to view your card information,Found that the use of external network card,If you have multiple,To choose one,Wireguard used to monitor service。

The results you get are as follows:

For example, here's an example,Obviously the name of the card is eth0 ,To remember this,One would use to write configuration。

Directly generate configuration,You can also manually write,But you need to read their own key to the,Note name,Make no mistake。Also highlighted in two block rows,Before we look at the card name,We should write in here,If your card is not eth0 ,Then replace your own manual。

Taking into account all the key pair on the server,Here again the way we generate client configuration:

Note the highlighted lines,The Remote IP into your server's IP。

start up

At this point,Configuration complete!

It's that simple -

Multi-user

First stop service by-quick down wg0

Then generate a new user key pair:

Then add in the server configuration,Note that this is a command,Do not perform Branch:

Note the highlighted lines,The IP network segment to write different,Each "Peer" with a ip,Such as used above is 10.0.0.2,Here with 10.0.0.3,If you need more users,Then so。

Create a client configuration file,And here is the same as above,Just a note with a new key pair,This is also a command,Do not perform Branch:

Then start the service: by-quick up wg0


References:

A high-speed、Safety、canIP is the resurrection of the wallThe VPN - WireGuard server tutorial manual

WIREGUARD toss to build and use a small mind

 

Original article written by Gerber drop-off:R0uter's Blog » Ubuntu ultra-fast server deployment wireguard

Reproduced Please keep the source and description link:https://www.logcg.com/archives/3197.html

Published by R0uter's Blog

The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Join the Conversation

1 Comment

Your email address will not be published. Required fields are marked *