wg-easy Deployment Tutorial

881 Views
No Comments

A total of 1357 characters, expected to take 4 minutes to complete reading.

What is wg-easy?

wg-easy can easily configure the wireguard server
Features:
All-in-One: WireGuard Web UI
Simple to install, simple to use
List, create, edit, delete, enable, and disable clients
Display the customer's QR code
Download the client's configuration file
Statistics for connected clients
Display Tx/Rx chart for each connected client

Github download address

GitHub - wg-easy/wg-easy: The easiest way to run WireGuard VPN Web-based Admin UI.

Install wg-easy using Docker

Preparations before installation

Load the specified module on the local system first
modprobe ip_tables && modprobe iptable-nat

Note: This method will become invalid after each restart. The following methods will take effect permanently.

# 在 /etc/sysconfig/modules/ 下创建个 xxx.modules 文件
touch /etc/sysconfig/modules/iptables.modules
# 然后设置 755 权限
chmod 755 /etc/sysconfig/modules/iptables.modules

The document reads as follows:

#!/bin/sh
modprobe ip_tables
modprobe iptable-nat

Docker Run

Run the docker container:

docker run -d \
  --name=wg-easy \
  -e WG_HOST=🚨YOUR_SERVER_IP \
  -e PASSWORD=🚨YOUR_ADMIN_PASSWOR \
  -e WG_DEFAULT_ADDRESS=10.0.0.x \
  -e WG_DEFAULT_DNS=114.114.114.114 \
  -e WG_PERSISTENT_KEEPALIVE=30 \
  -e WG_ALLOWED_IPS=10.0.0.0/24 \
  -v ~/.wg-easy:/etc/wireguard \
  -p 51820:51820/udp \
  -p 51821:51821/tcp \
  --cap-add=NET_ADMIN \
  --cap-add=SYS_MODULE \
  --sysctl="net.ipv4.conf.all.src_valid_mark=1" \
  --sysctl="net.ipv4.ip_forward=1" \
  --restart=always \
  weejewel/wg-easy

Must be modified:
WG_HOST=xxxIt needs to be modified to the external network IP of the server, which can be https://ip138.com/queried.
PASSWORD=xxxSet password for management wg-easy
Optional modifications:
WG_DEFAULT_ADDRESS=and WG_ALLOWED_IPS= It can be modified to wireguard the IP segment of the local area network, such192.168.1.x192.168.1.0/24

Enter the webpage management page

Access after successfully running docker http://xxx:51821 You can enter the corresponding management page (xxx is the IP of the intranet where you deploy the service or the address of the configured WG_HOST)

wg-easy Deployment Tutorial

Enter the password just configured here to enter

wg-easy Deployment Tutorial

Click New in the upper right corner to create a new client configuration

wg-easy Deployment Tutorial

After creation, you can click this to download the configuration file.

Update wg-easy

docker stop wg-easy
docker rm wg-easy
docker pull weejewel/wg-easy

Connect to wireguard

wg-easy Deployment Tutorial

windows use the client to import the configuration to connect

END
 0
Comment(No Comments)
验证码
en_USEnglish