leonovk / wg-rest-api

WireGuard VPN + Easy REST API in one package
https://hub.docker.com/r/leonovk/wg-rest-api
MIT License
44 stars 6 forks source link

After connecting internet not working #51

Closed HassanFlutterDev closed 3 months ago

HassanFlutterDev commented 3 months ago

When i connect to server my internet goes down and it's also not giving dns

[Interface] PrivateKey = iK07qJaqq9CRjx83vQf/9gy7F5KuOR5EDDKOFyeLz34= Address = 10.8.0.2/24 DNS = null

[Peer] PublicKey = 6ot7YW068MqJGMbfeo41e8WYhUwFt9YACuLhL0IO32c= PresharedKey = alh7YS3PJUXDdAIJ3HbALxNu+LhYY61xEOOEtUQxyk0= AllowedIPs = 0.0.0.0/0, ::/0 Endpoint = server_ip:51820 PersistentKeepalive = 0

it is like this

leonovk commented 3 months ago

what version do you have?

HassanFlutterDev commented 3 months ago

what version do you have?

{ "status": "ok", "version": "1.8.5" }

this one

HassanFlutterDev commented 3 months ago

this is api response

Screenshot 2024-08-10 at 2 13 23 AM
leonovk commented 3 months ago

You can specify DNS in the settings by specifying the appropriate environment variable when starting the container -> WG_DEFAULT_DNS. Regarding the Internet, make sure that you start the container with the correct settings. --cap-add=NET_ADMIN. Also make sure you have mapped all the necessary ports in udp

leonovk commented 3 months ago

In your answer I see that you have an incorrect server IP specified. It should indicate the IP address of the server on which you are running the application. Sorry if you changed the IP address on purpose for demonstration purposes.

HassanFlutterDev commented 3 months ago

In your answer I see that you have an incorrect server IP specified. It should indicate the IP address of the server on which you are running the application. Sorry if you changed the IP address on purpose for demonstration purposes.

i removed to don't get exposed

HassanFlutterDev commented 3 months ago

You can specify DNS in the settings by specifying the appropriate environment variable when starting the container -> WG_DEFAULT_DNS. Regarding the Internet, make sure that you start the container with the correct settings. --cap-add=NET_ADMIN. Also make sure you have mapped all the necessary ports in udp

yes i have added it

leonovk commented 3 months ago

Something like this:

docker run -d \
-e WG_HOST=<🚨YOUR_SERVER_IP> \
-e AUTH_TOKEN=<🚨YOUR_ADMIN_API_TOKEN> \
-e ENVIRONMENT=production \
-e WG_DEFAULT_DNS=1.1.1.1 \
-v ~/.wg-rest:/etc/wireguard \
-p 51820:51820/udp \
-p 3000:3000 \
--cap-add=NET_ADMIN \
--restart unless-stopped \
wg-rest-api
HassanFlutterDev commented 3 months ago

let me do it

Something like this:

docker run -d \
-e WG_HOST=<🚨YOUR_SERVER_IP> \
-e AUTH_TOKEN=<🚨YOUR_ADMIN_API_TOKEN> \
-e ENVIRONMENT=production \
-e WG_DEFAULT_DNS=1.1.1.1 \
-v ~/.wg-rest:/etc/wireguard \
-p 51820:51820/udp \
-p 3000:3000 \
--cap-add=NET_ADMIN \
--restart unless-stopped \
wg-rest-api
leonovk commented 3 months ago

@HassanFlutterDev yes

leonovk commented 3 months ago

@HassanFlutterDev Did you succeed?

leonovk commented 3 months ago

I'll close the issue since there is no activity