Remove old routes #95

Closed
opened 2025-12-29 01:22:55 +01:00 by adam · 12 comments
Owner

Originally created by @12nick12 on GitHub (Dec 28, 2021).

Is there any way to remove old routes from tailscale/headscale?

I deleted an old device and created a new one in it's place, when trying to enable a subnet router the device goes offline. This appears to be because of a loop I'm thinking.

Originally created by @12nick12 on GitHub (Dec 28, 2021). Is there any way to remove old routes from tailscale/headscale? I deleted an old device and created a new one in it's place, when trying to enable a subnet router the device goes offline. This appears to be because of a loop I'm thinking.
adam added the enhancement label 2025-12-29 01:22:55 +01:00
adam closed this issue 2025-12-29 01:22:55 +01:00
Author
Owner

@kradalby commented on GitHub (Jun 12, 2022):

Is this still a problem? Could you help us with some steps to reproduce a minimal case?

@kradalby commented on GitHub (Jun 12, 2022): Is this still a problem? Could you help us with some steps to reproduce a minimal case?
Author
Owner

@epichub commented on GitHub (Jul 1, 2022):

I have a route that I cannot disable, if i "--reset" join the router node without advertising the route, the other nodes still gets the route added (after restarting headscale and tailscale on all nodes) - the route is no longer listed by headscale cli for the subnet router, but added to the other nodes anyway.

@epichub commented on GitHub (Jul 1, 2022): I have a route that I cannot disable, if i "--reset" join the router node without advertising the route, the other nodes still gets the route added (after restarting headscale and tailscale on all nodes) - the route is no longer listed by headscale cli for the subnet router, but added to the other nodes anyway.
Author
Owner

@casdr commented on GitHub (Sep 16, 2022):

I have the same issue, the problem can be reproduced as following:

  • Add a route from one of the nodes
  • Enable the route using headscale cli
  • Remove the route advertisement by removing the route from the --advertise-routes list

Now, when you check headscale route ls -i (node) the route doesn't show up, however the route is still listed in the sqlite database and also being configured on the other nodes.

@casdr commented on GitHub (Sep 16, 2022): I have the same issue, the problem can be reproduced as following: - Add a route from one of the nodes - Enable the route using headscale cli - Remove the route advertisement by removing the route from the `--advertise-routes` list Now, when you check `headscale route ls -i (node)` the route doesn't show up, however the route is still listed in the sqlite database and also being configured on the other nodes.
Author
Owner

@casdr commented on GitHub (Sep 16, 2022):

I found a workaround for this, when you enable all routes for the node (headscale r enable -i 2 -a), the old route will be removed.

@casdr commented on GitHub (Sep 16, 2022): I found a workaround for this, when you enable all routes for the node (`headscale r enable -i 2 -a`), the old route will be removed.
Author
Owner

@PsyMan2000 commented on GitHub (Jan 31, 2023):

I am running 0.19.0 in a container and am also seeing a few routes sticking around after deleting a node and re-adding it (I did it to remove the IPv6 addresses and just use IPv4 after disabling it in the server 3 firewalls in) - now when I "headscale route ls" is gives me 3 Advertised routes with an empty Machine entry with the new 3 Machines and same routes tagged on the end of the list. Am I experiencing a bug or did I do something wrong. Also the commands seem to have changed a bit in 0.19.0. is there a "headscale route delete -r x" option or is there a simpler way to remove the ghosts from the machine? :-)

Maybe I should have re-upped it removing the advertised routes prior to deleting the node with the --reset flag? I will try that with another node and see what happens. I am only testing so no huge problem to wipe and start over. Looking forward to adding the UI on top once I get HS mastered...

I tried but ended up with 12 blank Machine entries and a mix of ghost routes. Deleted the db.sqlite file and made an empty one to start over. Just thought I would post back to see if it helps troubleshoot things. Enjoying just how easy it is to get running and use. fantastic work.

@PsyMan2000 commented on GitHub (Jan 31, 2023): I am running 0.19.0 in a container and am also seeing a few routes sticking around after deleting a node and re-adding it (I did it to remove the IPv6 addresses and just use IPv4 after disabling it in the server 3 firewalls in) - now when I "headscale route ls" is gives me 3 Advertised routes with an empty Machine entry with the new 3 Machines and same routes tagged on the end of the list. Am I experiencing a bug or did I do something wrong. Also the commands seem to have changed a bit in 0.19.0. is there a "headscale route delete -r x" option or is there a simpler way to remove the ghosts from the machine? :-) Maybe I should have re-upped it removing the advertised routes prior to deleting the node with the --reset flag? I will try that with another node and see what happens. I am only testing so no huge problem to wipe and start over. Looking forward to adding the UI on top once I get HS mastered... I tried but ended up with 12 blank Machine entries and a mix of ghost routes. Deleted the db.sqlite file and made an empty one to start over. Just thought I would post back to see if it helps troubleshoot things. Enjoying just how easy it is to get running and use. fantastic work.
Author
Owner

@robertorubioguardia commented on GitHub (Feb 10, 2023):

Hi there.

Having the same issue here. Routes are still listed and shown as advertised in the headscale server, without a node label, even when the tailscale node has been removed from the network.

The headscale CLI seems not to have a command to delete routes :( but one just to disable routes.

Any ideas/insight?

@robertorubioguardia commented on GitHub (Feb 10, 2023): Hi there. Having the same issue here. Routes are still listed and shown as advertised in the headscale server, without a node label, even when the tailscale node has been removed from the network. The headscale CLI seems not to have a command to delete routes :( but one just to disable routes. Any ideas/insight?
Author
Owner

@evenh commented on GitHub (Feb 14, 2023):

I've seen the same behaviour

@evenh commented on GitHub (Feb 14, 2023): I've seen the same behaviour
Author
Owner

@jsbrain commented on GitHub (Feb 28, 2023):

Same ... cannot remove old routes from deleted device.

@jsbrain commented on GitHub (Feb 28, 2023): Same ... cannot remove old routes from deleted device.
Author
Owner

@EricTheMagician commented on GitHub (Apr 2, 2023):

I was having the same issue and discovered that this might work:
If you still have the device identifier, this is what I did:

headscale  routes enable -i 2 -r ""

it seems to disable it

@EricTheMagician commented on GitHub (Apr 2, 2023): I was having the same issue and discovered that this might work: If you still have the device identifier, this is what I did: ``` headscale routes enable -i 2 -r "" ``` it seems to disable it
Author
Owner

@PsyMan2000 commented on GitHub (Apr 2, 2023):

There seems to be a fantastic update now on the docker version I am using that llows you to delete routes. :-)

@PsyMan2000 commented on GitHub (Apr 2, 2023): There seems to be a fantastic update now on the docker version I am using that llows you to delete routes. :-)
Author
Owner

@PsyMan2000 commented on GitHub (Apr 2, 2023):

but that is a great workaround, Thanks Jinx - That would have saved me deleteing a dozen databases LOL

@PsyMan2000 commented on GitHub (Apr 2, 2023): but that is a great workaround, Thanks Jinx - That would have saved me deleteing a dozen databases LOL
Author
Owner

@juanfont commented on GitHub (May 7, 2023):

Fixed :)

@juanfont commented on GitHub (May 7, 2023): Fixed :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#95