Skip to content

feat: add TUN-less relay mode - #145

Open
tionis wants to merge 2 commits into
encodeous:mainfrom
tionis:allow-no-tun
Open

feat: add TUN-less relay mode#145
tionis wants to merge 2 commits into
encodeous:mainfrom
tionis:allow-no-tun

Conversation

@tionis

@tionis tionis commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This implements #44 making it easier to set up simple relay nodes.

Copilot AI review requested due to automatic review settings July 29, 2026 06:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements “TUN-less” operation for relay nodes so Nylon can run in environments (e.g., containers) where creating a host TUN interface is unnecessary or undesirable, aligning with issue #44.

Changes:

  • Adds no_tun configuration support, including validation to prevent incompatible combinations (e.g., use_system_routing).
  • Introduces a userspace-only dummy TUN device and wires it into both physical and virtual WireGuard device creation paths.
  • Updates docs, sample config, and integration coverage to exercise relaying through a TUN-less node.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
state/validation.go Rejects no_tun when combined with use_system_routing.
state/validation_test.go Adds unit test coverage for the new validation rule.
state/config.go Adds NoTun (no_tun) to LocalCfg.
polyamide/tun/dummy.go Implements a dummy TUN device that blocks reads until closed and discards writes.
polyamide/tun/dummy_test.go Adds tests for dummy device semantics (name/MTU/write/close behavior).
core/sys_virtual.go Uses dummy TUN when NoTun is enabled in virtual mode.
core/sys_physical.go Uses dummy TUN when NoTun is enabled in physical mode and avoids darwin utun naming in that case.
core/nylon_wireguard.go Skips alias/interface init and system sync when NoTun is enabled.
integration/routing_test.go Adds an integration test for routing through a TUN-less relay.
example/sample-node.yaml Documents no_tun and fixes post_down indentation.
docs/reference/config.mdx Documents no_tun and its constraint with use_system_routing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread integration/routing_test.go Outdated
@encodeous encodeous linked an issue Jul 29, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement tun-less mode

2 participants