FokiDoki / WireRest

REST API for Wireguard
MIT License
18 stars 5 forks source link

WireGuard VPN Connection Successful, but No Internet Access #73

Closed junormeshud closed 2 months ago

junormeshud commented 3 months ago

Description

The VPN connection using WireGuard and WireRest does not allow internet access. Despite successful connection establishment, the client cannot access the internet through the VPN.

Steps to reproduce

Install and configure WireGuard on the server. Install and configure WireRest on the server. Configure the WireGuard client with the provided server details. Connect the client to the VPN. Result

When the client connects to the VPN, the connection is established successfully, but the client cannot access the internet.

Expected Result

When the client connects to the VPN, the connection should be established successfully, and the client should have internet access through the VPN.

FokiDoki commented 2 months ago

Hello

I tested now and it works fine. This is how I do the test:

  1. Install Wireguard (for simplicity I used wireguard-install)
  2. Install the stand using the installation script
  3. Automatically created a peer (didn't pass any arguments)
curl -X 'POST' \
  'http://SERVER_IP_ADDRESS:8081/v1/peers' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{}'

got

  {
  "publicKey": "w8z6ArpLEOXZHFF0BWHbIK9+5rX8av01+uhwtYa/CCc=",
  "presharedKey": "N1NBkN3HS9QGZpGhiYfvyxQWUsI/t2+9DZ5ubK0X3Ew=",
  "privateKey": "aJGB5OjOSwxJEEO+emIaJZognbSDjXnL4Uk7yR/CSUI=",
  "allowedSubnets": [
    "10.66.66.3/32"
  ],
  "persistentKeepalive": 0
}
  1. Get interface config via /v1/interface

    {
    "privateKey": "ACvYPpYZtezCS7+teB1mVUAXyx5LbWFIquOg5G0kFFA=",
    "publicKey": "tUxIJv2GXdjmPuwNuBXlJ/r3aguVNZS9y+BTmiQrJDY=",
    "listenPort": 59261,
    "fwMark": 0
    }
  2. And the compiled conf file:

    
    [Interface]
    PrivateKey = aJGB5OjOSwxJEEO+emIaJZognbSDjXnL4Uk7yR/CSUI=
    Address = 10.66.66.3/32
    DNS = 1.1.1.1

[Peer] PublicKey = tUxIJv2GXdjmPuwNuBXlJ/r3aguVNZS9y+BTmiQrJDY= PresharedKey = N1NBkN3HS9QGZpGhiYfvyxQWUsI/t2+9DZ5ubK0X3Ew= Endpoint = SERVER_IP_ADDRESS:59261 AllowedIPs = 0.0.0.0/0, ::/0



This steps give me a working connection with internet access. 
Please check your configurations and firewall. 
In #64 I'm described how to make correct conf file for wireguard client.