Skip to content

Instantly share code, notes, and snippets.

@vimagick
Last active March 15, 2025 10:42
Show Gist options
  • Save vimagick/17c162abff708a249da080bb28b95128 to your computer and use it in GitHub Desktop.
Save vimagick/17c162abff708a249da080bb28b95128 to your computer and use it in GitHub Desktop.
[Interface]
PrivateKey = ******
Address = 192.168.x.x/24
DNS = 8.8.x.x
[Peer]
PublicKey = ******
AllowedIPs = 192.168.x.0/24, 8.8.0.0/16
Endpoint = x.x.x.x:51820
PersistentKeepalive = 25
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>wireguard</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/bash</string>
<string>/opt/homebrew/bin/wg-quick</string>
<string>up</string>
<string>wg0</string>
</array>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/wireguard.log</string>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<dict>
<key>NetworkState</key>
<true/>
</dict>
</dict>
</plist>
@vimagick
Copy link
Author

vimagick commented Mar 14, 2025

brew install wireguard-tools
vim /opt/homebrew/etc/wireguard/wg0.conf
sudo vim /Library/LaunchDaemons/wireguard.plist
sudo launchctl bootstrap system /Library/LaunchDaemons/wireguard.plist
tail /usr/local/var/log/wireguard.log
ping 192.168.x.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment