# Setting up Tailscale on Segfault

In this article, you will learn how to use Tailscale to connect two computers which are both behind NAT (e.g. can not reach each other directly). This technique can also be used to access a remote network (the victim) from the safety of your workstation (the attacker).

This article uses [Segfault's Disposable Root Servers](https://thc.org/segfault) as a playground to show how to connect your workstation to Segfault (and route all traffic from your workstation via Segfault - the '*victim*').

---

## On the Victim

1. Install Tailscale on the victim:
    

```bash
wget https://pkgs.tailscale.com/stable/tailscale_1.52.1_amd64.tgz
rm -rf tailscale
tar -xvf tailscale_1.52.1_amd64.tgz
cp -r tailscale_1.52.1_amd64 tailscale
rm -rf tailscale_1.52.1_amd64 tailscale_1.52.1_amd64.tgz
```

1. Start Tailscale with *userspace-networking* option (no need for `/dev/tun`). The `tailscaled.state` file holds sensitive information - keep it safe.
    

```bash
tailscale/tailscaled \
    --tun=userspace-networking \
    --statedir=tailscale_data \
    --socks5-server=localhost:1055 \
    --outbound-http-proxy-listen=localhost:1055
```

1. Executing `tailscale/tailscale up` will show a URL. Use a browser to connect to that URL. This will 'add' the exit node to your Tailscale user.
    

```bash
tailscale/tailscale up
export ALL_PROXY=socks5://localhost:1055/ HTTP_PROXY=http://localhost:1055/ http_proxy=http://localhost:1055/
export PATH=/sec/root/tailscale/:$PATH
```

You may desire the use of your Segfault server for exit node purposes. In which case you add `--advertise-exit-node` to the first command. If you have an auth key, then you can use it with `--authkey=AUTHKEY`. This may or may not require changes to the Tailnet ACL rules. After this, you should be successfully connected. You can check the IPv4 and IPv6 addresses on the Tailscale dashboard, or directly on Segfault. Change `-4` to `-6` for IPv6. This IP is only accessible within the secure VLAN tunnel. You may consider disabling key expiry and further tweaking the Tailnet settings to your liking.
