Live data from Hacker News

Full WireGuard Support in ProtonVPN for Android

github.com

31–40 of 51 posts

Re: Full WireGuard Support in ProtonVPN for Android

#31
post #24

Earlier quoted context omitted.

Then maybe you need to add the following to the [Interface] section of your wg0.conf on your server or else I don't know ;-) : PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

Already reads as such, though I've tried that code snippet too: PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; iptables -A FORWARD -o %i -j ACCEPT PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; iptables -D FORWARD -o %i -j ACCEPT Like I said, everyone keeps saying Wireguard is dead simple to set up, but the com…

Well, hit me up if you want a VPS installed with WireGuard with maybe some nice web interface like https://github.com/EmbarkStudios/wg-ui

Re: Full WireGuard Support in ProtonVPN for Android

#32
post #26

Earlier quoted context omitted.

Yes, his computer is on my VPN and has a static IPv4 address inside of the VPN, 10.42.42.4, as well as a static IPv6 address inside of the VPN, fc42:4242:4242:4242::4. I updated my comment above to note that I use my VPN for connectivity between hosts only, but across the Internet. So I can connect to any host in the VPN from anywhere in the world, but all of the hosts still send all of their other traffic via the sa…

Can you point me to some docs on how to accomplish this? I'm currently using Slack Nebula to achieve similar goals but every time I looked up WireGuard tutorials, it was to tunnel traffic through a VPS, which I didn't want to do.

On my VPS that runs FreeBSD I am using wireguard installed via

    doas pkg install wireguard
I set up WireGuard server on the FreeBSD VPS with /usr/local/etc/wireguard/wg0.conf that looks like the following:

    [Interface]
    Address = 10.42.42.1/24, fc42:4242:4242:4242::1/64
    PrivateKey = nbCsCf5Dq48ZCnCgziYoDN/E65XDVQOz7pIXGbD4Lwg=
    ListenPort = 443

    # iPhone X
    [Peer]
    PublicKey = CyHJgqaKgejt0qzHqAnFFAUJV/eNKeWoxrYNPsKQif0=
    AllowedIPs = 10.42.42.3/32, fc42:4242:4242:4242::3/128

    # stuegris
    [Peer]
    PublicKey = j2W3ocwBIYhv/fpk8T9dIh2qPWe7TfJmOprDrqu+cFU=
    AllowedIPs = 10.42.42.4/32, fc42:4242:4242:4242::4/128

    # nova
    [Peer]
    PublicKey = 3mn/IobmsopC2UrqXyIQfBoH9reWZnHiJvTk/yoFWXY=
    AllowedIPs = 10.42.42.7/32, fc42:4242:4242:4242::7/128

    # schumberry
    [Peer]
    PublicKey = 0o4aWdhGYya/FZz0jwQhTFztdwX7tmHdoyxlbjbg3D4=
    AllowedIPs = 10.42.42.10/32, fc42:4242:4242:4242::10/128
To generate the public and private keys I used

    wg genkey | tee server.private | wg pubkey > server.public

    wg genkey | tee iphone.private | wg pubkey > iphone.public

    wg genkey | tee stuegris.private | wg pubkey > stuegris.public

    wg genkey | tee nova.private | wg pubkey > nova.public

    wg genkey | tee schumberry.private | wg pubkey > schumberry.public
And then I printed the values of each of the files to the terminal simply by cat'ing them to the terminal and copying the values into the respective places. For the server, only the private key is used in the config and the server config likewise contains only the public keys for the clients. For each of the clients, as we will see below, the config contains the private key of the client in question and the public key of the server.

The names "server.private", "server.public", "iphone.private", "iphone.public", "stuegris.private", "stuegris.public", etc are just corresponding to the different hosts and devices. Likewise I have comments in the config file corresponding to which host or device each entry is for.

All of theses files "server.private", "server.public", "iphone.private", "iphone.public", and so on are just temporary. After you've created the config files for the server (above) and the clients (below) you can delete these files.

In /etc/rc.conf on the same FreeBSD server I have added

    wireguard_enable="YES"
    wireguard_interfaces="wg0"
If your server is running Linux then the setup will be different in terms of how to enable the service. For example if your server is running a disto that uses systemd, then you'd typically create a WireGuard config similar to mine but place it at /etc/wireguard/wg0.conf and then you'd run

    sudo systemctl enable --now wg-quick@wg0
On each of the clients I have corresponding configurations.

Here is what the configuration of WireGuard client for my MacBook Pro M1 looks like:

    [Interface]
    PrivateKey = 97l4pAqRXZasXU2k5S8BNp7yTa6ZyAWyNVtF3wqTpds=
    Address = 10.42.42.7/32, fc42:4242:4242:4242::7/128

    [Peer]
    PublicKey = B+nP9X0dij38FpF5/lbXe53ua7nl0fk7YMUxuTuKi20=
    AllowedIPs = 10.42.42.0/24, fc42:4242:4242:4242::/64
    Endpoint = wg.example.com:443
    PersistentKeepalive = 25
Here is what the configuration file /etc/wireguard/wg0.conf of WireGuard client on my Linux desktop looks like:

    [Interface]
    PrivateKey = sj5p3T3TdVfD567++cyyv3ChSnkzIuQlHLNgzLEPXpE=
    Address = 10.42.42.10/32, fc42:4242:4242:4242::10/128

    [Peer]
    PublicKey = B+nP9X0dij38FpF5/lbXe53ua7nl0fk7YMUxuTuKi20=
    AllowedIPs = 10.42.42.0/24, fc42:4242:4242:4242::/64
    Endpoint = wg.example.com:443
    PersistentKeepalive = 25
And I do similarily for the other client hosts and devices.

Obviously I've replaced all of the PrivateKey and PublicKey values with other values here. Other than that this is exactly how the setup is like.

Likewise, where it says "wg.example.com:443" you put the actual DNS name and UDP port (still UDP port 443 if you follow my setup) of the host that runs WireGuard server. Alternatively you could put an IP address instead of a DNS name. But in either case it needs to resolve to a static IP address, and the UDP port needs to be open to incoming traffic from the internet. In many cases you can open ports in your router if you want to host the server on your home computer. But I found it simpler to run my WireGuard server on a VPS for several reasons; VPS can be rebooted remotely, IP address is static, and also I don't need to make any changes to my setup even when moving houses and changing ISP because the server is not running from my home but from a VPS provider.

On my MacBook Pro M1 I am using Wireguard with GUI, which has a tray icon. Installed via App Store.

On my grandfather's desktop I am using Wireguard installed via Homebrew with no GUI, and with a custom launchd config file to have it connect and run always and as soon as the computer is booted. I will omit this file for brevity and clarity but can post the contents of that file as well if you would like me to do so.

On iOS I am using the WireGuard app installed via App Store.

On KDE Neon Linux I am using wireguard installed via apt from the default repositories of KDE Neon Linux.

In the above text I have omitted parts of the setup. Let me know if the details that I have included above are sufficient or if you would like to see a full writeup about the whole thing from start to finish. Note however that I do not have time to make a fully detailed writeup about it at present time so in that case it will need to be something that I write at a later point.

Re: Full WireGuard Support in ProtonVPN for Android

#33
post #6

I've mostly only used OpenVPN for personal VPN needs. Is WG stable/reliable? My OpenVPN tunnels bounce too much.

About the only issue I've had with wireguard is that it leaks DNS so I'm constantly getting alerts from AWS GuardDuty about suspicious DNS queries. The only way around that I can see is to run my own DNS and forward the queries that don't look like they are AWS related to a public resolver like 1.1.1.1. I am really eager to hear details how the VPNs are implementing Wireguard - particularly the address management por…

It doesn't really "leak" DNS, because it has no concept really of DNS resolution. It's a virtual network interface. It will not mess with your resolv.conf.

Are you tunneling out of AWS, or are you using some AWS node as a wireguard server? Sounds like the former with wireguard interface being the default gateway (I am not an AWS user and am just guessing)... Adding a route for the AWS DNS server IP(s) to use the real network interface for traffic instead of the wireguard interface might work. Something like

    ip route add 
    e.g. ip route add 10.0.0/24 dev eth0
Of course, that will make DNS traffic bypass wireguard. If your goal is to hide your DNS queries from AWS except for internal AWS queries, then you will indeed have to run some local resolver that is set up to use the AWS DNS server for AWS-internal queries and some other server (be it a local one or some public one) for everything else.

Re: Full WireGuard Support in ProtonVPN for Android

#34

Earlier quoted context omitted.

There is also a per interface setting, e.g. net.ipv4.conf.virbr0.forwarding

apt purge'd it, reinstalled and updated my Windows client, now getting this entry in the Wireguard log: 2021-10-11 15:18:30.313: [MGR] Failed to connect to adapter interface \\?\SWD#WireGuard[REDACTED]: The system cannot find the file specified. (Code 0x00000002) So, again, I'd like to use it but... dead simple it ain't. Googling that error shows 5 month old reddit posts and not much else. https://www.reddit.com/r/Wi…

Silly I know but do you have the wireguard module loaded?

Re: Full WireGuard Support in ProtonVPN for Android

#35
post #6

I've mostly only used OpenVPN for personal VPN needs. Is WG stable/reliable? My OpenVPN tunnels bounce too much.

I've been running a WireGuard setup for a couple of years now, and have been and continue to be very satisfied with it. - WireGuard server running on my FreeBSD VPS. Always on. - WireGuard client running on my MacBook Pro M1 laptop (and prior to that, on the MacBook Air that I had before this computer). I activate this one when I need to connect to my server or to some other device on the VPN. - WireGuard client runn…

Would you be kind enough to share more about your FreeBSD VPS ? What service / fees and are you happy with it ?

Re: Full WireGuard Support in ProtonVPN for Android

#36

Earlier quoted context omitted.

Regarding stability: WireGuard is widely used, Linus allowed it into the Linux kernel, and I haven't heard anyone mention stability problems. WireGuard is also orders of magnitude more secure than OpenVPN.

> WireGuard is also orders of magnitude more secure than OpenVPN. This entirely depends on how you configure OpenVPN, which encryption to allow it to support, HMAC, hashes, etc. If you configure it with maximum security, it is equally secure as WireGuard. If you configure it less so, then you allow older clients to connect.

I think what the parent post meant isn't necessarily security in the transport, but security in the code.

The wireguard has around 4k LOC [0] and you can read and understand it in a weekend (or faster depending on your skill). Also you not only don't have to configure the ciphers, but you actually can't. If any of the chosen defaults isn't considered secure anymore they will be replaced [citation needed]. So even thought the code resides in the linux kernel you could still reasonably well argue that it is indeed on several levels more secure than OpenVPN. Here [1] is the whitepaper for anyone who is interested.

[0] https://git.zx2c4.com/wireguard-linux/tree/drivers/net/wireg...

[1] https://www.wireguard.com/papers/wireguard.pdf

Re: Full WireGuard Support in ProtonVPN for Android

#37
3 years ago I installed Project Streisand [0] on one of my Digitaocean droplets which configured automatically different VPN protocols and my favorite one has been Wireguard. To this day I still use it on all my devices and it's only last month that I was made aware that the project has been discontinued (Why??). But my Wireguard VPN is still kicking. Works like a charm. On all devices. I can use restricted apps in Africa where my bank app and Disney plus/HBO do not works...

[0]: https://github.com/StreisandEffect/streisand

Re: Full WireGuard Support in ProtonVPN for Android

#38
post #35

Earlier quoted context omitted.

I've been running a WireGuard setup for a couple of years now, and have been and continue to be very satisfied with it. - WireGuard server running on my FreeBSD VPS. Always on. - WireGuard client running on my MacBook Pro M1 laptop (and prior to that, on the MacBook Air that I had before this computer). I activate this one when I need to connect to my server or to some other device on the VPN. - WireGuard client runn…

Would you be kind enough to share more about your FreeBSD VPS ? What service / fees and are you happy with it ?

I'm renting a couple of VPSes from Vultr that I run FreeBSD on. Very low cost, and decent for my current use which include self-hosting email, hosting a couple of websites that receive little traffic, as well as to host the mentioned VPN, and for testing of some backend services that I am developing.

I hope to afford racks of beefy bare-metal servers one day that can sit in colocation data centers and that I can host backend services for others on. But for the time being I do not have the funds for that so a couple of small VPSes for my own use it is :)

Re: Full WireGuard Support in ProtonVPN for Android

#39

3 years ago I installed Project Streisand [0] on one of my Digitaocean droplets which configured automatically different VPN protocols and my favorite one has been Wireguard. To this day I still use it on all my devices and it's only last month that I was made aware that the project has been discontinued (Why??). But my Wireguard VPN is still kicking. Works like a charm. On all devices. I can use restricted apps in A…

FWIW, Algo[1] does the same thing as Streisand but with fewer features and knobs (which, in a VPN server, is a feature in its own right).

FD: My employer.

[1]: https://github.com/trailofbits/algo

Re: Full WireGuard Support in ProtonVPN for Android

#40

Earlier quoted context omitted.

WG isn't just stable, it's so easy to configure and set up you'll wonder why you didn't do it ages ago. At least that's the way it was for me. I stand by my assertion that eventually nobody will talk about Wireguard because everyone will use it for almost everything. It'll be like HTTPS, TLS, or TCP.

I tried setting it up on a VPS on Ubuntu the other day, got it installed after doing some config files, connected to the tunnel, could access the server but not the wider Internet. Made about 4-5 config changes per a bunch of Stackoverflow posts then gave up since nothing worked. Installed OpenVPN instead, took me 2 minutes and worked immediately with far fewer config files changes. I've had this experience before wi…

>I tried setting it up on a VPS on Ubuntu the other day, got it installed after doing some config files, connected to the tunnel, could access the server but not the wider Internet. Made about 4-5 config changes per a bunch of Stackoverflow posts then gave up since nothing worked.

I ran into this also. The docs are quite bad, in the sense that they assume a lot on the part of the reader and only cover a fairly simple use case.

Post reply on HN