Code in this video_How to Install and Configure WireGuard VPN Server on Windows VPS

✳️ Replace the highlighted information with your own

🔸Download WireGuard 👉 https://www.wireguard.com/install/

🔸Check Public IP 👉 https://www.whatismyip.com/

Public_IP_of_Server:

Public_Key_of_Server:

Public_Key_of_Client:

📌 WireGuard Server Configure

ListenPort = 51820
Address = 10.20.10.1/24

[Peer]
PublicKey = Public_Key_of_Client
AllowedIPs = 10.20.10.2/32

📌 WireGuard Client Configure

Address = 10.20.10.2/24
DNS =8.8.8.8, 8.8.4.4

[Peer]
PublicKey = Public_Key_of_Server
AllowedIPs = 0.0.0.0/0
Endpoint = IP_Public_of_Server:51820

Meaning of the lines:

📌 WireGuard Server Configuration Explanation

  • ListenPort = 51820
    The port on which the WireGuard server listens for incoming VPN connections. This is the default WireGuard port.
  • Address = 10.20.10.1/24
    The internal IP address of the server within the VPN network, with a /24 subnet mask (equivalent to 255.255.255.0). This is the server’s IP in the virtual private network.
  • [Peer]
    The declaration of a device (client) allowed to connect to the VPN.
  • PublicKey = Public_Key_of_Client
    The public key of the client, used to authenticate and encrypt the connection from client to server.
  • AllowedIPs = 10.20.10.2/32
    The IP addresses that the client is allowed to use or route through the VPN. Here it specifies the client’s private VPN IP.

📌 WireGuard Client Configuration Explanation

  • Address = 10.20.10.2/24
    The internal IP address of the client within the VPN network, with the same subnet as the server.
  • DNS = 8.8.8.8, 8.8.4.4
    The DNS servers the client will use when connected to the VPN; here, Google DNS servers for fast and reliable name resolution.
  • [Peer]
    The declaration of the WireGuard server that the client will connect to.
  • PublicKey = Public_Key_of_Server
    The public key of the server, used to authenticate and encrypt the connection from client to server.
  • AllowedIPs = 0.0.0.0/0
    Specifies that all network traffic (all IPs) will be routed through the VPN when the client is connected.
  • Endpoint = IP_Public_of_Server:51820
    The public IP address and port of the WireGuard server that the client will connect to.

Leave a Reply

Your email address will not be published. Required fields are marked *