feat: add TUN-less relay mode - #145
Open
tionis wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
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_tunconfiguration 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements #44 making it easier to set up simple relay nodes.