Wireguard: Unterschied zwischen den Versionen

Aus xinux.net
Zur Navigation springen Zur Suche springen
Zeile 11: Zeile 11:
 
*wg genpsk > psk.key  
 
*wg genpsk > psk.key  
 
=Configuration=
 
=Configuration=
;schnubel
+
*[[Wireguard Temporary Configuration]]
*cat /etc/wireguard/wg0.conf
+
*[[Wireguard Static Configuration]]
<pre>
 
[Interface]
 
Address =  10.84.252.45/32
 
PrivateKey = mLwHm48y8fRQrez3XrUzL3rSqgy51GwVj+W3/JuVxm4=
 
ListenPort = 50002
 
  
[Peer]
 
PublicKey = ULq8e5vYRa2s4phsRBkzOvRC8g819xM0/44rII6wqTg=
 
PresharedKey = 7zyF6E3dQtpiJHBhOix46/MsSkHk2FukYQtZ3rAjJtg=
 
AllowedIPs = 10.83.33.0/24
 
Endpoint = 10.84.252.33:50002
 
</pre>
 
;gustavo
 
*cat /etc/wireguard/wg0.conf
 
<pre>
 
[Interface]
 
Address =  10.84.252.33/32
 
PrivateKey = OJYseijxQRCfpFeMe3052mfDV6lhvOxpRLeVm9C520Y=
 
ListenPort = 50002
 
 
[Peer]
 
PublicKey = C1YoH/VxFLS5PjkhAxi13lG/Uq6jDwxSB5xMVHzm6ys=
 
PresharedKey = 7zyF6E3dQtpiJHBhOix46/MsSkHk2FukYQtZ3rAjJtg=
 
AllowedIPs = 10.83.45.0/24
 
Endpoint = 10.84.252.45:50002
 
</pre>
 
 
=Systemctl=
 
*systemctl enable wg-quick@wg0.service
 
*systemctl start wg-quick@wg0.service
 
*systemctl status wg-quick@wg0.service
 
*systemctl stop wg-quick@wg0.service
 
 
=Test=
 
=Test=
 
;schnubbel
 
;schnubbel

Version vom 18. Dezember 2019, 11:08 Uhr

Two Nodes

schnubel
gustavo

Installation

  • sudo add-apt-repository ppa:wireguard/wireguard
  • sudo apt install wireguard

Create Keys

  • cd /etc/wireguard
  • wg genkey > private.key
  • wg pubkey > public.key < private.key
  • wg genpsk > psk.key

Configuration

Test

schnubbel
  • wg
interface: wg0
  public key: C1YoH/VxFLS5PjkhAxi13lG/Uq6jDwxSB5xMVHzm6ys=
  private key: (hidden)
  listening port: 50002

peer: ULq8e5vYRa2s4phsRBkzOvRC8g819xM0/44rII6wqTg=
  preshared key: (hidden)
  endpoint: 10.84.252.33:50002
  allowed ips: 10.83.33.0/24
  latest handshake: 1 minute, 9 seconds ago
  transfer: 220 B received, 308 B sent

Links