Advertisement
Guest User

Untitled

a guest
Feb 27th, 2025
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. GNU nano 7.2 /etc/wireguard/wg0.conf
  2. [Interface]
  3. Address = 192.168.100.1/24
  4. SaveConfig = true
  5. PostUp = sysctl -w net.ipv4.ip_forward=1
  6. PostUp = iptables -A FORWARD -i wg0 -j ACCEPT
  7. PostUp = iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
  8. PostUp = iptables -t nat -A PREROUTING -p udp --dport 3478 -j DNAT --to-destination 192.168.100.2:3478
  9. PostUp = iptables -A FORWARD -p udp -d 192.168.100.2 --dport 3478 -j ACCEPT
  10. PostUp = iptables -t nat -A PREROUTING -p udp --dport 16384:32768 -j DNAT --to-destination 192.168.100.2
  11. PostUp = iptables -A FORWARD -p udp -d 192.168.100.2 --dport 16384:32768 -j ACCEPT
  12. PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
  13. PostDown = iptables -t nat -D POSTROUTING -o ens3 -j MASQUERADE
  14. PostDown = iptables -t nat -D PREROUTING -p udp --dport 3478 -j DNAT --to-destination 192.168.100.2:3478
  15. PostDown = iptables -D FORWARD -p udp -d 192.168.100.2 --dport 3478 -j ACCEPT
  16. PostDown = iptables -t nat -D PREROUTING -p udp --dport 16384:32768 -j DNAT --to-destination 192.168.100.2
  17. PostDown = iptables -D FORWARD -p udp -d 192.168.100.2 --dport 16384:32768 -j ACCEPT
  18. ListenPort = 51820
  19. PrivateKey = XXXX
  20.  
  21. [Peer]
  22. PublicKey = XXXXX
  23. AllowedIPs = 192.168.100.2/32
  24.  
  25.  
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement