Interest: kernel TUN overlay transport (acting as exit node / subnet router on small Linux routers)

Open
#486 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
linux, rust

Research direction

This is a proposal for a kernel TUN transport as an alternative to NetstackActor, not a defined change yet. Start by reading NetstackActor and the NewOverlayTransport channels in ts_runtime, then the Config in ts_control where HostInfo.RoutableIPs would be set. Done means the maintainers have agreed on a direction and it has been split into small PRs, so wait for their reply before writing code.

Written by the indexing model from the issue text.

Description

#405 covers using an exit node. We built the opposite on top of tailscale-rs, for small routers where Go tailscaled gets OOM-killed (MikroTik mAP lite: MIPS 24Kc, 64 MB RAM, 16 MB flash):

  • a TunActor as an alternative to NetstackActor, using the same NewOverlayTransport channels (kernel TUN, batched reads with backpressure);
  • HostInfo.RoutableIPs sent from ts_control::Config;
  • extra inbound routes (0.0.0.0/0, ::/0) in the route updater;
  • netstack made an optional feature of ts_runtime.

The kernel does forwarding and NAT. Result on the mAP lite: ~11 Mbit/s, ~8.6 MB peak RSS, about 3 MB on flash (static musl, opt-level = "z"). Tested against a lab Headscale + derper; related fixes reported in #481, #439 and #485.

Would you be interested in this direction? If so, we could split it into small PRs following CONTRIBUTING.

AI disclosure: the code was written with an AI assistant (Claude) under human direction. It was tested on a lab tailnet and on real hardware.

Dominant language
Rust
Stars
1.2k
Forks
75
Avg merge
1d 13h
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tailscale/tailscale-rs

All issues in tailscale/tailscale-rs

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.