Comment on Need help for setting up a VPN project

gravitywell@sh.itjust.works ⁨1⁩ ⁨week⁩ ago

A central wireguard peer on your vps, connect from home to vps and direct the wireguard. Add friends as peers on the VPS like such:

[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = <VPS_PRIVKEY>

# Home
[Peer]
PublicKey = <HOME_PUBKEY>
AllowedIPs = 10.0.0.2/32

# Friend
[Peer]
PublicKey = <CLIENT_PUBKEY>
AllowedIPs = 10.0.0.3/32

Use iptables to Split tunnel traffic

For the home network ip route add 192.168.1.0/24 via 1. 0.2 dev wg0

And for the vpn To route google a .d such

Enable NAT for clients

iptables -t natw POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE

You can set the iptables rules to run wjen

source
Sort:hotnewtop