Widget HTML Atas

Konfigurasi wireguard server mikrotik-v7 dan wireguard client pada ubuntu

Create new interface wireguard1 seperti gambar dibawah ini:

 


 

Lalu setting IP address pada interface wireguard1 seperti gambar di bawah ini:


Lalu Setting Peer di sisi mikrotik sebagai server 

1. Paste Public key Ubuntu ke Mikrotik
2. Setting Allowed Address = {IP VPN CLIENT UBUNTU}



install wireguard client ubuntu

1. apt install wireguard
2. cd /etc/wireguard
3. umask 077
4. wg genkey | tee privatekey | wg pubkey > publickey
   #berfungsi generate sekaligus private dan public key

5. nano wg0.conf
   insert sciprt

[Interface]
PrivateKey = {isi private key dalam linux}
Address = 10.31.95.2/32

[Peer]
Publickey = {isi public key dari mikrotik}
Endpoint = {ip public:13231}
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 10






6. wg-quick up wg0

Setting auto startup vpn wireguard

1. nano /etc/rc.local
    insert script dibawah ini:

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

wg-quick up wg0

exit 0

2. chmod +x /etc/rc.local