-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit Node Support #13
Comments
Not the developer, but don't think it does. Actually, it does the opposite. This should be possible with some routing magic, but I wouldn't know how to do that. |
I don't use this script, because I prefer configuring things with nix instead. However, I just figured out how to get exit nodes working and this seems like a good place to share. (Disclaimer: I am not very knowledgeable about networking, so figuring this out was an extremely slow process of educated guesswork and trial and error.) If you run
These are your system's routing rules. The number on the left is a priority, the text on the right is a rule telling the system when to use a particular routing table. Rules 0, 32766, and 32767 exist on basically every Linux system from what I gather. Rules 5210, 5230, 5250, and 5270 are put there by Tailscale and always have the same priority numbers. Rules 5208 and 5209 are put there by Mullvad, which tries to ensure its rules always come before everything else. We need the rule at 5209 to come after Tailscale's rules, which we can do by running: ip rule del not from all fwmark 0x6d6f6c65 lookup 1836018789
ip rule add pref 6000 not from all fwmark 0x6d6f6c65 lookup 1836018789 Now if you run
Success! Well, almost. Tailscale is probably broken at this point, and you need another firewall rule to unbreak it. Modify the excludeOutgoing chain to look something like this:
I lowered the priority from 0 to -100 to make sure these apply before Mullvad's firewall rules, and also added the rule One last hurdle is that any time you disconnect and reconnect to Mullvad, it will undo the routing table reordering that we did. I plan on writing a cron job that periodically checks for this and corrects it, but I haven't actually gotten around to that yet. |
Also, make sure you use Mullvad's privacy check page before using an exit node configured like this. On some browsers (e.g. Firefox for Android) your Tailscale address is leaked through WebRTC, creating a unique fingerprint that could be used to identify your VPN traffic. |
Thanks @ajgrf. When I run |
Does your exit node function without Mullvad running? Do you have any extra firewall rules hanging around? (Check with It's also possible that the NixOS firewall is helping me out too. When I enabled tailscale, I set the NixOS option |
I think these are the nftables rules that relate to the
Again, I don't know how to interpret this. My notes say it's important for exit nodes and subnet routing, though. Hopefully it's helpful to you trying to get your own exit node working. |
Here's my two cents.
What I did was simply edit the file
as suggested by @ajgrf and then, made a script like the following one.
I was able to use Tailscale on Android to surf the web as if I was connected to Mullvad with this configuration. If the Mullvad check page says that you have DNS leaks, try setting, on the host used as exit node, a custom DNS address and set the one of the Mullvad DNSes (in my case, 100.64.0.27, for I set it on dnsmasq). This works both with and without Mullvad being enabled. |
Hi, I saw your comment on tailscale/tailscale#2880. Does this script support using the node as an exit node (routing all traffic from the Tailscale network through Mullvad)?
The text was updated successfully, but these errors were encountered: