SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor

How to Run Tailscale Subnet Router for VPS

Make your VPS advertise private IP ranges to Tailscale. Learn route approval, reboot-safe IP forwarding, and route acceptance for Linux clients.

Wetin Tailscale subnet router dey do

Tailscale subnet router na one machine wey dey advertise one complete range of private IP addresses to your tailnet, so every device for the tailnet fit reach addresses for that range even though nothing for there dey run Tailscale. Your tailnet na your private Tailscale network: na all the devices wey sign in to one account or organisation. Exit node na the feature wey people dey mix am up with, and e dey do opposite work. E dey send all the traffic from one device go through the VPS, so the VPS become the route wey that device dey use reach public internet.

One sentence for each. Subnet router make one private network reachable from the tailnet. Exit node change where your public traffic dey leave from. If na the second one you want, read how to run Tailscale exit node for VPS instead. Dem be separate flags, and one VPS fit run both at the same time, but dem dey solve different problems and dem fit fail for different ways.

When VPS need be subnet router

The common case na private network wey your provider don already give you. Your VPS get public address and second interface for private segment, while the other servers for that segment no get public address at all: database for 10.0.0.20, backup target for 10.0.0.30. Put Tailscale for one VPS, advertise 10.0.0.0/24, and your laptop go reach those private addresses directly. Nothing else for the segment go change, and the database still no get public address. If na only one web app for one port you need from that segment, advertising the whole range na more than wetin the work require, and Tailscale serve go put HTTPS for that single port instead. The same reasoning apply to daemon wey deliberately bind to localhost only, like dsh wey dey run headless under systemd, where tailnet address for that VPS go replace the SSH tunnel wey you for otherwise keep open to reach its UI.

The other case na network wey dey the far side of the VPS. E fit be home or office LAN (local area network) behind its own router, or rack of appliances wey no fit run Tailscale at all, like managed switch or old NAS with locked firmware. One Linux box for that network go become the subnet router for everything else wey dey there. The home router in front of am no need any forwarded port for this, and how Tailscale dey pass through NAT without opening router port explain why e dey work and when e go fall back to relay. For home, that box often na small VM for hypervisor wey you already dey run, and the cost math of Proxmox host for home against rented VPS na the thing wey you need settle before you decide which end of the tunnel your services suppose dey.

Both cases get one requirement in common. The subnet router must already fit reach the range wey e advertise, using its own routing table and its own firewall. Tailscale no dey build that connection. E carry traffic go the router and hand am over to the kernel to forward.

Install Tailscale and first check the local route

curl -fsSL https://tailscale.com/install.sh | sh

The script dey detect the distribution, add Tailscale package repository, install the tailscale command and tailscaled daemon, then enable the service. Confirm am with systemctl is-active tailscaled; e suppose print active.

Before anything else, prove say the VPS fit reach the network wey you plan to advertise.

ip route show
ping -c3 10.0.0.20

ip route show must list the private range for a real interface, something like 10.0.0.0/24 dev enp7s0 proto kernel scope link src 10.0.0.5. If ping fail here, for the router itself, no Tailscale flag go fix am. The problem dey for VPS network configuration or firewall for the target host. Fix that one first, because every later test depend on am.

Turn on IP forwarding, and make e survive reboot

Linux machine dey drop any packet wey no address to am unless forwarding dey on. Forwarding other machines' packets na the full work of subnet router, so this step no be optional.

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.conf

Check am with sysctl net.ipv4.ip_forward, wey suppose print net.ipv4.ip_forward = 1.

People often dey do this step halfway correct. sudo sysctl -w net.ipv4.ip_forward=1 go work immediately but e go disappear for next boot, so subnet router fit run for weeks then stop the morning after kernel upgrade reboot. The confusing part be say nothing go look broken. tailscale status still dey show the node online, admin console still dey show say dem approve the route, and clients still get the route installed. Packets dey arrive for VPS, but kernel dey drop dem without logging anything. Writing the values inside /etc/sysctl.d/99-tailscale.conf na wetin make dem come back after reboot.

If you advertise routes while forwarding still dey off, tailscale up go warn you at that time. For Linux, the line dey close to Warning: IP forwarding is disabled, subnet routing/exit nodes will not work. Read the output of that command instead of scrolling past am.

sudo tailscale up --advertise-routes=10.0.0.0/24

For VPS wey already sign in to your tailnet, change the setting directly instead:

