Skip to content

feat(fastestvpn): support for Wireguard#2383

Merged
qdm12 merged 1 commit into
masterfrom
fastestvpn-wireguard
Jul 31, 2024
Merged

feat(fastestvpn): support for Wireguard#2383
qdm12 merged 1 commit into
masterfrom
fastestvpn-wireguard

Conversation

@qdm12
Copy link
Copy Markdown
Member

@qdm12 qdm12 commented Jul 30, 2024

Credits to:

  • @Zerauskire for the initial investigation
  • @jvanderzande for an initial implementation as well as reviewing this pull request

@jvanderzande
Copy link
Copy Markdown

I've tried to add this commit to my local master and build the local docker image to test, but get an error with these env:

      - VPN_SERVICE_PROVIDER=fastestvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_ENDPOINT_PORT=51820
      - SERVER_COUNTRIES=Belgium
      - WIREGUARD_PRIVATE_KEY=-----mylprivatekey-----2=
      - WIREGUARD_ADDRESSES=172.16.125.72/32

2024-07-30T21:56:21Z INFO [routing] default route found: interface eth0, gateway 172.30.0.1, assigned IP 172.30.0.2 and family v4
2024-07-30T21:56:21Z INFO [routing] local ethernet link found: eth0
2024-07-30T21:56:21Z INFO [routing] local ipnet found: 172.30.0.0/16
2024-07-30T21:56:21Z INFO [firewall] enabling...
2024-07-30T21:56:21Z INFO [firewall] enabled successfully
2024-07-30T21:56:22Z INFO [storage] merging by most recent 19738 hardcoded servers and 19738 servers read from /gluetun/servers.json
2024-07-30T21:56:22Z ERROR VPN settings: provider settings: server selection: Wireguard server selection settings: endpoint port is set
2024-07-30T21:56:22Z INFO Shutdown successful

Any idea what's wrong?

@jvanderzande
Copy link
Copy Markdown

jvanderzande commented Jul 31, 2024

Things seem to work fine now after I changed the below line in connection.go, changing the 3rd param from 0 to 51820:
defaults := utils.NewConnectionDefaults(4443, 4443, 51820) //nolint:gomnd

It now also works without defining the env: WIREGUARD_ENDPOINT_PORT=51820

Log:

2024-07-31T12:27:09Z INFO [routing] default route found: interface eth0, gateway 172.31.0.1, assigned IP 172.31.0.2 and family v4
2024-07-31T12:27:09Z INFO [routing] adding route for 0.0.0.0/0
2024-07-31T12:27:09Z INFO [firewall] setting allowed subnets...
2024-07-31T12:27:09Z INFO [routing] default route found: interface eth0, gateway 172.31.0.1, assigned IP 172.31.0.2 and family v4
2024-07-31T12:27:09Z INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
2024-07-31T12:27:09Z INFO [dns] using plaintext DNS at address 1.1.1.1
2024-07-31T12:27:09Z INFO [http server] http server listening on [::]:8000
2024-07-31T12:27:09Z INFO [healthcheck] listening on 127.0.0.1:9999
2024-07-31T12:27:09Z INFO [firewall] allowing VPN connection...
2024-07-31T12:27:09Z INFO [wireguard] Using available kernelspace implementation
2024-07-31T12:27:09Z INFO [wireguard] Connecting to 193.9.114.210:51820
2024-07-31T12:27:09Z INFO [wireguard] Wireguard setup is complete. Note Wireguard is a silent protocol and it may or may not work, without giving any error message. Typically i/o timeout errors indicate the Wireguard connection is not working.
2024-07-31T12:27:09Z INFO [healthcheck] healthy!
2024-07-31T12:27:09Z INFO [dns] downloading DNS over TLS cryptographic files
2024-07-31T12:27:10Z INFO [dns] downloading hostnames and IP block lists
2024-07-31T12:27:14Z INFO [dns] init module 0: validator
2024-07-31T12:27:14Z INFO [dns] init module 1: iterator
2024-07-31T12:27:14Z INFO [dns] start of service (unbound 1.20.0).
2024-07-31T12:27:14Z INFO [dns] generate keytag query _ta-4a5c-4f66-9728. NULL IN
2024-07-31T12:27:14Z INFO [dns] ready
2024-07-31T12:27:22Z INFO [ip getter] Public IP address is 193.9.114.210 (Belgium, Flanders, Zaventem)
2024-07-31T12:27:22Z INFO [vpn] There is a new release v3.38.0 (v3.38.0) created 127 days ago

