Wiregaurd proxmox setup (ip-transit)
🛠️ WireGuard Setup on Proxmox – Full Guide (Copy & Paste)
📦 Step 1: Install WireGuard
apt update && apt install wireguard -y
📁 Step 2: Create the WireGuard config
Paste this into /etc/wireguard/wg0.conf:
[Interface]
PrivateKey = 2J/19N8A3dEPqQazfox8bF6fhnHMCCyIm66DJTG00nQ=
Address = 10.99.87.2/30
Table = 11
MTU = 1500
[Peer]
PublicKey = OB6OtLGaaYEF6UT8TA1zP2akiRk+lpaYH+wq5AKOMys=
PresharedKey = VmxEIpk6xrWsqHBkyOvrNkd9xHrMT+txYk511Ytrp8c=
Endpoint = 5.231.32.3:51110
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/0
Save and exit.
🚀 Step 3: Enable and start WireGuard
systemctl enable --now wg-quick@wg0
🌐 Step 4: Add routing rules for public IPs
You can run this directly or save as /root/wg-routes.sh:
#!/bin/bash
for ip in {113..117}; do
ip rule add from 5.231.32.$ip/32 table 11 prio 1
ip route add 5.231.32.$ip/32 dev vmbr0 table 11
ip route add 5.231.32.$ip/32 dev vmbr0
done
Make it executable:
chmod +x /root/wg-routes.sh
Then run it:
bash /root/wg-routes.sh
📡 Step 5: Enable IP forwarding and proxy ARP/NDP
You can paste this all at once:
echo 1 > /proc/sys/net/ipv4/conf/all/proxy_arp
echo 1 > /proc/sys/net/ipv6/conf/default/proxy_ndp
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.forwarding=1" >> /etc/sysctl.conf
sysctl -p
Or add it into the same script above so it runs after reboot.
✅ Done!
Your public IPs should now route through the WireGuard tunnel.