News for hackers. Stuff that matters.
Re:WireGuard 1.0 for Linux 5.6 by myu701 on Monday March 30, 2020 @09:04AM (#22727667)
Someone else can give a much better comparison than me, this is just to get you started.

Compared to the 80% use case of OpenVPN, Wireguard is:

1. Much less code. A few thousand lines of code vs lots more for OpenVPN

2. Speedier. WG does UDP traffic so there is less overhead on the protocol level for syncs acks etc.

3. Easier on mobile battery life due to decreased complexity

For one example use case comparing them side by side, see PiVPN, which I use to setup a Raspberry Pi Zero W on my home network, create a client key for my phone, open a single port forward to the pivpn server, download the wireguard app, scan the qr code the pivpn key generated, and poof, I can check a box and 'be' on my home network, behind my pihole, and with access to my LAN resources.

OpenVPN can do that usecase with pivpn as well but its more processor intensive and a little more setup vs wireguard.

Re:WireGuard 1.0 for Linux 5.6 by kertis on Monday March 30, 2020 @09:08AM (#22727691)
> little more setup

A lot more! PKI infrastructure, chiphersuites and so on and so forth...

By the way OpenVPN also can work with UDP, even it's default mode.

Re:WireGuard 1.0 for Linux 5.6 by K0SM0S on Monday March 30, 2020 @09:51AM (#22727980)
It's a lot more if you do it all manually, however for most "common" use cases, one should probably go with automatically generated config files.

For instance pfSense provides you with single-click configs for any target platform, with certs, credentials etc. properly tied to some ACL or ID management system, etc. It's neat and pain-free and just works.

You could learn all the theory underneath (I mean systems, IT, not the crypto!) and do it manually (and you probably should for a big-enough infra, or specific-enough use-case), but that will be premature optimization I think.

Basic VPN is easy (take a weekend to learn / implement and you'll have all the great benefits of VPNs). Wireguard is "just" more efficient by an order of magnitude as I see it, it'll become the de facto low-profile implementation me thinks.

Re:WireGuard 1.0 for Linux 5.6 by kertis on Monday March 30, 2020 @10:37AM (#22728333)
First setup always needs to be manual.
Re:WireGuard 1.0 for Linux 5.6 by K0SM0S on Monday March 30, 2020 @10:53AM (#22728476)
... yes, obviously? : )

We might not be using the word "manual" to mean the same here.

I meant not writing the whole xml json yaml or whatever yourself, manually copying certs and credentials etc — you're likely to make mistakes, it's tedious and useless most of the time. You rather use tools like Viscosity. Just efficient / best practice sysadmin.

You obviously need access to the target machine in the first place... it's a VPN setup.

Re:WireGuard 1.0 for Linux 5.6 by Brakenshire on Monday March 30, 2020 @11:16AM (#22728661)
Makes a good argument for having a mobile phone on the mainline kernel, rather than on some ancient kernel with a thousand hacks layered on top. Something like Pinephone should get access to this more quickly than a standard Android device.
Re:WireGuard 1.0 for Linux 5.6 by middleclick on Monday March 30, 2020 @09:41AM (#22727917)
On that note, I wish and hope Wireguard did TCP as well. Some countries block UDP traffic or at least throttle it.
Re:WireGuard 1.0 for Linux 5.6 by kertis on Monday March 30, 2020 @10:38AM (#22728338)
As I know WireGuard team have no plans and desire for that.
Re:WireGuard 1.0 for Linux 5.6 by djsumdog on Monday March 30, 2020 @12:50PM (#22729663)
huh .. OpenVPN is UDP by default but you can force it to TCP (we had to do that at one University site that would only open limited tcp ports for us).

I also discovered Wireguard cannot bind to a specific adapter or IP address if you have multiple address on a server. That might not seem like as a big a deal since it only responds to fully authenticated packets, but it does mean that outgoing packets could be leaving from a different IP address than incoming packets.

It's weird that something that's now making it into mainline can't do this very simple kind of bind that almost every other userlevel service, and OpenVPN, can do.

Re:WireGuard 1.0 for Linux 5.6 by RcrdBrt on Monday March 30, 2020 @01:53PM (#22730354)
Re:WireGuard 1.0 for Linux 5.6 by jeltz on Monday March 30, 2020 @09:46AM (#22727941)
Maybe the best solution is to use a tool like https://github.com/wangyu-/udp2raw-tunnel.
Re:WireGuard 1.0 for Linux 5.6 by middleclick on Monday March 30, 2020 @09:51AM (#22727979)
I know, but the performance takes a massive hit. Have you tried it? Maybe it was something I did wrong.
Re:WireGuard 1.0 for Linux 5.6 by labawi on Monday March 30, 2020 @12:32PM (#22729430)
Native wireguard is kernel-only. Udp2raw creates a detour via userspace, so more CPU time, delay, jitter ..

Was it worse than you would expect? Worse than say openvpn or wireguard-rs/wireguard-go?

Re:WireGuard 1.0 for Linux 5.6 by RcrdBrt on Monday March 30, 2020 @01:54PM (#22730368)
It's not that bad. Overhead is less than a full TCP encapsulation. I use it all the time
Re:WireGuard 1.0 for Linux 5.6 by api on Monday March 30, 2020 @10:24AM (#22728246)
ISPs or countries?
Re:WireGuard 1.0 for Linux 5.6 by fnordsensei on Monday March 30, 2020 @11:33AM (#22728803)
In some cases, countries. In the country I'm thinking of (name omitted on purpose), you have an effective choice of two ISPs, both government-controlled.
Re:WireGuard 1.0 for Linux 5.6 by api on Monday March 30, 2020 @01:17PM (#22729943)
Do they actually block/throttle all UDP?

What about encrypted TCP? Do they block/throttle everything but web and recognized traffic? If that's the case wrapping WG or ZeroTier or whatever in TCP would do nothing since it would still look like a weird unrecognized protocol with a max entropy (encrypted) data stream.

Re:WireGuard 1.0 for Linux 5.6 by alexellisuk on Monday March 30, 2020 @10:54AM (#22728492)
Have you taken a look at inlets / inlets PRO? Might be a suitable replacement for your use-case where UDP is not available. https://docs.inlets.dev/
Re:WireGuard 1.0 for Linux 5.6 by vbezhenar on Monday March 30, 2020 @09:11AM (#22727715)
I wonder how WireGuard compares to IPsec with regards to the mobile battery. AFAIK IPsec implemented in kernel while WireGuard uses user-space implementation on mobile devices, at least for now.
Re:WireGuard 1.0 for Linux 5.6 by yjftsjthsd-h on Monday March 30, 2020 @10:06AM (#22728111)
I'm pretty sure some ROMs already have kernel support, although I don't know details.
Re:WireGuard 1.0 for Linux 5.6 by kertis on Monday March 30, 2020 @10:22AM (#22728236)
For some Android kernels official WireGuard application supports in-kernel module. Fox example for pixel 3.
Re:WireGuard 1.0 for Linux 5.6 by packetlost on Monday March 30, 2020 @09:44AM (#22727930)
The code has been merged into the kernel as of 5.4(?) I believe, but we won't see that on mobile for quite awhile. I'm guessing IPSec will still have a lead on mobile for awhile for that reason, not that it has sort of majority on there anyway.
Re:WireGuard 1.0 for Linux 5.6 by fullstop on Monday March 30, 2020 @10:54AM (#22728490)
It was merged in 5.6, which was tagged less than 24 hours ago.
Re:WireGuard 1.0 for Linux 5.6 by packetlost on Monday March 30, 2020 @12:09PM (#22729143)
Ah, I remember reading about it like a month ago or so but I though it had already been released
Re:WireGuard 1.0 for Linux 5.6 by cyphar on Tuesday March 31, 2020 @11:28AM (#22738441)
You're not misremembering -- Linux has releases every 6-7 weeks. WireGuard was merged into 5.6-rc1 a little over a month ago and the story was posted to HN from memory.
Re:WireGuard 1.0 for Linux 5.6 by AnIdiotOnTheNet on Monday March 30, 2020 @10:40AM (#22728356)
Wiregard may be speedier (I've never used it so I can't say for certain), but OpenVPN can also use UDP.
Re:WireGuard 1.0 for Linux 5.6 by api on Monday March 30, 2020 @10:41AM (#22728371)
WG is much faster in our tests than OpenVPN, and a bit faster than IPSec depending on the system. OpenVPN uses UDP too but OpenVPN is kind of slow.
Re:WireGuard 1.0 for Linux 5.6 by zajio1am on Monday March 30, 2020 @11:32AM (#22728793)
Or much slower on systems with AES-NI, but relatively slow CPU. Like are used in some hi-end SOHO routers.

I did not test IPSec vs WireGuard, but scp from/to my home router/NAS is about three times faster with AES (used by IPSec) than with Chacha20 (used by WG).

Re:WireGuard 1.0 for Linux 5.6 by api on Monday March 30, 2020 @01:16PM (#22729934)
Good point. AES hardware acceleration makes a massive difference. It's why ZeroTier 2.x will use AES. Tiny boxes that lack HW acceleration are generally not used in cases where they're pushing enough bandwidth to matter anyway.
Re:WireGuard 1.0 for Linux 5.6 by jeltz on Monday March 30, 2020 @01:32PM (#22730103)
No, but boxes who lack hardware acceleration might care about battery life.
Re:WireGuard 1.0 for Linux 5.6 by api on Monday March 30, 2020 @02:40PM (#22730851)
How many 32-bit ARM phones without AES units are there still around?
Re:WireGuard 1.0 for Linux 5.6 by bjoli on Monday March 30, 2020 @05:41PM (#22732534)
i did test it. in my setup we couldn't get IPsec to not drop a lotmof packages, so the benefits of aes-ni was lost in retries. switching that IPsec setup to chacha20-poly1305 actually made most of the drops go away.

I have no idea what was going on, but wireguard and IPsec was comparable in that test, with ispec being sliiiightly faster. the network has almost no latency, so if the retries remain on slower networks, that would change.