Last active
November 18, 2021 06:03
-
-
Save dragonly/49fba22258b450302defd78a17ae9036 to your computer and use it in GitHub Desktop.
wireguard setup
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 = x | |
Address = 192.168.2.5/24 | |
ListenPort = 21841 | |
[Peer] | |
PublicKey = x | |
Endpoint = $public_ip:51820 | |
AllowedIPs = 192.168.2.0/24 |
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 = x | |
Address = 192.168.2.1/24 | |
ListenPort = 51820 | |
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | |
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE | |
[Peer] | |
PublicKey = x | |
AllowedIPs = 192.168.2.2/32 | |
[Peer] | |
PublicKey = x | |
AllowedIPs = 192.168.2.3/32 | |
[Peer] | |
PublicKey = x | |
AllowedIPs = 192.168.2.4/32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment