From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: sh0rch <sh0rch@iwl.dev>,
"wireguard@lists.zx2c4.com" <wireguard@lists.zx2c4.com>
Subject: Re: gutd — WireGuard traffic obfuscator via TC/XDP eBPF (no kernel patches)
Date: Thu, 26 Mar 2026 17:30:44 +0100 [thread overview]
Message-ID: <871ph6o8nf.fsf@toke.dk> (raw)
In-Reply-To: <GVXP251MB07901AF0DC973F21B13077F88349A@GVXP251MB0790.EURP251.PROD.OUTLOOK.COM>
sh0rch <sh0rch@iwl.dev> writes:
> Hi Toke,
>
> Thanks a lot for taking a look, really appreciate it!
>
> I actually started with Aya, but ended up losing some hair fighting
> the verifier :) libbpf_rs just worked for me in the end.
Yeah, writing the BPF code in Rust is hard, still, but you could still
use Aya to load, and avoid the extra dependency on libbpf? Not sure how
much of a difference that makes in practice (I just noted you were
chasing small binaries, so maybe that would help?)
> About the veth. I’m trying to keep things compatible with stock
> WireGuard and also need proper routing through a relay/gateway. Inside
> my perimeter I can use plain WG, but to get traffic out I rely on a
> gateway, so I need packets to go through the normal networking stack.
> If everything happens in eBPF, it won’t even reach netfilter. That’s
> why I went with veth, also gives a bit more flexibility than tun/tap.
Hmm, not sure I undestrand what you mean by "rely on a gateway"? What
breaks if it's run only on TC, exactly?
In any case, if you need the extra step you could still have the BPF
programs run on the other side of the veth device, but still just as a
pair of TC ingress/egress programs? That would still simplify the BPF
side of things, and make the usage of veth devices optional.
> Ideally this would all live in AF_XDP + userspace, but that’s hard to
> rely on in VPS environments where AF_XDP support is still limited.
Don't think you'd get very good performance doing that, AF_XDP has a
pretty severe performance penalty if you want to re-inject packets into
the kernel. So unless you're actually creating an obfuscating middlebox,
going with BPF like you did here seems like a better solution :)
-Toke
prev parent reply other threads:[~2026-03-26 16:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 18:59 gutd — WireGuard traffic obfuscator via TC/XDP eBPF (no kernel patches) sh0rch
2026-03-23 17:43 ` Jason A. Donenfeld
2026-03-23 22:41 ` sh0rch
2026-03-24 10:42 ` Toke Høiland-Jørgensen
[not found] ` <GVXP251MB07901AF0DC973F21B13077F88349A@GVXP251MB0790.EURP251.PROD.OUTLOOK.COM>
2026-03-26 16:30 ` Toke Høiland-Jørgensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ph6o8nf.fsf@toke.dk \
--to=toke@toke.dk \
--cc=sh0rch@iwl.dev \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox