User Tools

Site Tools


wireguard

This is an old revision of the document!


Here is a possible method to install WireGuard Client on Ubuntu Server 24.04

  sudo apt update && sudo apt upgrade -y
  sudo apt install -y wireguard wireguard-tools
  

Generate a private public key pair for the client.

  wg genkey | tee client_private.key | wg pubkey > client_public.key
  

For security, it's recommended to store the keys outside of the current directory. For example, you can use a directory like /etc/wireguard/keys/. You will need the client's public key and the server's public key to create the configuration file.

Create a configuration file, for example, /etc/wireguard/wg0.conf

  sudo nano /etc/wireguard/wg0.conf
  
  [Interface]
  PrivateKey = <Your-client-private-key>
  Address = <Your-client-private-ip>/<subnet-mask>
  DNS = <server-dns-server>
  [Peer]
  PublicKey = <Your-server-public-key>
  Endpoint = <Your-server-public-ip>:<Your-server-port>
  AllowedIPs = <server-ip>/<subnet-mask>, <server-private-ip>/<subnet-mask>
  PersistentKeepalive = 25

Start the Wireguard interface

  sudo wg-quick up wg0
  

Set it to start on Boot

  sudo systemctl enable wg-quick@wg0
  

Check the status of the interface

  sudo wg show
  
  

https://www.google.com/search?q=install+wireguard+client+on+ubuntu+24.04+server&oq=install+wireguard+client+on+ubuntu+24.04+server&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIKCAEQABiABBiiBDIKCAIQABiABBiiBDIKCAMQABiABBiiBDIKCAQQABiiBBiJBTIKCAUQABiABBiiBDIGCAYQLhhA0gEIODAyOGowajSoAgCwAgE&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:433abd84,vid:jb3uMuYYLhQ,st:0

wireguard.1761530740.txt.gz · Last modified: by mark_scottworld.net

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki