← Back to context

Comment by maisem

9 hours ago

I solved this problem by building/running a custom tailscale client that connects to two tailnets at the same time (https://github.com/maisem/tailmix)

I was just wondering yesterday if it'd be possible to have a tailscale client, or multiple tailscale clients in their own network namespaces, that could connect to multiple networks.

The slightly tricky part would be managing a local NAT that blends the two networks, and also does MagicDNS to answer on those NATed IPs. If routes conflicted, I guess you'd have to pick one?

Seems very doable though.

  • yeah that's kinda what it does. It sets up two tsnet servers connected to two different tailnets and exposes them through a shared TUN device. It does the magic of allocating safe IPs to each host so that they don't overlap and does some leasing so that IPs aren't accidentally reassigned. It also does the MagicDNS thing so that DNS returns the "effective IP".

    I wanted it to work on macOS so couldn't rely on network namespaces.