Skip to content

Instantly share code, notes, and snippets.

@meehatpa
Created December 24, 2023 13:28
Show Gist options
  • Save meehatpa/1b368acc82a3f80a8cb3ccd11b504342 to your computer and use it in GitHub Desktop.
Save meehatpa/1b368acc82a3f80a8cb3ccd11b504342 to your computer and use it in GitHub Desktop.
site2site nat wg client
[Interface]
Address = 10.0.0.x/32
PrivateKey = xxx
ListenPort = 51820
DNS = xx
PreUp = sysctl -w net.ipv4.ip_forward=1
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth+ -j MASQUERADE
[Peer]
PublicKey = xxx
PresharedKey = xxx
Endpoint = ip:51820
AllowedIPs = 10.0.0.0/24
PersistentKeepalive = 25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment