Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tailscale-prefix-mover

status: experimental

Provide a set of prefixes within 100.64.0.0/10 and this tool will find devices within those prefixes and reassign devices to other space within the CGNAT prefix.

See Visual Subnet Calculator for an easy subnet calculator.

Usage

go run github.com/tailscale-dev/tailscale-prefix-mover -help

Example

Pass -apply to make changes.

export TAILSCALE_TAILNET=...
export TAILSCALE_API_KEY=...

go run github.com/tailscale-dev/tailscale-prefix-mover -from-prefixes=100.72.0.0/13,100.96.0.0/11
Moving devices from [100.72.0.0/13 100.96.0.0/11] to [100.64.0.0/13 100.80.0.0/12]
Setting v4 address [w.x.y.z  ] to [nodeid:1234567890   / name:device123.example.ts.net]... done.
Setting v4 address [w.x.y.z  ] to [nodeid:9876543210   / name:device987.example.ts.net]... done.
Pass -apply to make changes.
Done.

Example with -to-prefixes

Pass -apply to make changes.

export TAILSCALE_TAILNET=...
export TAILSCALE_API_KEY=...

go run github.com/tailscale-dev/tailscale-prefix-mover -from-prefixes=100.72.0.0/13,100.96.0.0/11 -to-prefixes=100.64.0.0/24
Moving devices from [100.72.0.0/13 100.96.0.0/11] to [100.64.0.0/24]
Setting v4 address [w.x.y.z  ] to [nodeid:1234567890   / name:device123.example.ts.net]... done.
Setting v4 address [w.x.y.z  ] to [nodeid:9876543210   / name:device987.example.ts.net]... done.
Pass -apply to make changes.
Done.

About

CLI tool to move Tailscale devices between prefixes within CGNAT

Resources

Code of conduct

Stars

8 stars

Watchers

2 watching

Forks

Used by

Contributors

Languages