This commit is contained in:
tavo-wasd 2024-03-08 01:46:15 -06:00
parent 4ba5105d4c
commit b40264ecbe
2 changed files with 11 additions and 6 deletions

View file

@ -2,11 +2,13 @@
Setup a wireguard VPN to route traffic from a VPS to your local machine. Setup a wireguard VPN to route traffic from a VPS to your local machine.
Based from [this](https://github.com/mochman/Bypass_CGNAT) guide. Based from [this](https://github.com/mochman/Bypass_CGNAT) guide.
# Possible extra configuration ### Usage
``` This creates a file `client.conf` in the current directory,
auto eth0 and it will output the client configuration to the terminal as well.
iface eth0 inet static
. . . ```shell
dns-nameservers 1.1.1.1 9.9.9.9 wget -qO /opt/bypasscgnat.sh "https://gitlab.com/tavo-wasd/guides/-/raw/main/self_hosting/bypass_cgnat/bypasscgnat.sh"
chmod +x /opt/bypasscgnat.sh
/opt/bypasscgnat.sh
``` ```

View file

@ -47,6 +47,8 @@ install_wireguard() {
} }
wireguard_config() { wireguard_config() {
ufw allow 55107
printf "net.ipv6.conf.all.forwarding = 1\nnet.ipv4.ip_forward = 1" > /etc/sysctl.d/wg.conf printf "net.ipv6.conf.all.forwarding = 1\nnet.ipv4.ip_forward = 1" > /etc/sysctl.d/wg.conf
sysctl -p sysctl -p
sysctl --system sysctl --system
@ -62,6 +64,7 @@ wireguard_config() {
install_wireguard install_wireguard
wireguard_config wireguard_config
ufw reload
echo "[Interface] echo "[Interface]
PrivateKey = ${SERVER_PRV_KEY} PrivateKey = ${SERVER_PRV_KEY}