sudo tailscale set --advertise-routes=10.0.0.0/24

Use tailscale set for every change wey come later. If you run tailscale up again with only one flag, e go reset any flag wey you no repeat. The CLI go stop you with error say, to change settings this way, you must mention all non-default flags. tailscale set changes only one setting and leaves the others as dem be.

Put several ranges inside one comma-separated list without spaces: --advertise-routes=10.0.0.0/24,192.168.50.0/24. Every entry must be network address for CIDR notation (classless inter-domain routing, the 10.0.0.0/24 form). If you mistakenly write your own host address, 10.0.0.5/24, the command go reject am because the bits after the prefix no be zero. The error message go name the prefix wey you probably mean. To stop advertising routes, set an empty list with sudo tailscale set --advertise-routes=.

Approve route for admin console

To advertise route na request, e no be change yet. Until admin approve am, no client go receive the route and nothing for that range go reachable. Na deliberate security measure be this, because machine wey fit add itself to everybody routing table fit capture traffic for any range wey e like.

Approve am for Machines page inside admin console. VPS go show with subnet badge. Open the row, find subnets section, edit route settings, tick the route, then save.

Approval dey apply to each prefix. Advertise 10.0.0.0/24 today and 192.168.50.0/24 next month, and the new prefix go arrive unapproved while the old one still dey work. Approved route and ignored route look the same from VPS side, so check console before you debug anything else.

You fit skip the manual step with an autoApprovers block inside tailnet policy file:

{
  "autoApprovers": {
    "routes": {
      "10.0.0.0/24": ["tag:subnet-router"]
    }
  }
}

Then bring the node up with that tag, sudo tailscale up --advertise-routes=10.0.0.0/24 --advertise-tags=tag:subnet-router, and the route go become approved immediately after you advertise am. The tag must already dey inside tagOwners section of the same policy file. E make sense to set this up if you dey rebuild VPS from script, because rebuilt node na new node and its routes go start unapproved again.

Why Linux clients ignore route when you no use --accept-routes

The route don advertise am and approve am. Your phone and Mac fit reach 10.0.0.20. Your Linux laptop no fit, and nothing for the admin console show say problem dey.

To accept subnet route mean say client go write entries inside e routing table. For Android, iOS, macOS, tvOS and Windows, Tailscale dey do this for you. For Linux, e no dey do am because Linux machine often dey serve as server or router wey person configure e routing table deliberately. If machine silently insert /24 wey e learn from network, e fit break traffic wey the machine dey already handle. So for Linux, you must opt in for each client:

sudo tailscale set --accept-routes

Then check where the route enter:

ip route show table 52
ip route get 10.0.0.20

When policy routing dey available, Tailscale for Linux dey put accepted routes for routing table 52 instead of the main routing table. E dey install policy rules, wey you fit see with ip rule show. Normally, the priority go dey between 5210 and 5270. But for OpenWRT systems wey Tailscale detect say dem dey run mwan3, Tailscale dey use priorities between 1300 and 1400 instead. For this setup, plain ip route show no go list the accepted 10.0.0.0/24 route. So check ip route show table 52 for the advertised range on tailscale0. If policy-routing support no dey, Tailscale dey install accepted routes for the main table, where plain ip route show go list dem.

You need know one exception. If this Linux node na also second subnet router for e own local network, --accept-routes go make am send traffic for e own directly connected subnet through the other router instead of e own interface. For standby router wey dey inside high availability pair, leave --accept-routes off and advertise only.

Failure mode: two routers advertising overlapping ranges

Two subnet routers fit advertise the same ranges, and na so high availability pair dey work: each router advertises exactly the same prefixes, and clients fit fail over from one go the other. Overlapping ranges with different prefix lengths dey allowed too, and Tailscale picks the most specific match. If router A dey advertise 10.0.0.0/24 and router B dey advertise 10.0.0.0/16, traffic to 10.0.0.20 go A.

Wetin dey surprise people na how e dey behave when A go offline. Tailscale no go fall back to the less specific route, because an offline router no fit withdraw its advertisement and clients continue to prefer the more specific prefix. Traffic to 10.0.0.20 go stop, while traffic to 10.0.1.20, wey only B's /16 cover, continue to work through B. The symptom look like part of the private network dey down, and the cause na one offline node wey still get the more specific prefix. If you want failover, make the wider router advertise the narrower prefixes too, so both routers cover the same addresses.

The other overlap dey closer to the client. If you dey on hotel network for 192.168.1.0/24 while your subnet router dey advertise 192.168.1.0/24, the two routes go compete for the same destinations, and which one go win depend on the platform. For Linux, install one rule before Tailscale own, so local addresses use the main table:

sudo ip rule add to 192.168.1.0/24 priority 2500 lookup main

Priority 2500 dey before Tailscale usual rules, but for OpenWRT with mwan3, check ip rule show and choose one unused priority below 1300 instead. That rule no persistent, and e go disappear when system boot again. The real fix na to choose private range wey you no go meet for public networks. 192.168.0.0/24 and 192.168.1.0/24 na the default ranges for most home routers, so pick something inside 10.0.0.0/8 wey you choose deliberately. The same collision go break plain WireGuard VPN wey you configure by hand, for the same reason: the more specific local route go win, so the traffic no go enter the tunnel.

Failure mode: DNS resolve go address wey no route cover

This one hard to debug, because nothing report error. The name resolve. The connection just time out.

Make we say db.internal.example.com resolve go 10.0.5.20 through your private nameserver, and you advertise 10.0.0.0/24. The lookup succeed, because DNS (domain name system) resolution and IP routing na separate steps, and neither one check the other. Then packet wey go 10.0.5.20 no find matching route for the tailnet, so e comot through the client default gateway and disappear.

Two commands go separate the two sides:

nslookup db.internal.example.com
ip route get 10.0.5.20

If the lookup return address but ip route get no answer with dev tailscale0, the name dey okay and the route dey missing for this client. For Linux client, first confirm say --accept-routes dey on, because without am no subnet route go install even when approved prefix already cover the address. If e dey on and no approved prefix cover the address, advertise range wey cover am, either 10.0.0.0/16 or another explicit prefix, then approve the new prefix for the console.

Nameserver itself get matching trap. If you set global nameserver for admin console with private address like 10.0.0.53, that address must dey inside approved route, or devices wey no dey on that private network no go reach the resolver at all. If you turn on the option wey override local DNS servers while you point to resolver wey nobody fit reach, every device for the tailnet go lose name resolution at once, including the ones wey work one second before. Advertise and approve route to the resolver first, then change the DNS setting. If DNS inside tunnel na the part wey you dey struggle with, how DNS dey break over WireGuard tunnel explain the same mechanism without the coordination layer on top.

By default, subnet router dey rewrite source address of every forwarded packet to im own private address. Na SNAT (source network address translation), and e dey make replies work without changing anything for the private network: database for 10.0.0.20 go answer the VPS, because e already know how to reach am. The problem be say database go see every tailnet connection as if na VPS dey send am, so per-source firewall rules and access logs no go tell you anything.

Turn am off for Linux when you want make client real tailnet address remain:

sudo tailscale set --snat-subnet-routes=false

If the same node also dey serve as exit node, disabling subnet SNAT fit cause upstream drops; Tailscale recommend separate nodes for these roles when subnet SNAT must dey disabled.

The hosts for the private network then need route back to 100.64.0.0/10, the range wey Tailscale assign to devices, with subnet router as the route target. Without this return route, their replies go default gateway and never arrive, so connections go hang after the first packet. Add the static route for the private network gateway, or leave SNAT on.

Site to site link na two subnet routers wey dey do this at the same time. Each one advertise im own network and accept the other one:

sudo tailscale up --advertise-routes=10.0.0.0/24 --snat-subnet-routes=false --accept-routes

Run the matching command for the other router with im own range. The two ranges must dey different. If large transfers stall while ssh and ping dey fine, the cause na MSS (maximum segment size), the biggest data chunk wey TCP packet fit carry. Tunnel overhead make forwarded packets too big for one link along the way, and clamping go fix am:

sudo iptables -t mangle -A FORWARD -o tailscale0 -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

Save that rule with iptables-persistent, or e go disappear when system boot again.

Housekeeping wey go keep am running

Whether this machine key go expire depend on how you sign in. Node wey you bring up under tag, like the autoApprovers example above, get key expiry disabled by default from the time you first tag and authenticate am, so you no need do anything here. Node wey you sign in as you dey follow the tailnet key expiry period. For new tailnet, na 180 days by default, and you fit set am anywhere from 1 to 180 days, as of October 2026. When key for subnet router like this one expire, connections go and come from am go stop, and the whole advertised range go become unreachable, without any configuration change to explain am. For router wey you sign in as user, disable key expiry from the menu at the end of its row for the Machines page inside the admin console. Then write down say you do am.

