User Tools

Site Tools


technical:vpn:wireguard

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
technical:vpn:wireguard [2022/08/11 09:03] jctechnical:vpn:wireguard [2024/12/14 09:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== WireGuard VPN ====== ====== WireGuard VPN ======
 +<markdown>
 +# Install
 +```
 +sudo pacman -S wireguard-tools 
 +```
  
-===== Install =====+# Generate Keys 
 +``` 
 +wg genkey | tee privatekey | wg pubkey > publickey 
 +wg genpsk 
 +```
  
-===== Generate Keys =====+# Config  
 +##Edit WireGuard Config 
 +``` 
 +vim /etc/wireguard/wg0.conf 
 +```
  
-===== Config =====+## Add the Local Address/Port/Key/Scripts and Peer 
 +```  
 +[Interface] 
 +Address $wireguard_address 
 +PostUp iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o $interface -j MASQUERADE; 
 +PostDown iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o $interface -j MASQUERADE; 
 +ListenPort $port 
 +PrivateKey $key
  
-===== Startup =====+[Peer] 
 +PublicKey $peer_public_key 
 +AllowedIPs $peer_wireguard_address, $remote_subnet 
 +Endpoint $peer_public_ip:$peer_port 
 +PresharedKey $prehared_key 
 +```
  
-===== Shell Script =====+# Startup 
 +``` 
 +wg-quick up $interface 
 +```
  
 +# Shell Script
 +</markdown>
  
  
technical/vpn/wireguard.1660223003.txt.gz · Last modified: 2022/08/11 09:03 by jc