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.
Based from [this](https://github.com/mochman/Bypass_CGNAT) guide.
# Possible extra configuration
### Usage
```
auto eth0
iface eth0 inet static
. . .
dns-nameservers 1.1.1.1 9.9.9.9
This creates a file `client.conf` in the current directory,
and it will output the client configuration to the terminal as well.
```shell
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() {
ufw allow 55107
printf "net.ipv6.conf.all.forwarding = 1\nnet.ipv4.ip_forward = 1" > /etc/sysctl.d/wg.conf
sysctl -p
sysctl --system
@ -62,6 +64,7 @@ wireguard_config() {
install_wireguard
wireguard_config
ufw reload
echo "[Interface]
PrivateKey = ${SERVER_PRV_KEY}