Exit nodes quickstart
This quickstart guide explains how to set up a tailnet device as an exit node and routes another device's traffic through it. For more in-depth information, refer to the main Exit nodes topic.
Advertise a device as an exit node
To use a tailnet device as an exit node, select an OS and complete the steps.
-
Download and install the Tailscale client.
-
Open a terminal session on the device and enable IP forwarding.
If your Linux system has a
/etc/sysctl.ddirectory, use: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.confOtherwise, use:
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf sudo sysctl -p /etc/sysctl.conf -
In the terminal session, advertise the device as an exit node.
sudo tailscale set --advertise-exit-node -
Go to the Machines page of the admin console.
-
Locate the device in the list. It should display the Exit Node badge.
-
Select the
menu, then select Edit route settings.
-
Check the Use as exit node box, then select Save.
Grant access to use an exit node
By default, any user in your tailnet can use a configured exit node. You don't need to add any grants or ACLs.
This changes if you customize your tailnet's access control policy. For example, suppose you replace the default policy with one that only lets your developers access a few internal servers:
{
"grants": [
{
"src": ["group:developers"],
"dst": ["tag:prod"],
"ip": ["*"]
}
]
}
Your developers can still reach the production servers, but they can no longer use an exit node. The policy never grants access to autogroup:internet, so Tailscale has no permission to route internet traffic through the exit node.
A common point of confusion is to add the exit node device itself as the destination. That only permits connections to the exit node, such as SSH. It does not permit using the device as an internet gateway.
To permit exit node use, add a grant or ACL whose dst is autogroup:internet. This grants permission to route internet traffic through any configured exit node rather than to connect to the exit node device itself.
A grant or ACL for any public IP address also lets the source devices select an exit node. The exit node then forwards only the traffic that your policy permits. Refer to Grant access to use the exit node for details.
Use an exit node
On the device that routes its traffic through the exit node, select the exit node.
On Linux, run tailscale set with the --exit-node flag, passing the exit node's Tailscale IP address:
sudo tailscale set --exit-node=<exit-node-ip>
You can find the IP address from the admin console or by running tailscale status.
To confirm that your traffic routes through the exit node, check your public IP address with an online tool. The exit node's public IP address displays instead of your device's local one.
To stop using an exit node, run the --exit-node flag without passing in an IP address.
sudo tailscale set --exit-node=
For the steps on macOS, Windows, Android, iOS, and tvOS, and for options such as local network access, refer to:
Use an exit node
Configure devices to route their internet traffic through an exit node, and control local network and DNS behavior.