mirror of
https://github.com/angristan/wireguard-install.git
synced 2024-10-31 18:52:31 +00:00
Make shellcheck happy
This commit is contained in:
parent
c2c27d46eb
commit
b78610cb98
@ -56,24 +56,24 @@ Address = $SERVER_WG_IPV4/24,$SERVER_WG_IPV6/64
|
||||
ListenPort = $SERVER_PORT
|
||||
PrivateKey = $SERVER_PRIV_KEY
|
||||
PostUp = iptables -t nat -A POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE; ip6tables -t nat -A POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE
|
||||
PostDown = iptables -t nat -D POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE; ip6tables -t nat -D POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE" > /etc/wireguard/$SERVER_WG_NIC.conf
|
||||
PostDown = iptables -t nat -D POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE; ip6tables -t nat -D POSTROUTING -o $SERVER_PUB_NIC -j MASQUERADE" > "/etc/wireguard/$SERVER_WG_NIC.conf"
|
||||
|
||||
# Add the client as a peer to the server
|
||||
echo "[Peer]
|
||||
PublicKey = $CLIENT_PUB_KEY
|
||||
AllowedIPs = $CLIENT_WG_IPV4/32,$CLIENT_WG_IPV6/128" >> /etc/wireguard/$SERVER_WG_NIC.conf
|
||||
AllowedIPs = $CLIENT_WG_IPV4/32,$CLIENT_WG_IPV6/128" >> "/etc/wireguard/$SERVER_WG_NIC.conf"
|
||||
|
||||
# Create client file with interface
|
||||
echo "[Interface]
|
||||
PrivateKey = $CLIENT_PRIV_KEY
|
||||
Address = $CLIENT_IPV4/24,$CLIENT_IPV6/64
|
||||
DNS = $CLIENT_DNS_1,$CLIENT_DNS_2" > ~/$SERVER_WG_NIC-client.conf
|
||||
DNS = $CLIENT_DNS_1,$CLIENT_DNS_2" > "$HOME/$SERVER_WG_NIC-client.conf"
|
||||
|
||||
# Add the server as a peer to the client
|
||||
echo "[Peer]
|
||||
PublicKey = $SERVER_PUB_KEY
|
||||
Endpoint = $SERVER_PUB_IPV4:1194
|
||||
AllowedIPs = 0.0.0.0/0,::/0" >> ~/$SERVER_WG_NIC-client.conf
|
||||
Endpoint = $SERVER_PUB_IP:1194
|
||||
AllowedIPs = 0.0.0.0/0,::/0" >> "$HOME/$SERVER_WG_NIC-client.conf"
|
||||
|
||||
# Enable routing on the server
|
||||
echo "net.ipv4.ip_forward = 1
|
||||
|
Loading…
Reference in New Issue
Block a user