5 ms·
Ask HN: Vxlan over WireGuard or WireGuard over Vxlan?
When traversing a public network. Let’s agree going recursive (WireGuard inside VXLAN inside WireGuard) is a bad idea.
- pjd7 9mo agoTell us why you think so at least.
- ronsor 9mo agoReduced MTU chopping off your maximum packet size from all the extra headers and other overhead you're adding?
- DiabloD3 9mo agoI mean, ultimately, thats how Google routes internally. IPSec-equivalent, VXLAN-equivalent, IPSec-equivalent. Prevents any compromised layer from knowing too much about the traffic.
- pixl97 9mo agoInternal is fine because you control things like MTU so you don't have to worry about packet fragmentation/partial loss.
- als0 9mo agoThat seems like an awful amount of overhead for questionable gain.
- _bernd 9mo agoLinks between, and in between data centers use so called jumbo frames with an mtu of over 9000. Not joking.
- xoa 9mo agoWorth mentioning that links at home can use them too, jumbo frame support was rare at one point but now you can get them on really cheap basic switches if you're looking for it. Even incredibly cheap $30 (literally, that's what a 5 port UniFi flex mini lists for direct) switches support them now. Not just an exotic thing for data centers anymore, and it can cut down on overhead within a LAN particularly as you get into 10/25/40/100 Gbps stuff to your own NAS/SAN or whatever.
- tucnak 9mo agoWhat gave you that idea? Internally, Google uses GRE/GENEVE-like stuff but for reasons that have nothing to do with "preventing compromise" or whatever, but because they're carrying metadata (traces, latency budgets, billing ids.) That is to say, encapsulation is just transport. It's pretty much L3 semantics all the way down... In fact, this is more or less the point: L2 is intractable at scale, as broadcast/multicast doesn't work. However, it's hard to find comparisons to anything you're familiar with at Google scale. They have a myriad of proprietary solutions and custom protocols for routing, even though it's all L3 semantics. To learn more: Andromeda https://research.google/pubs/andromeda-performance-isolation-and-velocity-at-scale-in-cloud-network-virtualization/ https://research.google/pubs/andromeda-performance-isolation... Orion https://research.google/pubs/orion-googles-software-defined-networking-control-plane/ https://research.google/pubs/orion-googles-software-defined-...
- DiabloD3 9mo agoWhat gave me that idea? Talks and research papers from Google network engineers over the past decade.
- tucnak 9mo agoWhere are you getting at VXLAN-equiv, IPsec-equiv, etc. specifically? ALTS/PSP is not "IPsec-equivalent"
- zeroxfe 9mo agoThe last time I was there, there were many layers of encap, including MPLS, GRE, PSP, with very tightly managed MTU. Traffic engineering was mostly SDN-managed L3, but holy hell was it complex. Considering that Google (at the time) carried more traffic than the rest of the Internet combined, maybe it was worth it.
- volkadav 9mo agohttps://man.openbsd.org/vxlan.4#SECURITY https://man.openbsd.org/vxlan.4#SECURITY seems unambiguous that it's intended for use in trusted environments (and all else being equal, I'd expect the openbsd man page authors to have reasonable opinions about network security), so it sounds like vxlan over ipsec/wg is probably the better route?
- wmf 9mo agoWhat problem is being solved here?
- mbreese 9mo agoWhat are you trying to do? Why are you trying to link networks across the public internet?
- justsomehnguy 9mo agoWG is L3 transport VXLAN is L2-like tranport over L3 You can have EoIP over WG with any VLANs you like. You can have a VXLAN over plain IP, over EoIP, over WG, over IPSec. Only WG and IPSec (with not NULL sec) do providecany semblance ofvencryption in transit And mandatory X\Y problem.
- inetknght 9mo ago> Let’s agree going recursive (WireGuard inside VXLAN inside WireGuard) is a bad idea. But it's not necessarily a bad idea. It depends on the circumstances, even when traversing a public network.
- tucnak 9mo agoFor traversing public networks, simply consider BGP over Wireguard. VXLAN is not worth it.
- ghxst 9mo agoI've used wireguard for a while, not sure why I never considered doing BGP over it, might make for a fun weekend project.
- tucnak 9mo agoBGP is vastly superior to any L2 make-believe trash you can imagine, and amazingly, it often has better hardware offloading support for forwarding and firewalls. For example, 100G switches (L3+) like MikroTik's CRS504 do not support IPv6 in hardware for VXLAN-encapsulated flows, but everything just works if you choose to go the BGP route. L2 is a total waste of time.
- iscoelho 9mo agoAny ASIC switch released in the last decade from Cisco/Juniper/Arista supports EVPN/VXLAN in hardware. EVPN is built on BGP. This has become the industry standard for new enterprise and cloud deployments. The lack of support for hardware EVPN is one of the many reasons that Mikrotik is not considered for professional deployments.
- hdgvhicv 9mo agoMikrotik is used for professional deployments all over the world. Right tool for the right job. People who think one size fits all are not professional.
- iscoelho 9mo agoIf I can source an enterprise Cisco/Juniper/Arista ASIC switch that is 1) rock-solid 2) full featured 3) cheaper - which I can - there is unfortunately no rationale where Mikrotik would be applicable in any professional project of mine. With that said, I love Mikrotik for what it is: it is very approachable and it fills a niche. I believe it has added a lot of value to the industry and I'm excited to see their products mature.
- uberduper 9mo agoWhat are your discovery mechanisms? I don't know what exists for automatic peer management with wg. If you're doing bgp evpn for vxlan endpoint discovery then I'd think WG over vxlan would be the easier to manage option.
- uberduper 9mo agoIf you actually want to use vxlan ids to isolate l2 domains, like if you want multiple hypervisors separated by public networks to run groups of VMs on distinct l2 domains, then vxlan over WG seems like the way to go.
- kjuulh 9mo agoI use vxlan on top of wireguard in my hobby set up. Probably wouldn't recommend it for an actual production use-case. But that is more or less because of how my homelab is setup (Hetzner -> Home about 20ms latency roundtrip). I considered dropping my root wireguard and setting up just vxlan and flannel, but as I need NAT hole punching I kind of need the wireguard root so that is why i ended up with it. Going Wireguard inside the vxlan (flannel) in my case, would likely be overkill, unless I wanted my traffic between nodes between regions to be separated from other peers on the network, not sure where that would be useful. It is an easy way of blocking out a peer however, but that could just as well be solved on the "root" wireguard node. There might be some MTU things that would be messed up going nested wireguard networks.
- q3k 9mo agoDrop the VXLAN. There's almost never a good reason to stretch L2 over a WAN. Just route stuff across.
- cjaackie 9mo agoThis is the correct answer, routing between subnets is how it’s suppose to work. I think there are some edge cases like DR where it seems like stretching L2 might sound like a good idea, but it practice it gets messy fast.
- formerly_proven 9mo agoVXLAN makes sense in the original application, which is to create routable virtual LANs within data centers.
- dgl 9mo agoThis. Instead you can create multiple Wireguard interfaces and use policy routing / ECMP / BGP / all the layer 3 tricks, that way you can achieve similar things to what vxlan could give you but at layer 3. There's a performance benefit to doing it this way too, in some testing I found the wireguard interface can be a bottleneck (there's various offload and multiple core support in Linux, but it still has some overhead).
- iscoelho 9mo agoEVPN/VXLAN fabrics are becoming industry standard for new deployments. MACSEC/IPsec is industry standard for site-to-site. You'd be surprised to know that this is especially popular in cloud! It's just abstracted away (:
- stevefan1999 9mo agoIs there a WireGuard equivalent that does L2 instead of L3? Need this for a virtual mesh network for homelabbing. I have this exact setup, running VXLAN or GENEVE over WireGuard tunnel using KubeSpan from Talos Linux but I simply think having L2 access would make load balancer much easier
- kjuulh 9mo agoYou can see my reply below: https://news.ycombinator.com/item?id=46609044 https://news.ycombinator.com/item?id=46609044 I believe our setups are pretty equivalent. I achieve load balancing by running native wireguard on a vps at hetzner, I've got a native wireguard mesh, I believe Talos can do the same, where the peers are manually set up, or via. tailscale etc. I then tell k3s that it should use the wireguard interface for vxlan, and boom my kubernetes mesh is now connected. flannel-iface: "wg0" # Talos might have something similar. I do use some node-labels and affinities to make sure the right pods end up in the right spot. For example the metallb annoucer always has to come from the hetzner node. As mentioned in my reply below, it takes about 20ms roundtrip back to my homelab, so my sites can take a bit of time to load, but it works pretty well otherwise, sort of similar to how cloudflare tunnels would work, except not as polished. My setup is here if it is of help https://git.kjuulh.io/kjuulh/clank-homelab-flux/src/branch/main https://git.kjuulh.io/kjuulh/clank-homelab-flux/src/branch/m...
- dietr1ch 9mo agoIs this your use case? https://docs.zerotier.com/bridging/ https://docs.zerotier.com/bridging/
- stevefan1999 9mo agoI used to like ZT but they went BSL. Plus it is not running in kernel unlike WireGuard. Memory usage is extremely high. I used to run my K8S homelab through ZT as well. Latency is extremely bad. What I wanted is more like meshed L2TPv3, but L2TPv3 is extremely hard to setup nowadays
- viraptor 9mo agoZeroTier does L2.
- H8crilA 9mo agoNot sure I understand, but why not Tailscale?
- sy26 9mo agoIn my case, Tailscale does not implement K8S CNI.
- notepad0x90 9mo agoFor site-so-site ovelay networks, use wireguard, vxlan should be inside of it, if at all. Your "network" is connected by wireguard, and it contains details like vxlan. Even within your network, when crossing security boundaries across untrusted channels, you can use wireguard. Others mentioned tailscale, it's cool and all but you don't always need it. As far as security, that's not even the consideration I had in mind, sure wireguard is secure, but that's not why you should have vxlan inside it, you should do so because that's the purpose of wireguard, to connect networks securely across security/trust boundaries. it doesn't even matter if the other protocol is also wireguard, or ssh or whatever, if it is an option, wireguard is always the outermost protocol, if not then ipsec, openvpn,softether,etc..whatever is your choice of secure overlay network protocol gets to be the tunnel protocol.
- p0w3n3d 9mo agoThere's also headscale - an OSS clone, if you're too paranoid to leave your keys to a company
- iscoelho 9mo agoVXLAN over WireGuard is acceptable if you require a shared L2 boundary. IPSec over VXLAN is what I recommend if you are doing 10G or above. There is a much higher performance ceiling than WireGuard with IPSec via hardware firewalls. WireGuard is comparatively quite slow performance-wise. Noting Tailscale, since it has been mentioned, has comparatively extremely slow performance. edit: I'm noticing that a lot of the other replies in this thread are not from network engineers. Among network engineers WireGuard is not very popular due to performance & absence of vendor support. Among software engineers, it is very popular due to ease of use.
- kosolam 9mo agoHow is IPSec performance better than wg? I never heard this before, it sounds intriguing.
- hdgvhicv 9mo agoIf you have an edge device which implements hardware IPsec at 10g+ but pushes WireGuard to software on an underpowered cpu then sure.
- rebewhd 9mo agoWhile that's true, I'm not sure it's because of something inherent in IPsec vs WireGuard. It's more likely due to the fact that hardware accelerators have been designed to offload encryption routines that IPsec uses. One wonders what WG perf would look like if it could leverage the same hardware offload.
- jrm4 9mo agoWhenever I see threads like this, I think its related but I'll be honest, my networking understanding might be limited. I use Tinc as a daily driver (for personal things) and have yet to come up with a new equivalent, given that I probably should. Does Vxlan help here?
- iscoelho 9mo agoVXLAN is for L2 between campuses. It is commonly used in enterprise and cloud networks.
- imiric 9mo agoTinc is a fantastic piece of software. Very easy to use and configure, and it just works. These days I lean towards WireGuard simply because it's built into Linux, but Tinc would be my second choice.
- denkmoon 9mo agoNot super related to the OP but since we're discussing network topologies; I've recently had an insane idea that nfs security sucks, nfs traversing firewalls sucks, kerberos really sucks, and that just wrapping it all in a wireguard pipe is way better. How deranged would it be to have every nfs client establish a wireguard tunnel and only have nfs traffic go through the tunnel?
- eugenekay 9mo agoI built a NFS3-over-OpenVPN network for a startup about a decade ago; it worked “okay” for transiting an untrusted internal cloud provider network and even over the internet to other datacenters, but ran into mount issues when the outer tunnels dropped a connection during a write. They ran out of money before it had to scale past a few dozen nodes. Nowadays I would recommend using NFS4+TLS or Gluster+TLS if you need filesystem semantics. Better still would be a proper S3-style or custom REST API that can handle the particulars of whatever strange problem lead to this architecture.
- QuantumNomad_ 9mo ago> How deranged would it be to have every nfs client establish a wireguard tunnel and only have nfs traffic go through the tunnel? Sounds good to me. I have my Wireguard tunnel set up so that only traffic intended for hosts that are in the Wireguard network itself are routed over the Wireguard tunnel. I mostly use it to ssh into different machines. The Wireguard server runs on a VPS on the Internet, and I can connect to it from anywhere (except from networks that filter Wireguard traffic), and that way ssh into my machines at home while I am away from home. Whereas all other normal traffic to other places is unaffected by and unrelated to the tunnel. So for example if I bring my laptop to a coffee shop and I have Wireguard running and I browse the web with a web browser, all my web browsing traffic still gets sent the same normal way that it would even if I didn’t have the tunnel running. I rarely use NFS nor SMB, but if I wanted to connect either of those I would be able to that as well over this Wireguard setup I have.
- throw0101c 9mo ago> How deranged would it be to have every nfs client establish a wireguard tunnel and only have nfs traffic go through the tunnel? See perhaps NFS over TLS: * https://datatracker.ietf.org/doc/html/rfc9289 https://datatracker.ietf.org/doc/html/rfc9289 * https://access.redhat.com/solutions/7079884 https://access.redhat.com/solutions/7079884 * https://www.phoronix.com/news/Linux-6.4-NFSD-RPC-With-TLS https://www.phoronix.com/news/Linux-6.4-NFSD-RPC-With-TLS
- sciencesama 9mo agovxlan inception is fun ! said no one ever !
- hbogert 9mo agoWhere is the inception?
- solaris2007 9mo agoIf a situation where production vxlan is going over Wireguard arises, then someone in leadership failed to plan and the underlying Wireguard tunnel is coping with that failure. No doubt, OP already knows this and all too well. The problem is no doubt a people problem. I have learned to overcome these people problems by adhering to specific kinds of communication patterns (familiar to Staff Engineers and SVPs). There is no reason that Wireguard over vxlan over Wireguard can't work, even with another layer (TLS) on top of Wireguard. Nonetheless it is very suboptimal and proprietary implementations of vxlan tend to behave poorly in unexpected conditions. We should remember that vxlan is next-get vlan. The type of Wireguard traffic encapsulated within the vxlan that comes to mind first is Kubernetes intra/inter-cluster pod-to-pod traffic. But this Wireguard traffic could be between two legacy style VMs. If I were the operator told "you need to securely tunnel this vxlan traffic between two sites" I would reach for IPsec instead of Wireguard in an attempt to not lower the MTU of encapsulated packets too much. Wireguard is a layer 4 (udp) protocol intended to encapsulate layer 3 (ipv6 and legacy ip) packets. If I were the owner of the application I would bake mutual TLS authentication on QUIC with "encrypted hello" (both elliptic and PQ redundant) into the application. The applications would be implemented in Rust, or if not practicable to implement the application in Rust I would write into the Helm chart a sidecar that does such a mutual TLS auth part (in Rust of course). I would also aggressively "ping" in some manner through the innermost encapsulation layer. If I had tenancy on a classic VM doing Wireguard over the vxlan I would have "ping -i 2 $remote_inside_tunnel_ipv6" running indefinitely.
- deleted 9mo ago[deleted]