2023-03-15 12:17:55 -06:00
# Exit Nodes
## On the node
Register the node and make it advertise itself as an exit node:
```console
$ sudo tailscale up --login-server https://my-server.com --advertise-exit-node
```
If the node is already registered, it can advertise exit capabilities like this:
```console
$ sudo tailscale set --advertise-exit-node
```
2024-05-19 15:49:27 -06:00
To use a node as an exit node, IP forwarding must be enabled on the node. Check the official [Tailscale documentation ](https://tailscale.com/kb/1019/subnets/?tab=linux#enable-ip-forwarding ) for how to enable IP forwarding.
2023-05-06 13:09:23 -06:00
2023-03-15 12:17:55 -06:00
## On the control server
```console
$ # list nodes
$ headscale routes list
2024-09-03 05:04:20 -06:00
ID | Node | Prefix | Advertised | Enabled | Primary
1 | | 0.0.0.0/0 | false | false | -
2 | | ::/0 | false | false | -
3 | phobos | 0.0.0.0/0 | true | false | -
4 | phobos | ::/0 | true | false | -
2023-03-15 12:17:55 -06:00
$ # enable routes for phobos
$ headscale routes enable -r 3
$ headscale routes enable -r 4
2024-09-03 05:04:20 -06:00
2023-03-15 12:17:55 -06:00
$ # Check node list again. The routes are now enabled.
$ headscale routes list
2024-09-03 05:04:20 -06:00
ID | Node | Prefix | Advertised | Enabled | Primary
1 | | 0.0.0.0/0 | false | false | -
2 | | ::/0 | false | false | -
3 | phobos | 0.0.0.0/0 | true | true | -
4 | phobos | ::/0 | true | true | -
2023-03-15 12:17:55 -06:00
```
## On the client
The exit node can now be used with:
```console
$ sudo tailscale set --exit-node phobos
```
2024-09-03 05:04:20 -06:00
Check the official [Tailscale documentation ](https://tailscale.com/kb/1103/exit-nodes#use-the-exit-node ) for how to do it on your device.