Yes, enabling the AmneziaWG protocol on an already deployed AmneziaVPN self-hosted server requires specific steps. While AmneziaWG is based on WireGuard, it includes additional obfuscation features, and its setup involves more than just switching protocols. Here's a comprehensive guide:
Before proceeding, ensure your server meets these requirements:
amnezia --version
.Verify your server details by connecting via SSH:
ssh user@your-server-ip -p port-number
Then, check your OS version, RAM, and virtualization:
lsb_release -a
free -h
systemd-detect-virt
Ensure your system is up-to-date:
sudo apt update
sudo apt upgrade -y
AmneziaWG is based on WireGuard but includes enhanced obfuscation. Here are the steps to install it:
sudo apt install -y wireguard-tools git
git clone https://github.com/Amnezia-vpn/amnezia-wg.git
cd amnezia-wg
sudo bash install.sh
This script handles the installation of necessary drivers and configurations.
Allow traffic routing:
sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl -w net.ipv6.conf.all.forwarding=1
Reboot your system to apply changes:
sudo reboot
After installation, generate the main AmneziaWG configuration files:
sudo mkdir /etc/amnezia-wg
sudo bash generate-config.sh
sudo bash generate-client-configs.sh
Edit the main configuration file to add new clients:
sudo nano /etc/amnezia-wg/config.yaml
sudo bash generate-client-configs.sh
Start the AmneziaWG tunnel interface:
sudo wg-quick up amnezia-wg
Check the status:
sudo wg show
Alternatively, you can enable AmneziaWG by modifying the AmneziaVPN configuration directly:
cd /opt/amnezia
nano /opt/amnezia/config/protocols.json
If it doesn't exist, add the following block:
{
"protocol": "AmneziaWG",
"enabled": true,
"port": 51820,
"obfuscation": true
}
port
: The UDP port used by AmneziaWG. Ensure this port is open in your firewall.obfuscation
: Set to true
to enable traffic obfuscation.systemctl restart amnezia
systemctl status amnezia
Ensure the necessary ports are open in your firewall. AmneziaWG typically uses UDP port 51820.
Check existing rules:
ufw status
Allow UDP traffic on port 51820:
ufw allow 51820/udp
Reload firewall rules:
ufw reload
scp /etc/amnezia-wg/client-configs/my_amneziawg_client1.conf user@client-machine:/path/to/config
On your client machine, use the WireGuard client to connect to the AmneziaWG server:
wg-quick up my_amneziawg_client1
Alternatively, you can generate a configuration file or QR code from the AmneziaVPN client, then import it on your device.
To confirm AmneziaWG is working correctly:
journalctl -u amnezia
Look for entries indicating successful connections.
apt update && apt install amnezia -y
Enabling the AmneziaWG protocol on your self-hosted AmneziaVPN server involves ensuring compatibility, installing necessary packages, configuring the protocol, and setting up client connections. This process ensures a secure and obfuscated VPN connection.
For further assistance, consult the Amnezia Documentation.