Last active
April 16, 2020 16:01
-
-
Save iRhonin/f3b855cff8cabfd333fb6a15030b2ded to your computer and use it in GitHub Desktop.
wireguard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Interface] | |
PrivateKey = ... | |
Address = 192.168.111.2 | |
[Peer] | |
PublicKey = ... | |
AllowedIPs = 0.0.0.0/0 | |
Endpoint = <external-ip>:443 | |
PersistentKeepalive = 19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Interface] | |
Address = 192.168.111.1 | |
PrivateKey = ... | |
ListenPort = 443 | |
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE | |
[Peer] | |
PublicKey = ... | |
AllowedIPs = 192.168.111.2/32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
sysctl -w net.ipv4.ip_forward=1 | |
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf | |
systemctl enable [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
umask 077 | |
wg genkey | tee $1 | wg pubkey > $1.pub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment