Why Not WireGuard
blog.ipfire.org
blog.ipfire.org
The section discussing dynamic IP addresses seems to be based on a misunderstanding of Wireguard. The IP addresses that must be statically established in Wireguard are the addresses used inside of the tunnel, and are independent of the public (internet) IPs of the machines involved. The wg-dynamic daemon mentioned is a system for dynamically allocating IP addresses in the tunnel, and has so far not been completed, at least in part because it's not very obvious why you would want to do this (although in general the development of an in-band configuration standard for Wireguard has useful implications).
Wireguard allows you to identify the endpoint using a DNS name, which means you can handle a 'server' with a dynamic IP address by dynamically updating the DNS record - a common approach that is no doubt exactly what ipfire supports doing for ipsec.
In the end, though, the article just suffers from being an apples-to-oranges comparison. Wireguard is a VPN tunnel protocol implementation, ipfire is some sort of GUI frontend for managing a bunch of network tools. Of course ipfire has quite a few more features than wireguard.
But to be fair, this doesn't work perfectly (especially if you have certain firewall rules that block UDP packets if they're not part of the what the firewall thinks is the same "connection", if both peers change their IP at the same time, or if the peer whose IP changed was rebooted or reconfigured before the other peer received a packet from its new IP addreds) but it really does work surprisingly well. For those (important) corner-cases, I would imagine that higher-level tooling such as NetworkManager would do the DNS checks you're talking about.
The non-roaming end (end with a known endpoint) will update the IP of the roaming end every time a handshake occurs. The issue the OP is getting at though is when both ends are roaming. In this case the, er, "more roaming" peer needs some way to find the other peer. There are a lot of technically interesting ways that we could solve this problem, but in practice it's pretty much always solved by dynamically updating a DNS record. I would say Wireguard handles this scenario about as well as anything else (maybe a little worse, see sibling comment).
Another approach would be using a "meet-me" relay with a fixed IP, such as TURN. This also has the advantage of handling NAT on both sides (which would be a common issue with a roaming-to-roaming situation). I can't think of any reason it's impossible to run Wireguard through TURN but I can't find any examples of anyone doing so, likely in part because the TURN client is usually embedded in the application and is a bit complicated. Still, might be a hobby project to implement it for Wireguard.
That said, I do believe both IPv6 and OpenVPN will have this exact same problem - IP change will not be reflected until something forces setup to repeat. The difference would be that these, at least I do believe, will re-resolve on retries. Wireguard doesn't really have a sense of "retrying the connection" which makes it sort of philosophically difficult for it to do so.
Once I move into the network that has the respective VPN endpoint, the subnets that are routable via wg become routable via ethernet/wifi which have higher priority, so the traffic will go directly.
If you don't know some of these parameters chances are you won't be able to establish the tunnel no matter how hard you try.
Plus you need to know all the vendor quirks as establishing IPsec from Cisco to Fortigate or Sophos is not straightforward.
Then you may end up playing with NAT-exclusions, SNAT/DNAT if both sides of the tunnel have the same or overlapping IP ranges.
Setting up IPsec is definitely not an exchange of 4 parameters...
If the value of WG is just that it forces all these parameters to be static then the best thing we could do is come up with the “WireGuard” IPSec profile call it a day.
It's a very weird assertion that the Wireguard devs just threw the software together at random, choosing parameters for "no apparent reason".
> What if in a few months ChaCha20 gets proven insecure due to collisions found or easy factorisation? What can WireGuard offer to mitigate that? Shouldn't then also browsers implement only TLS1.3 and ed25519 ciphers because they are currently the most secure?
TLS is famously susceptible to downgrade attacks. (https://blog.ivanristic.com/2013/09/is-beast-still-a-threat.... etc.)
Ultimately, it's a value judgement. You can either have resistance to downgrade attacks (which have themselves proven to be quite problematic), or you have interoperability across multiple versions and configurations of endpoints. Increase the configurability of the protocol, and you massively increase the complexity. Increased complexity means increased testing burden and ultimately increased risk.
If Wireguard needs to be fixed in a backwards-incompatible way, then we'll find ourselves with a new version of Wireguard that doesn't work with the old version.
Right, and maybe this is actually in improvement in security overall but it just externalizes the downgrade attack since once there are multiple versions of WG floating around with different vendors/clients only supporting a specific version you end up similarly vulnerable since you need to run multiple WG endpoints of different versions.
And since it’s a kernel module you’ve made the hassle of doing so very annoying compared to one line in a config file.
IPSec feels messy and complex specifically because the world is messy and complex. WG is fantastic and I love it dearly for “the 90% case” where I have total control over all peers.
The article is from 8 years ago so I would suggest that the fame has mostly faded. TLS downgrade attacks are not a thing in practice. A system with non-upgradable and broken crypto is much worse than something that requires a MITM attack to get at the broken crypto. I am not sure why there are opinions to the contrary. In either case you still have to fix things. The non-upgradable case will just be much much harder.
This entire paragraph is nonsense—that isn’t what a stream cipher means. ChaCha20 encrypts 512 bits at a time.
The rest of that section goes on to describe how AES-NI is available everywhere except where it isn’t, and ChaCha20 can’t take advantage of hardware acceleration except where it can—then makes a blanket conclusion that AES will “outperform ChaCha20 in every single scenario” with all those exceptions conveniently ignored.
(Are there correct, nuanced arguments to be made here one way or the other? Of course. But this article isn’t one of them.)
If:
1) your market is fragmented
2) many clients are cheap phones that don't support AES-NI
3) you can differentiate them so that you don't penalize better clients
Then yeah it makes sense to use Chacha20-Poly1305 for some of these clients.
But choosing Chacha20-Poly1305 over AES-GCM all the time doesn't, and I'm not sure why Wireguard does that (besides trying to be trendy).
Which are those mythical cheap phones? All the Qualcomm chips from the last N years have AES instructions, right?
Compared to these routers, you average cheap cellphone is overpowered. 800 Mhz single or dual core is circa 2012 smartphone.
And this is on the gateway, not on the client, potentially serving several clients. Chacha20-Poly1305 absolutely murders AES there. AES won't even saturate 20MBit+ upload.
Dan Bohen told me that in Stanford Cryptography courses.
1. The insistence that because complicated protocols are still in wide use, that complications are not a big deal. This is weird. Are we just not acknowledging all of the costs from complicated protocols? Look at TLS.
2. Focusing on a broken benchmark and encryption algorithms and coming to the conclusion that Wireguard is not faster seemingly with no actual testing. Well, maybe it somehow isn’t, but in my experience I get significantly better performance using WireGuard as a drop-in replacement for OpenVPN in a couple of circumstances, on top of better latency. I am no expert but I’d be willing to bet there is some truth to the performance claims.
IPSec, of course, has its issues too, but that’s an entirely different story.
But it won’t be faster than IPsec (basically the same framing overhead), and won’t be replacing IPsec.
Regarding IPSEC: I have never been able to reliably configure and use IPSEC, and I'm in IT for several decades. Not that it can't be done, it's just too complex, so much so that it only makes sense for large companies to hire and train specialists who can do it. If wireguard offers similar throughput but eliminates complexity, I'd say it makes sense to replace IPSEC with it, if only to reduce complexity
And that's just cipher negotiation. Don't get me started, what the clients expect to be in the certificates as CN and SAN. You have IPSec gateway behind NAT (so the internal IP of the gateway is different than the public IP), with dynamic IP, so you need to use DNS instead of fixed IP? Good luck with configuring your Windows clients.
[1] I.e. libreswan has deprecated MD5 and SHA1 in their default algo list; if you need them, you must find out how to configure the client that uses it as a backed. Ubiquiti routers on the other hand support SHA1 as their strongest auth algorithm, so there is no match, leading to forum posts like this: https://community.ui.com/questions/L2TP-unusable-on-Fedora/d..., where people butcher it and end up using 3DES and DH group 2. Yay, great for security.
I can only see one reason, their choice of Chacha20-Poly1305 (which should be re-considered IMO)
In a world where Mario Kart Tour can get millions of people on all sorts of smartphones to update within a day of release, there is no actual reason why anyone else should be unable to.
All of these businesses have painted themselves into a corner - they've said that they don't care about being able to update software within a year, and they've built processes around that, and now they whine that they can't update software within a year. Tough. Design things from day one with the assumption that updates will happen.
Then you can patch software vulnerabilities in a timely fashion and not get attacked via well-known VPN software flaws like Travelex did. If you genuinely care about your business, you'll already want to figure this out.
(Which is the other problem with this article: "secure" isn't really about cryptographic algorithms, these days. There are tons of good cryptographic algorithms. Just don't use the bad ones. "Secure" is about whether you're using them right, whether you've got memory safety vulnerabilities, whether you've got logic flaws, etc. Every piece of complexity in your software - including cryptographic agility - imperils "secure," and the best defense is being able to confidently apply patches to your software wherever it's being run.)
It appears he’s not even tried WireGuard. The argument that it does not work for road warriors is a misunderstanding of where static IPs are required (inside the tunnel, not outside).
As one who has tried WireGuard, I’m happy to say it can already replace OpenVPN and IPSec for the 80% case. And not only that, it is in practical experience much easier to install and set up, and much faster to connect and has excellent latency and bandwidth. It is great for road warriors, I’ve been using it for that purpose for six months or so and have never had any problems with it.
Sure, there are some VPN features WG will not implement, for those you’ll have to stick with legacy VPNs like IPSec or OpenVPN.
The rest is just FUD.
These end users likely do not already have wireguard on their devices so as part of the software rollout you assign them an ip. A /24 gives you enough addresses for over 200 people and a /8 future proofs you for a much larger company size. You can also just spin up different wireguard networks for different departments or even think about using IPV6.
This is the same for any large rollout of technology really. There may be some hands on effort but nothing that couldn't be automated with a spreadsheet and a script.
I have my own ipsec deployment and this argument always seems shaky to me.
Here is how long it takes to establish ipsec connection on my laptop: https://streamable.com/27des
The cipher suite used is aes256gcm16-prfsha384-ecp384 for IKE and aes256gcm16-ecp384 for ESP which is in line with CNSA https://apps.nsa.gov/iaarchive/programs/iad-initiatives/cnsa... I'm using Strongswan which I highly recommend mostly due to their comprehensive set of tests for virtually every scenario https://www.strongswan.org/testing/testresults/
I did not see any meaningful difference in bandwidth between ipsec and wireguard. As a bonus, ipsec is natively supported by Windows 10.
I don't use OpenVPN which I think is worse in that regard due to packet shuffling between the kernel and userspace but between ipsec and wireshark the only discernible difference for me is the effort in setting it up.
> It is not very hard for me to conclude that WireGuard is not ready - yet.
> It has been drafted as a lightweight and fast solution to some problems of the existing solutions. Unfortunately it has sacrificed many features that will be relevant for many users and therefore will not be able to replace IPsec and OpenVPN.
> For that we need to add at least IP address assignment, pushing configuration like DNS servers and routes.
This has certainly been the case for me. My use case for a VPN is a typical road warrior set-up. In my experience Wireguard seems like it's probably great for people who are accustomed to setting up custom VPN configurations already, and in fact probably simplifies the steps in doing so. But as someone who just needs a set-it-and-forget-it configuration to remote in and forward my connections that just consistently works, trying to get Wireguard working was hours of misery.
There's enough tooling built around OpenVPN that you can generate a simple .ovpn configuration that just works and does everything you want in a few minutes. You don't need to be a professional network admin or have a lot of experience configuring VPNs. I hope Wireguard gets to that point because I really do believe in its technical superiority.
With OpenVPN you have all the bells and whistles, and it's easy to get tripped up in the myriad of configuration options. With WireGuard you start with the fundamentals: establishing the tunnel interface. Then you start adding routing, DNS etc. to suite your specific scenario.
You're 100% correct about this, but I think it's easy to miss that you could say very similar things about all sorts of very well designed, low-level technologies, that for years no one has bothered to build the necessary high level tooling around! Magic Wormhole is another great example: it's a brilliant system, it's even very easy to use from the terminal, but nobody has bothered to build a GUI around it or create any of the more complicated (but awesome!) tooling that the wormhole protocol allows. (At least as of the last time I looked into this.)
So maybe people knowledgeable enough to build it just waited for it, or went to apply PAKE like rdv on top of webrtc.
https://www.stavros.io/posts/how-to-configure-wireguard/
It takes hours to set up if you don't know how (and the docs aren't amazing), but it should take you ten minutes using my article.
For what it's worth this did seem easy to follow, I just know that when I tried to follow a guide similar to this one a while back I couldn't get it to work for a windows client.
I used StavrosK's guide (thank you!) to put together two scripts a while back, one for generating a new server config file, and one to generate a new client config, outputting the config to a file as well as to a QR code on stdout. You can copy the client.conf file over to the Windows machine and import the configuration via the "Import tunnel(s) from file..." option in the Wireguard client, or scan the QR code output from the mobile device clients via "Create from QR code".
Here's my script for generating a client cert: https://cdn.seedno.de/txt/wireguard-certgen. It assumes Wireguard is already configured on the server on interface wg0, and is using the default port of 51820/UDP, though both are configurable via variables. For reference, the accompanying setup script is https://cdn.seedno.de/txt/wireguard-setup. Both scripts require a bit of customization to match your environment (you may want to be particularly careful with the iptables firewall PostUp/PostDown commands), but hopefully they can serve as a starting point to figure out any issues you encountered last time you tried.
[0]: https://www.henrychang.ca/how-to-setup-wireguard-vpn-server-...
This comes out in, for example, the "Accessing your home LAN" part of your article. It has a bunch of iptables magic that I understand, but presumably shouldn't have to in order to use WireGuard. Actually, the device that makes the most sense to use as a WireGuard server is my router, which is based on BSD; so presumably I'd need modify your commands to get this working on my OS! With OpenVPN, on the other hand, I can literally install a package for my firewall (OPNsense) and it's all done for me with a few clicks. That's what I mean by robustness: I'm capable of getting OpenVPN working on just about any computer, including my GUI based BSD router. WireGuard just doesn't have that yet.
It always sends me down a rabbit hole of watching and listening to recordings of people shouting perkele. I always trying to think of a similar word in US English but never can think of anything.
So I looked up the meaning and went on a long ride on the train of distraction.
At first I honestly thought it was some state actor level prank because of how everyone insisted it was impossible to translate.
Most of the sites being sketchy top5 looking sites really played into my suspicion. Or lots of good beer.
Edit: fixed something.
I did, however, make it harder for myself by setting it up on a Unifi gateway. Where every push of an invalid config would put the gateway in a boot loop, bricking my internet connection for a few minutes.
For the interested: https://github.com/Lochnair/vyatta-wireguard
You might be interested in https://github.com/FossoresLP/vyatta-wireguard (no associaton, just a repo that I've found has the newer releases).
There seems to be a installer script (https://github.com/mafredri/vyatta-wireguard-installer) that will persist the deb between updates. This issue https://github.com/mafredri/vyatta-wireguard-installer/issue... will switch it to the port you suggest.
Perhaps I'll set that up. Given recent global events I've got some time, but not much need for a remote access solution right now!
What's missing for me: * a good "connected" indicator * session tracking/logging
Pretty sure I can solve the tracking problem with iptablea or some not very clever network monitoring software.
Wireguard is (sort of) stateless by design, so this would be tough.
It's actually quite simple under the hood and frankly can't be made much simpler while still achieving the security objectives. The often wildly overcomplicated configuration syntax together with subtle differences in implementation defaults, cipher and parameter naming are what I see creating challenges for vendor interoperability.
The existence of all the configuration options is the underlying problem. Well, the wealth of options plus the near-universal behavior when you have a mismatched configuration: either a vague yet misleading error message or just a silent refusal to work.
Combine that with arbitrary vendor restrictions on that wealth of options and it’s just a guaranteed waste of time, E.g., neither GCP nor VMWare VeloCloud let you configure key lifetimes, so they can never connect to each other. Aside from the vendor stupidity, that’s a protocol problem: how does refusing to connect when the two sides disagree on key lifetime help security?
That's a compelling pitch for WireGuard. (And VPNs as a whole.)
Yes it's mostly bullshit. No it won't ever change. FIPS is a check box and its all about liability and things like insurance. It has zero to do with tech and everything to do with standards and bureaucratic and legal requirements. Nobody ever got fired for using FIPS approved stuff. Use something different like WG and it (and you) will be blamed for any breach.
Note that I'm not sure to what extent this is true in Europe, but there you have another problem. In my experience European industry is just culturally super conservative and does not like to adopt new things. So even if they don't have the FIPS boat anchor, they're just terribly change-averse.
It takes an experienced sysadmin a whole 20 min of his life to install the program, play with it and judge it (I guess, it took me a whole evening before I understood that the client needed its own config which can be created on the server, it's nice that you can then just scan a QR code with your phone though to configure it). Or even less when he talks to colleagues. This whole sentence immediately puts me off.
I'm just a home server guy, no vpn experience. Messed with WireGuard for a night and left it installed. Have been using it ever since with no issues. How did I get in the middle of this mess?
Except raspberry pis. Exactly the type of crowd attracted by simple home-rolled tunnels like wg
EDIT: Seems like >700 Mbps is possible with the pi4. Not bad, IMO: https://www.reddit.com/r/WireGuard/comments/d8k605/gigabit_w...
Its an unexpected use case, but it is much more stable and flexible than a lot of "better" solutions.
Without cryptographic agility, this is not possible. In TLS, you would have a very specific key exchange algorithm with a very specific encryption and auth algorithm.
But this does not mean that versioning is not supported. When some primitive is too old, a V2 API (again with a precise algorithm combination) can be created, and clients and servers can keep using both V1 and V2 for some time.
"massive"? Citation needed. I never used a dynamic IP address on a server, for obvious security and reliability reasons.
Nonsense. That's what userspace tooling is for. You automatically deploy a new version with a new configuration file to use a new server. Over time, laptops & co migrate to it. Later on you revoke the previous version and shut down the server.
It's done all the time.
I also feel like the language used in wg-dynamic is very dismissive and counter productive:
> WireGuard currently uses static addresses everywhere. This is because that is mostly a better way to design your network. But in some cases, insane people want dynamic IP addresses or other dynamic configuration.
https://github.com/WireGuard/wg-dynamic/blob/master/docs/ide...
So now I'm insane for not wanting to configure every connected client?
I currently have two use cases:
1) A road-warrior setup for iOS and MacOS devices with connect-on-demand if needed. Authentication is done using user certificates issued by an internal CA. This gives me secure access to check my security cameras, etc, and makes it completely frictionless.
2) A persistent tunnel to a cloud provider's network. The cloud provider only supports IPSec, so WireGuard isn't even an option here. This is mainly just homelab-type playing around, not serious work.
I think WireGuard can do the first use case, but without centralized control over what routes, split tunnels, DNS, IP address assignments, etc, are pushed to the clients. I'd have to manage deploying all of this to the clients by hand instead of letting StrongSwan do it for me.
On the IPSec side, setting everything up was a huge amount of effort. My first use case probably took a total of a day and a half (over the course of a couple of years as the solution changed and evolved) to get it into its current state. I'm not including getting the PKI stuff figured out since I wanted that for other stuff anyway.
The second use case took me about three days to get set up satisfactorily. Most of this is because I can't see the logs on the cloud provider side, so debugging it is a matter of waiting, sometimes for six hours, for the tunnel to stop passing traffic, followed by tweaking settings based on what the error might be, and repeating. IPSec's complexity[0] really works against it here. I expect that WireGuard would be significantly easier for this use case if the cloud provider supported it.
[0] https://wiki.strongswan.org/projects/strongswan/wiki/ConnSec... - I've been staring at this page way too much lately.
I mean it's debatable whether one likes this approach better than more complex cipher negotiation protocols -- clearly these things should not be thought about in absolutes or "best practices", but as tradeoffs with different pros and cons. Wireguard seems to prioritize protocol complexity above upgradeability, that's not to say one is better than the other.
>Simple answer: It isn't.
It's really hard to not dismiss this guy as an utter clown when it's so obvious he's making these claims without even trying wireguard.
OK, if you want to claim bias...
I own the company behind pfSense, and am sponsoring the work to put wireguard in the FreeBSD kernel (and will pay for the additional work to put this work in pfSense.)
He's right, wireguard will be no faster than IPsec given equivalent encryption schemes (say, if IPsec were to use ChaCha20-Poly1305 for the bulk encryption) because the framing overheads are within a few bytes of each other.
And if you're willing to compare AES-GCM to ChaCha20+Poly1305, then AES will, indeed, almost always be faster. The author makes note of the AES-NI instructions, and Wireguard's claim to be able to use the vector (AVX512) instructions,
> The WireGuard whitepaper mentions due to AVX512, ChaCha20-Poly1305 will outperform AES-NI1, but that instruction set extension will only be available on large processors which again won't help with smaller and mobile hardware that will always be faster with AES-NI.
However:
1) using the vector units from inside the kernel will involve a lot more overhead if anything else (say, in user land) is using the vector unit(s). Welcome to vector context switch overhead. Tons of huge registers to save and restore.
2) near future versions of AVX512 [https://eprint.iacr.org/2018/392.pdf] will support vector versions of the AES-NI (VAES) and PCLMULDQD (VPCLMULDQD) instructions. These have been timed at over 150Gbps. Yes, that's correct.
FWIW, x86 AESNI instructions also operate on the XMM vector units. Doing AESNI in the kernel involves much of the same overhead as accelerated Chacha.
(No comment on AVX512 and future directions — I'll take your word for that part.)
It is also possible to recognize without trying WireGuard that it has more protocol overhead, access to fewer ciphers than IPsec, and access to no ciphers that IPsec does not support. This means that IPsec encryption will be as fast or faster in all cases and IPsec framing will be more efficient in all cases, all else being equal.
But what does that have to do with anything? Wireguard certainly doesn't compete with IPsec ASICs.
>all else being equal
Unfortunately we live in the real world where this assumption doesn't hold true.
I appreciate that you are not making that claim and I'm glad that we agree. However, that "WireGuard is faster than IPsec" is exactly what the authors are claiming without qualification, and supporting with controversial data, on the official website. As such I believe examination of the claim is justified.
> Unfortunately we live in the real world where this assumption doesn't hold true.
Yet we are in a rational discussion of the merits of the two protocols, in which outliers that introduce additional variables should be first discovered, then examined individually, rather than dismissing the first order effects out of hand on the supposition that outliers influenced by additional variables may exist.
The same blog post also extensively discusses OpenVPN, then goes on to state "Is WireGuard faster than other VPN solutions? Simple answer: It isn't."
This question presented in the post wasn't "Is WireGuard faster than all other VPN solutions?"
>Yet we are in a rational discussion of the merits of the two protocols, in which outliers that introduce additional variables should be first discovered, then examined individually, rather than dismissing the first order effects out of hand on the supposition that outliers influenced by additional variables may exist.
Are we discussing protocols or the implementations? One of these seems far more practical to me.
I'd personally love to see this benchmark where a sane IPsec configuration running on regular commodity hardware beats WG throughput.
A kernel module give it the highest amount of privileges it can have. Meanwhile, we all know of the "principle of least privilege". Not to mention any potential bugs can kill the entire system.
While a kernel module may have some performance gains, I'm sceptical about the trade-offs here. And I definitely don't think "VPN" falls into what we usually think a kernel should be responsible for.
from wireguard.com
License The kernel components are released under the GPLv2, as is the Linux kernel itself. Other projects are licensed under MIT, BSD, Apache 2.0, or GPL, depending on context.
The tldr of this seems to be "wireguard isn't as complicated as openvpn / ipsec infrastructure". Which is true. It's not, it has a much smaller scope.
You'll need the code to run it, the plan for authentication and authorization, documentation, testing, maintenance plans, training, rollout plans, fallback plans, etc.
Maybe that is working at the wrong level? Maybe it’s possible to build that feature atop WireGuard, without failing open (potentially catastrophic if you are using it as a VPN).
This is the same in TLS setups (including OpenVPN) and in S/MIME (where it's a reminder that S/MIME probably is only delivering theatre and not any real security to your users).
There are other things for other use cases, I'm looking at glorytun [0] right now as a start. I particularly want the multipath stuff. Right now, it has the ability to do AEGIS where AES extensions are available, and fall back to ChaCha20-Poly1305. I personally think libsodium should look at adding a ChaCha12, and maybe ChaCha8, mode; 20 rounds seems pretty excessive, all things considered, and it has a considerable performance cost.
By the way, given that the hardware would probably have dramatically more throughput and less complexity, I do wonder why CPU vendors aren't looking at ChaCha acceleration. It's not strictly necessary for timing attack reasons, since ChaCha doesn't really have these problems in software, but it seems to be better in every way than AES, given equal effort.
RE: the multipath functionality is interesting to me, because I want to set up in some locations where directional radio could degrade in one direction or another, or maybe only satellite is available sometimes. I think probably the mad/glorytun multipath stuff is not that smart yet, but it's a start.