Table of Contents

OpenWrt configure wireguard

Create VPN server with WireGuard https://www.youtube.com/watch?v=6NIJcsJsRaM

  1. Install packages:

wireguard-tools luci-proto-wireguard kmod-wireguard (should be installed automatically)

  1. ssh to router
$ mkdir /etc/wireguard
$ umask ..
  1. Generate public & private keys

  2. Network-> interfaces Add new interface wg0

  3. Add peers

  4. Configure firewall Network->Firewall Add PortForwarding

  5. reboot

  6. Check Status->Wireguard tab


  1. Configure client

  2. Generate public & private keys

  3. create wg0.conf file

[Interface]
Address = 10.8.0.2/32
PrivateKey = ...
DNS = 8.8.8.8

[Peer]
PublicKey = ...
Endpoint = ISP_PUBLIC_IP_ADDRESS:51820
# 
# Forward all trafic through the VPN, 
# IP address will be VPN 
# Access local resources like 192.168.1.1/24 .. 
#
AllowedIPs = 0.0.0.0/0
# 
# Access only router
#
#AllowedIPs = 10.8.0.0/24
PersistentKeepalive = 15
systemctl enable wg-quick@wg0

To stop/start:

systemctl stop wg-quick@wg0
systemctl start wg-quick@wg0

Interfaces interfaces

Firewall settings firewall_settings

General settings general_settings

Network port forwarding network_port_forwarding

Peers configuration peers_configuration