-
-
Save jrandiny/4abf2101e0cac724ce2469ed30c2670c to your computer and use it in GitHub Desktop.
wireguard config
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 = <client private key> | |
Address = 10.50.0.1/24 | |
DNS = 10.50.0.3 | |
# Jump host | |
[Peer] | |
PublicKey = <jump host public key> | |
AllowedIPs = 0.0.0.0/0,::0/0 | |
Endpoint = <jump host ip and port> | |
PersistentKeepalive = 25 |
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 = <jump host private key> | |
Address = 10.50.0.2/24 | |
ListenPort = 12367 | |
Table = 999 | |
# Setup forwarding of all traffic from 10.50.0.0/24 | |
PostUp = ip rule add table 999 suppress_prefixlength 0 | |
PostUp = ip rule add from 10.50.0.0/24 table 999 | |
PreDown = ip rule del from 10.50.0.0/24 table 999 | |
PreDown = ip rule del table 999 suppress_prefixlength 0 | |
PostUp = iptables -I FORWARD -i %i ! -o %i -j REJECT | |
PreDown = iptables -D FORWARD -i %i ! -o %i -j REJECT | |
# client | |
[Peer] | |
PublicKey = <client public key> | |
AllowedIPs = 10.50.0.1 | |
# server | |
[Peer] | |
PublicKey = <server public key> | |
AllowedIPs = 10.50.0.3,0.0.0.0/0 | |
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 = <server private key> | |
Address = 10.50.0.3/24 | |
# Setup forwarding | |
PostUp = iptables -A FORWARD -i %i -j ACCEPT;iptables -A FORWARD -o %i -j ACCEPT | |
PostUp = iptables -t nat -A POSTROUTING -o enp5s0 -j MASQUERADE # Change enp5s0 to your network interface | |
PostDown = iptables -t nat -D POSTROUTING -o enp5s0 -j MASQUERADE # Change enp5s0 to your network interface | |
PostDown = iptables -D FORWARD -i %i -j ACCEPT;iptables -D FORWARD -o %i -j ACCEPT | |
# Jump host | |
[Peer] | |
PublicKey = <jump host public key> | |
Endpoint = <jump host ip and port> | |
AllowedIPs = 10.50.0.0/24 | |
PersistentKeepalive = 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment