Tailscale Part 4: Route Your Internet Traffic Through Home With Exit Nodes
Learn how Tailscale exit nodes let you securely route your internet traffic through your home connection while traveling or using public Wi-Fi.
In the previous article, we explored MagicDNS and how it makes connecting to our homelab easier by replacing IP addresses with readable names. So far, we've mostly focused on accessing devices remotely, but Tailscale can do something else that's worth exploring.
Let's say you're staying at a hotel or using public Wi-Fi somewhere. Rather than sending your internet traffic directly through that network, you could route it through your home internet connection instead. Tailscale makes this possible using something called an exit node, and you can set one up using a Linux server you already have running.
What is a Tailscale exit node? #
Normally, Tailscale only routes traffic intended for your private network. When you browse the internet, your connection continues using whatever network you're currently connected to.
An exit node changes that behavior by allowing another device on your tailnet to handle your internet traffic. If you configure a Linux server at home as an exit node, your laptop can send its internet traffic through an encrypted Tailscale connection to that server, which then forwards it onto the internet.
Websites will see your home's public IP address instead of the address assigned by the network you're currently using. Your traffic is encrypted between your device and the exit node, although the connection from your home to the destination still relies on the usual protections, such as HTTPS.
Why would you want this? #
One practical benefit is using your home internet connection while traveling. This can be helpful when accessing services that expect connections from your residential IP address. It also provides an encrypted path through an unfamiliar local network.
For those of us already running servers around the clock, it's an appealing feature because we don't necessarily need additional hardware. However, your connection speed will depend partly on your home's upload bandwidth, and the server needs to remain online.
Setting up an exit node #
We'll use an existing Linux server with Tailscale installed. First, enable IP forwarding, which allows the server to pass traffic between network interfaces.
Run the following commands:
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.confMake sure your firewall has appropriate forwarding rules, with unintended forwarding denied by default.
Next, tell Tailscale that this server should advertise itself as an exit node:
sudo tailscale set --advertise-exit-node
sudo tailscale upNow open the Tailscale administration dashboard and locate your server. Open its menu, select Edit route settings, and enable Use as exit node.
Save your changes, and your server should be available as an exit node to permitted devices.
Connecting through your exit node #
Open the Tailscale application on your phone or laptop and find the Exit Node setting. Your newly configured Linux server should appear as an available option.
Select it, and Tailscale will begin routing your internet traffic through that machine. If you need direct access to devices on the network you're currently using, there's also an option to allow local network access.
To test your connection, visit a website that displays your public IP address. You should see your home internet connection's public IP rather than the one assigned by your current network.
When you're finished, simply select None in the Exit Node settings to return to normal internet routing.
What's next? #
We've now covered quite a bit of what makes Tailscale useful for a homelab. In the final part of this beginner series, we'll look at securing your tailnet and controlling which devices can access your network.
After all, making remote access convenient is only half the job. Making sure the right devices have access is just as important.

Comments 0
Join the conversation.
No comments yet. Be the first to comment.