Wireguard Bastion
Deployment of Wireguard Bastion
Wireguard (WG) is the recommended VPN to enable private access channel to your clusters and resources. Wireguard is a fast secure & open-source VPN, with P2P traffic encryption.
Note that the terms WG Bastion and WG server are interchangeably used in this document.
Multiple WG servers will be required to provide a group of users access to certain resources. Multiple WG server may run on the same Virtual Machine (VM). A group of users who access to a particular WG server will have access to all private access channels that are connected to this WG server.
It is recommended to set up at least two channels, one for System Administrators, and one for OpenG2P Application Users (like Program Managers, Service Providers, etc). Further channels can be created based on the need.
Prerequisites
One virtual machine (VM) running on the same network as the rest of the nodes, and has access to them. For recommended configuration of the VM refer to Resource Requirements.
Firewall rules: Allow only
22/tcp
,51820-51830/udp
ports.Docker installed on the VM.
Installation
Clone the openg2p-deployment repo and navigate to the kubernetes/wireguard directory
Run this with root privileges:
To create multiple wireguard servers, run the above script multiple times with appropriate parameters. For example:
Check logs of the servers and wait for all servers to finish startup. Example:
Routing to Nginx
Limit each WG server to allow access to only the required Nginx network interface. The following uses
wireguard_app_users
server example. Repeat this for all servers).Comment out these lines in
/etc/wireguard_app_users/rules.sh
. (This allows everyone to access all IPs):Add the following lines under the above lines in
/etc/wireguard_app_users/rules.sh
, repeat for all IPs of Nginx:Restart the server
Repeat the above for all the WG servers
Access to users
Refer to this Wireguard Access to Users
Wireguard client
To access systems behind Wireguard bastion, you need to install Wireguard client on your machine. Install the client as follows:
Last updated