Tailscale prefer direct connection between peers, and e go fall back to relay servers when e no fit get one. The relays dey work, but dem add latency. VPS wey get public address na the easy case: allow inbound UDP 41641, and most peers go connect directly. Tailscale still dey work even when no inbound port dey open, so that rule dey improve speed, not reachability. the ports Tailscale actually uses and what a VPS firewall should allow explain why the port na 41641, not WireGuard usual 51820. When traffic to the private range slow pass wetin the VPS link suppose allow, checking whether your client reaches the subnet router directly or through a relay na the first thing to check. If ufw dey manage the firewall, the ufw rules a VPS actually needs cover the syntax.

Access rules na the other half. For default tailnet, every device wey belong to you fit reach every other one, so approved route go just work. Once you write ACL policy, the destination side of the rule must cover the private range. You fit name the range directly or use the * wildcard. The wildcard includes approved subnet routes, because 10.0.0.20 no be tailnet address and rules wey target tailnet IPs or tags no cover am.

Finally, decide whether you want coordination server wey you no dey run yourself. Tailscale control plane na hosted service. Your keys remain for your machines, but the account and policy file dey there. The important question na wetin person fit really do with compromised control plane or stolen identity login. You need settle that before you give am route into your private network. Tailscale's trust model show where that boundary dey. Cost rarely make people leave am, because the free plan covers up to six users with unlimited devices of their own, although subnet router wey you bring up under tag dey counted differently from one wey you sign in as you. Billing also count tagged resources: 50 dey included, and every extra tagged resource cost $1 per month. So what a household or a five person team actually pays once the free plan runs out na something worth calculating before you add users or tagged routers. Running Headscale, the self hosted Tailscale control server keep am for your own VPS, but you go need maintain am. Another answer to the same concern na to leave Tailscale clients behind too. self-hosting the NetBird VPN server put the coordination layer and its own mesh clients for one machine wey you control. Both use WireGuard underneath. So if you switch, na these parts go change, as the NetBird and Tailscale comparison explain: who dey run the control plane, how you write the access rule wey cover your private range, and how traffic dey relay when peers no fit connect directly. If you still dey decide between this model and hand written config, the comparison of WireGuard and Tailscale explain wetin the coordination layer give you and wetin e cost.

FAQ

Difference between subnet router and exit node na wetin?

Subnet router dey advertise a range of private addresses, so devices for tailnet fit reach machines wey no dey run Tailscale. Exit node dey advertise itself as route to the whole internet, so device dey send all its traffic through that node public address. One VPS fit be both. Dem na separate flags, --advertise-routes and --advertise-exit-node, and each one need its own approval for admin console.

Why Linux client no dey use the advertised subnet route?

Linux clients no dey accept subnet routes unless you tell dem to. Run sudo tailscale set --accept-routes for the client. Then check with ip route show table 52 when policy routing dey available. Tailscale dey use table 52 and policy rules for that setup, so plain ip route show no go show the accepted route. Without policy-routing support, accepted routes dey enter main table and appear for plain ip route show.

My subnet stop working after reboot. Wetin spoil?

Na IP forwarding most likely. Value wey you set with sysctl -w no dey survive reboot, so write am to /etc/sysctl.d/99-tailscale.conf and confirm with sysctl net.ipv4.ip_forward. If forwarding dey on and the range still no reachable, check the node for admin console. Router wey sign in as user get key wey expire after 180 days by default. Expired subnet router fit look like network fault instead of account problem. Router wey you bring up under tag get key expiry disabled by default, so for that one, check elsewhere.

Two subnet routers fit advertise the same range?

Yes. Identical ranges na how high availability pair dey work: both routers advertise exactly the same prefixes. Overlapping ranges with different prefix lengths dey okay too, and the most specific one go win. Failover need care for this case: when router wey hold the more specific prefix go offline, Tailscale no go fall back to the wider route, so that traffic go stop. For real standby pair, make both routers advertise the same specific prefixes.

The hostname dey resolve but connection dey time out. Why?

DNS resolution and routing na separate steps. Name fit resolve to address wey no approved route cover, and packet go then leave through client default gateway. Run ip route get <address> for the client. If the answer no include dev tailscale0 for Linux client, first check say --accept-routes dey on. If e dey on, advertise range wey cover that address and approve the new prefix for admin console.

Dis article help you?