mirror of
https://github.com/donaldzou/WGDashboard
synced 2025-06-26 18:26:58 +00:00
Reimplemented Automatic Wireguard Configuration Generation Setting global Env Vars via the docker image build is still insecure, better to pass to dashboard before init.
13 lines
352 B
Bash
13 lines
352 B
Bash
#!/bin/bash
|
|
WIREGUARD_INTERFACE=ADMINS
|
|
WIREGUARD_LAN=10.0.0.1/24
|
|
MASQUERADE_INTERFACE=eth0
|
|
|
|
CHAIN_NAME="WIREGUARD_$WIREGUARD_INTERFACE"
|
|
|
|
iptables -t nat -D POSTROUTING -o $MASQUERADE_INTERFACE -j MASQUERADE -s $WIREGUARD_LAN
|
|
|
|
# Remove and delete the WIREGUARD_wg0 chain
|
|
iptables -D FORWARD -j $CHAIN_NAME
|
|
iptables -F $CHAIN_NAME
|
|
iptables -X $CHAIN_NAME |