WireGuard VPN
WireGuard is a modern VPN (Virtual Private Network) technology that utilizes state-of-the-art cryptography. It is designed to be faster, simpler, and more functional than IPsec and OpenVPN. WireGuard is a secure, fast, and easy-to-configure VPN solution that uses cutting-edge cryptography. It is designed to be simpler to configure than OpenVPN and to offer a lower attack surface.
NethSecurity provides a WireGuard server and client that can be configured from the web interface.
Features:
- Multiple WireGuard server instances can run simultaneously
- Each instance operates in its own isolated network zone
- Static IP address allocation for each peer (client account)
- Client configuration available as text file or QR code
- Site-to-site (net2net) connections supported
- Enhanced security with optional pre-shared keys
- Standard WireGuard configuration file import capability
Server Configuration
It's possible to create multiple WireGuard server instances, each with its own isolated network zone. NethSecurity will automatically open the necessary firewall ports to allow incoming connections to the WireGuard server and create a VPN zone to allow management of how the traffic is routed between zones.
On the contrary of the OpenVPN server, there's no ties to the users database, accounts (peers) are created and managed directly inside the WireGuard interface.
To create a WireGuard server, click on Add server, then fill the form with the desired configuration. The fields are the following:
Status: enable or disable the WireGuard server instanceName: the name of the WireGuard server instance, this is not the name of the network interface, it will be automatically created aswgX, whereXis a numberVPN network: the network CIDR that will be used by the WireGuard server, the server will automatically get the first IP of the network. Make sure this network does not overlap with any existing oneUDP port: the port on which the WireGuard server listens for incoming connectionsPublic endpoint: the public IP address or FQDN of the server
Under advanced settings, it's possible to configure additional options:
MTU: to manually set the MTU of the WireGuard interfaceDNS servers: to set custom DNS servers that will be pushed to the clients, useful to avoid DNS leaks
After creating the server, it's possible to add new clients (peers) directly from the WireGuard interface, click Add peer and fill the form as the following:
Status: enable or disable the peerName: the name of the peerReserved IP: the static IP address that will be assigned to the peer, must be inside the VPN network, it will be pre-filled with the next available IPPre-shared key: if enabled, a pre-shared key will be automatically created to enhance securityRoute all traffic: if enabled, when the client connects, it will send all the traffic to the serverServer networks: which networks the peer can access, all LAN networks will be automatically addedPeer networks: networks reachable on the peer side. Always fill this field when you want to create a net2net tunnel
It's possible to create a client-to-site (Road Warrior) connection by leaving empty the Peer networks entries. This will allow the client to access the server networks.
Once the peer is saved, it's possible to download the configuration file in text format or as a QR code using the menu on the right side of the peer entry.
The server and peers configuration can be edited by the context menu on the right side of each entry.
After modifying the WireGuard server or peers, remember that such changes needs to be applied to the peer by re-downloading the configuration file.
Tunnel Configuration
Nethsecurity can be configured as a WireGuard client (peer) to connect to another WireGuard server. On the Peer tunnels tab, it's possible to add manually a new tunnel by clicking on Add peer tunnel or import a generic wireguard configuration file using Import peer tunnel.
When manually adding a new tunnel, the following fields are available:
Status: enable or disable the tunnelName: the name of the tunnel, this is not the name of the network interface, it will be automatically created aswgX, whereXis a numberReserved IP: the static IP address that the tunnel will useServer public key: the public key of the WireGuard serverPeer private key: the private key of the tunnelPre-shared key: the pre-shared key, if used, field is optionalRoute all traffic: if enabled, all the traffic will be routed through the tunnelNetwork routes: networks made available through the tunnelEndpoint: the public IP address or FQDN of the WireGuard serverUDP port: the port on which the WireGuard tunnel will connect toDNS servers: custom DNS servers to be used when the tunnel is active
Debug
By default, WireGuard does not log anything. To enable logging on /var/log/messages, use the following commands:
echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control
To disable logging, use:
echo module wireguard -p > /sys/kernel/debug/dynamic_debug/control