@qdm12
Copy link
Copy Markdown
Member Author

qdm12 commented Jul 31, 2024

Thanks @jvanderzande for testing and even finding the problem! Although, I'm a bit confused when you say in your first comment

I've tried to add this commit to my local master and build the local docker image to test, but get an error with these env:

  • WIREGUARD_ENDPOINT_PORT=51820

And then in your 2nd comment

It now also works without defining the env: WIREGUARD_ENDPOINT_PORT=51820

So before the 'fix' (pushed with b8ff1c9), just to be sure, it would work fine if you would set WIREGUARD_ENDPOINT_PORT=51820 correct? I'm asking since I did a recent change regarding this in 36c8da7 so just double checking it works as expected. Thanks!

@jvanderzande
Copy link
Copy Markdown

Thanks @jvanderzande for testing and even finding the problem! Although, I'm a bit confused when you say in your first comment

I've tried to add this commit to my local master and build the local docker image to test, but get an error with these env:

  • WIREGUARD_ENDPOINT_PORT=51820

And then in your 2nd comment

It now also works without defining the env: WIREGUARD_ENDPOINT_PORT=51820

OK... will give you the whole story of my testing:
In my first test without the WIREGUARD_ENDPOINT_PORT definition, I got an error Hard Error and some message that the Wireguard port was missing, so added the - WIREGUARD_ENDPOINT_PORT=51820 environment setting to the docker compose, which then triggered the error I've shared. (I assumed at the time that WIREGUARD_ENDPOINT_PORT was a required field)
Then I figured out that the default port was missing as indicated, which made all work fine and now also when I do not provide the WIREGUARD_ENDPOINT_PORT environment variable.
Hope I described it a bit clearer, but shoot when you still have questions.

@jvanderzande
Copy link
Copy Markdown

Just tested the latest version of this branch in my docker test setup and FASTESTVPN works fine for me.

@qdm12
Copy link
Copy Markdown
Member Author

qdm12 commented Jul 31, 2024

Oh ok never mind, I didn't read correctly the error you shared endpoint port is set which is meant to happen since custom ports should not be allowed (AFAIK) for FastestVPN wireguard. All good 💯 And yeah because gluetun didn't know what port to use, it "panic"-ed with an error crashing the whole thing. Merging it! 👍

@qdm12 qdm12 force-pushed the fastestvpn-wireguard branch from b8ff1c9 to a8140fe Compare July 31, 2024 14:11
@qdm12 qdm12 marked this pull request as ready for review July 31, 2024 14:13
Comment thread internal/portforward/service/start.go Outdated
Comment thread internal/provider/fastestvpn/updater/servers.go Outdated
@qdm12 qdm12 force-pushed the fastestvpn-wireguard branch from a8140fe to 116399d Compare July 31, 2024 14:15
@qdm12 qdm12 merged commit 13ffffb into master Jul 31, 2024
@qdm12 qdm12 deleted the fastestvpn-wireguard branch July 31, 2024 14:16
@bijfy
Copy link
Copy Markdown

bijfy commented Aug 7, 2024

It's working great with wireguard fastestvpn. Thank you so much everyone for your great work. I am.getting 560+ mbps on mobile and around 780+ mbps on my wired 1gig plan on zimaboard.

CMarcJoubert pushed a commit to FideresDev/gluetun that referenced this pull request Jan 14, 2025
Credits to @Zerauskire for the initial investigation and @jvanderzande for an initial implementation as well as reviewing the pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants