3 ms·
Since WireGuard is Layer 3, what would is everyone's use case of doing Layer 2 on it? Or, what can it improve over existing solutions? I have tried to do the sa
by usui 3y ago
Since WireGuard is Layer 3, what would is everyone's use case of doing Layer 2 on it? Or, what can it improve over existing solutions? I have tried to do the same for a bit while still learning networking, but ran into Layer 3 limitations.
- zokier 3y agoOne example usecase would be to try to tunnel something like BOOTP/DHCP/PXE/TFTP stack, which iirc is bit tricky with only L3 tunneling.
- simonjgreen 3y agoYes, this is common among those who don't understand how DHCP Relay works
- systems_glitch 3y agoMany don't, and I suspect searching for "how to do on VPN" yields "turn on Layer 2 tunneling."
- simonjgreen 3y agoPeople who require layer 2 require either a protocol which is neither TCP nor UDP or they need devices in the same broadcast domain
- touisteur 3y agoCan one do multicast over wireguard?
- alyandon 3y agoFrustratingly enough, apparently not as I could never get it to work. It is pretty easy to set up a vxlan tunnel over wireguard if you absolutely need stuff like that though.
- touisteur 3y agoOh hadn't thought about that, thanks. 'need' is a big word here but sometimes you can't change the client and server apps so, having support for the basic (although niche) features in the lower layers helps migrating smoothly.
- systems_glitch 3y agoProbably the most common use case is letting Avahi/Bonjour/etc. or DHCP work across a tunnel.
- tjohns 3y agoBonjour is built on top of DNS. You don't need a layer 2 tunnel to make it work. However, it normally does rely on multicast. Rather than trying to bridge broadcast domains (which is going to cause performance issues), a more efficient option is to setup an Avahi mDNS reflector on either end of the tunnel to rebroadcast mDNS packets. See, for example: https://www.reddit.com/r/WireGuard/comments/g80bxf/comment/hr9bqi4/?utm_source=reddit&utm_medium=web2x&context=3 https://www.reddit.com/r/WireGuard/comments/g80bxf/comment/h... Alternatively, there's also a Wide-Area Bonjour service that works over unicast and doesn't need any special packet forwarding, provided you run a Bonjour-aware DNS server: http://www.dns-sd.org/serversetup.html http://www.dns-sd.org/serversetup.html https://help.dyn.com/bonjour-and-dns-discovery/ https://help.dyn.com/bonjour-and-dns-discovery/ (More generally, Layer 2 tunnels are best avoided unless you really need them for something arcane, like IPX or NetBIOS.)
- simonjgreen 3y agoYou are technically correct (best kind of correct) however, in reality, I see folks using L2 tunnels to solve for bonjour etc all the time. Usually those without networking knowledge to solve the forwarding.
- systems_glitch 3y agoYeah, you can do it the right way...or you can just tunnel layer 2 and forget about it. I see it done a fair bit for both Bonjour/Avahi and DHCP (why?).
- teleforce 3y agoThe best way to perform something like this on Layer 2 is to use Shortest Path Bridging (SPB) based on IEEE 802.1Q-2018. However the Linux kernel does not yet fully supporting this feature natively although the standard has been out for quite sometime and already being supported by commercial network solutions and the popular Open vSwitch (OVS) [1]. [1] Ask HN: Project ideas for a Linux kernel module: https://news.ycombinator.com/item?id=35785158 https://news.ycombinator.com/item?id=35785158
- wmf 3y agoSPB uses MAC-in-MAC encapsulation which won't help you run over Wireguard. You need some flavor of Ethernet over IP like GRE, VXLAN, or GENEVE.