Skip to content

Instantly share code, notes, and snippets.

@jason9075
Created January 30, 2025 07:54
Show Gist options
  • Save jason9075/0f82e149f02a6636065b8ca010fb8644 to your computer and use it in GitHub Desktop.
Save jason9075/0f82e149f02a6636065b8ca010fb8644 to your computer and use it in GitHub Desktop.
Wireguard Config
# sudo vim /etc/wireguard/wg0.conf
# replace <key> and <eth0>
# sudo wg show
[Interface]
PrivateKey = <key>
Address = 10.22.0.0/24
ListenPort = 51820
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]
# Jason Kuan's Macbook Pro
PublicKey = <key>
AllowedIPs = 10.22.0.100/32
[Peer]
# Jason Kuan's Pixel 7
PublicKey = <key>
AllowedIPs = 10.22.0.101/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment