pbr: add docs/tor.md reference notes - #151
Closed
egc112 wants to merge 3 commits into
Closed
Conversation
Tor is the one supported "interface" that is not a network interface, and almost everything about how it behaves has been undocumented: the five hardcoded redirect rules, which policy options are discarded, how a destination-based Tor policy depends on dnsmasq, and why a .onion setup can fail silently on a stock OpenWrt. Adds docs/tor.md, a reference covering the mechanism end to end -- how the rules are built and hooked into fw4, source-matched versus domain-matched policies and what each depends on, the ways a domain-matched .onion setup fails without any error surfacing, symptom-driven diagnostics, and the two valid dnsmasq designs. Links it from README.md. The docs site carries a shorter user-facing Tor section and links here for the depth, so the fiddly parts live in one place rather than being restated and drifting. Not packaged: the Makefile installs explicit paths under files/, so docs/ is repo-only and adds nothing to the device. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Erik Conijn <egc112@msn.com>
The five-rule listing implied that udp dport 80/443 carry traffic into Tor. They do not: Tor's TransPort accepts TCP only, so nothing is listening for the UDP that gets redirected to it. The practical effect is to blackhole UDP on those ports rather than route it -- which does stop QUIC/HTTP3 on 443 slipping past Tor, but by refusing it, not by carrying it. Also notes the mirror-image asymmetry: Tor's DNSPort is UDP-only, which is why there is no tcp dport 53 rule and why adding one would redirect TCP DNS to a port that cannot answer it. Both confirmed against the Tor manual. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Erik Conijn <egc112@msn.com>
The reference torrc used VirtualAddrNetwork 10.192.0.0/10 -- the deprecated option name, and the third-party value this same file cautions against a few paragraphs earlier. The pbr docs show VirtualAddrNetworkIPv4 172.16.0.0/12, so a reader following both hit a mismatch. Uses the current option name and the value OpenWrt's Tor client guide sets, and says so, with a pointer back to the note that Tor's own default differs. Also drops the hardcoded range from the diagram, since the paragraph directly below it says not to assume one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Erik Conijn <egc112@msn.com>
Collaborator
Author
|
Closing — It now lives at No content is lost — the file is unchanged apart from a relative link back to the README section. |
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.
What
Adds
docs/tor.md— reference notes on how Tor routing works inpbr— and links it fromREADME.md.Tor is the one supported "interface" that isn't a network interface, and almost everything about how it behaves has been undocumented. Between them, the docs carried a single line:
That leaves out the five hardcoded redirect rules, which policy options are discarded, how a destination-based Tor policy depends on
dnsmasq, and why a.onionsetup can fail silently on a stock OpenWrt — the last of which took a long support thread to get to the bottom of.Contents
pbrcannot verify..onionpolicy fails quietly — ten of them, including OpenWrt's/usr/share/dnsmasq/rfc6761.confdeclaring.onionlocal and overriding anyserver=/onion/127.0.0.1#9053.nslookuppair that splits "Tor is fine, dnsmasq is losing the answer" from "the problem is in Tor".Why in this repo rather than the docs site
The docs site gets a shorter, user-facing Tor section (see the companion PR below) and links here for the depth. Keeping the fiddly parts in one place stops the two copies drifting — particularly the
rfc6761.confdetails and the reference torrc, which would otherwise be restated in both.Packaging
Not packaged. The Makefile installs explicit paths under
files/, sodocs/is repo-only and adds nothing to the device.Note on provenance
The file carries a header stating it was written by Claude from a support-thread investigation, and that while most of it is verified against the source, the dnsmasq and Tor manuals, and tests on a live router, some is inference. Several confident-sounding conclusions during that investigation turned out to be wrong before the real cause surfaced, and the header says so. Happy to soften or drop that if it reads wrong for a repo file.
Companion
mossdef-org/docs.mossdef.org#27 adds the docs-site section that links here. That link points at
blob/1.2.3/docs/tor.md, so this PR should merge first or the published link 404s.🤖 Generated with Claude Code