/wireguard-manager

Secure self-hosted Wireguard Installer / Manager for CentOS, Debian, Ubuntu, Arch, Fedora, Redhat, Raspbian

Primary LanguageShell

Wireguard Manager

GitHub release ShellCheck GitHub issues GitHub contributors GitHub forks GitHub sponsor


What is WireGuard?

WireGuard is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography. It aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable. It is currently under heavy development, but already it might be regarded as the most secure, easiest to use, and simplest VPN solution in the industry.


WireGuard Goals

  • strong, modern security by default
  • minimal config and key management
  • fast, both low-latency and high-bandwidth
  • simple internals and small protocol surface area
  • simple CLI and seamless integration with system networking

Prerequisite

  • CentOS, Debian, Ubuntu, Arch, Fedora, Redhat, Raspbian
  • Linux Kernel 4.1 or newer
  • You will need root access or a user account with sudo privilege.

Installation

Lets first use curl and save the file in /etc/wireguard/

curl https://raw.githubusercontent.com/complexorganizations/wireguard-manager/master/wireguard-server.sh --create-dirs -o /etc/wireguard/wireguard-server.sh

Than lets make the script user executable (Optional)

chmod +x /etc/wireguard/wireguard-server.sh

Its finally time to execute the script

bash /etc/wireguard/wireguard-server.sh

In your /etc/wireguard/clients directory, you will have .conf files. These are the client configuration files. Download them from your WireGuard Interface and connect using your favorite WireGuard Peer.


After Installation

  • Show WireGuard Interface
  • Start WireGuard Interface
  • Stop WireGuard Interface
  • Restart WireGuard Interface
  • Add WireGuard Peer
  • Remove WireGuard Peer
  • Uninstall WireGuard Interface
  • Update this script

Features

  • Installs and configures a ready-to-use WireGuard Interface
  • (IPv4|IPv6) Supported, (IPv4|IPv6) Leak Protection
  • Iptables rules and forwarding managed in a seamless way
  • If needed, the script can cleanly remove WireGuard, including configuration and iptables rules
  • Variety of DNS resolvers to be pushed to the clients
  • The choice to use a self-hosted resolver with Unbound.
  • Preshared-key for extra layer of security.
  • Block DNS leaks
  • Dynamic DNS supported
  • Many other little things!

Options

  • PRIVATE_SUBNET_V4 - private IPv4 subnet configuration 10.8.0.0/24 by default
  • PRIVATE_SUBNET_V6 - private IPv6 subnet configuration fd42:42:42::0/64 by default
  • SERVER_HOST_V4 - public IPv4 address, detected by default using curl
  • SERVER_HOST_V6 - public IPv6 address, detected by default using curl
  • SERVER_PUB_NIC - public nig address, detected by default
  • SERVER_PORT - public port for wireguard server, default is 51820
  • DISABLE_HOST - Disable or enable ipv4 and ipv6, default disabled
  • CLIENT_ALLOWED_IP - private or public IP range allowed in the tunnel
  • NAT_CHOICE - Keep sending packets to keep the tunnel alive 25
  • INSTALL_UNBOUND - Install unbound settings y/n
  • DNS_CHOICE - Without Unbound you have to use a public dns like 8.8.8.8
  • CLIENT_NAME - name of the client
  • MTU_CHOICE - the MTU the client will use to connect to DNS 1420

Compatibility with Linux Distro

OS Supported i386 amd64 armhf arm64
Ubuntu 14.04 ≤
Ubuntu 16.04
Ubuntu 18.04
Ubuntu 19.10 ≥
Debian 7.x ≤
Debian 8.x
Debian 9.x
Debian 10.x ≥
CentOS 6.x ≤
CentOS 7.x
CentOS 8.x ≥
Fedora 29 ≤
Fedora 30
Fedora 31
Fedora 32 ≥
RedHat 6.x ≤
RedHat 7.x
RedHat 8.x ≥
Arch
Raspbian
LXC
KVM
OpenVZ

Compatibility with Cloud Providers

Cloud Supported
AWS
Google Cloud
Linode
Digital Ocean
Vultr
Microsoft Azure
OpenStack
Rackspace
Scaleway
EuroVPS
Hetzner Cloud
Strato

Q&A

Which hosting provider do you recommend?

  • Google Cloud: Worldwide locations, starting at $10/month
  • Vultr: Worldwide locations, IPv6 support, starting at $3.50/month
  • Digital Ocean: Worldwide locations, IPv6 support, starting at $5/month
  • Linode: Worldwide locations, IPv6 support, starting at $5/month

Which WireGuard client do you recommend?

Is there WireGuard documentation?

How do i install wireguard without the questions? (Headless Install) Server Only

  • HEADLESS_INSTALL=y /etc/wireguard/wireguard-server.sh

Official Links


Developing

Using a browser based development environment:

Open in Gitpod

Debugging

git clone https://github.com/complexorganizations/wireguard-manager /etc/wireguard/
bash -x /etc/wireguard/wireguard-(server|client).sh >> /etc/wireguard/wireguard-(server|client).log

Credits

Angristan l-n-s


License

This project is under the MIT