# Tailscale settings lost on reboot

**URL:** <https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524>\
**Category:** Router\
**Tags:** KB\
**Created:** [July 18, 2023, 11:59am UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524 "2023-07-18T11:59:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 11:59am UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/1 "2023-07-18T11:59:09Z")

</div>

I have a GL-AX1800 and purchased because of Tailscale implementation among other features.

I have noticed that there is very little available config in the UI but as I had SSH access I thought it would be ok and configured via:

`tailscale up --advertise-routes=192.168.10.0/23 --accept-dns=false --accept-routes --advertise-exit-node --reset`

I specifically want the /23 route advertised instead of a /24 and need the other options. This works fine however it is all resets on reboot.

Is there a way to run a command after boot and after tailscale has come up?

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 1:26pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/2 "2023-07-18T13:26:45Z")

</div>

I tried adding the `tailscale up` command to the `http://192.168.10.1/cgi-bin/luci/admin/system/startup` page but it didn’t work. I have to run the command manually after a reboot.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 6:21pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/3 "2023-07-18T18:21:44Z")

</div>

> [@ilium007](#):
>
> tailscale up --advertise-routes=192.168.10.0/23 --accept-dns=false --accept-routes --advertise-exit-node --reset

LuCI’s Startup is just a frontend for `/etc/rc.local`. Make sure your command string is above the `exit 0` & the string itself ends with `&` to send it into the background processes.

> **[The power of \>, \>\>, &, &&, and || on Linux](https://www.networkworld.com/article/972419/the-power-of-and-on-linux.html)**
>
> The \>, \>\>, &, && and || characters are extremely useful whenever you're working on the Linux command line.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 7:07pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/4 "2023-07-18T19:07:21Z")

</div>

I’ll give that a go but not sure why it needs to be pushed to the background? It’s a one shot command that should re-enable the routes and exit node. It would be much better if there was an advanced option in the UI to enable other Tailscale config.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 7:12pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/5 "2023-07-18T19:12:58Z")

</div>

> [@ilium007](#):
>
> I’ll give that a go but not sure why it needs to be pushed to the background?

I asked the same of my ddns client when I’m benind addn’l upstream routers:

```auto
root@GL-AX1800:~# cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

. /lib/functions/gl_util.sh
remount_ubifs

/usr/lib/ddns/dynamic_dns_updater.sh -S desec_ipv4 start &

exit 0

```

```auto
root@GL-AX1800:~# ps -w | grep ddns
19182 root 1376 S /bin/sh /usr/lib/ddns/dynamic_dns_updater.sh -S desec_ipv4 start

```

You run the risk of it choking in `rc.local` & inadvertently stalling the full boot process. If it’s a true ‘one shot’ as you describe it’ll exit fr the bg processes automatically anyways.

> [@ilium007](#):
>
> It would bed do much better if there was an advanced option in the UI to enable other Tailscale config.

It’s a workaround not a solution. 4 days ago:

> [@Tailscale and "Block Non-VPN Traffic"](https://forum.gl-inet.com/t/tailscale-and-block-non-vpn-traffic/30493/2):
>
> Yes, this option is not available for Tailscale. We are no plans for this feature yet, and Tailscale has many higher priority issues to resolve. After solving those issues, we will consider it.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 8:25pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/6 "2023-07-18T20:25:41Z")

</div>

Adding the “&” to fork to background didn’t work on reboot. Routes and exit node config still overwritten.

 ![Screenshot 2023-07-19 at 06.24.56](https://forum-static.gl-inet.com/original/2X/2/29eab9b4a79dac4876f510c1ae9b7770f7fbd5a2.png)

 ![Screenshot 2023-07-19 at 06.21.20](https://forum-static.gl-inet.com/original/2X/3/35322dea82414849861dee1ea4916d38732ed758.png)

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 8:28pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/7 "2023-07-18T20:28:36Z")

</div>

> [@ilium007](#):
>
> Routes and exit node config still overwritten.

Do you know the file location for the conf? It can be checked for its existence & if so, deleted/moved/renamed/whatever before launching w/ your specific string.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 8:46pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/8 "2023-07-18T20:46:37Z")

</div>

No, haven’t found it. The /`etc/init.d/tailscale` file has the `tailscaled` startup but I can’t find the `tailscale up xxxx` config anywhere.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 8:49pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/9 "2023-07-18T20:49:17Z")

</div>

The params might be being passed by `/etc/init.d/tailscale`; reboot it as if using TS via GL GUI & chk `ps -w | grep tail`

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:01pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/10 "2023-07-18T21:01:07Z")

</div>

Its exactly as per the init.d file:

```auto
root@GL-AX1800:/# ps -w | grep tail
12659 root 670m S /usr/sbin/tailscaled --port 41641 --state /etc/tailscale/tailscaled.state

```

`tailscale up xxxx` is never called. Not sure how the UI passes the selections re. routes that it configures.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 9:06pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/11 "2023-07-18T21:06:26Z")

</div>

> [@ilium007](#):
>
> `/etc/tailscale/tailscaled.state`

Ohh… _that’s_ interesting; `cat` & post the output, pls.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:17pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/12 "2023-07-18T21:17:36Z")

</div>

That file contains the hashed connection info so probably shouldn’t post! But no config in that file.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 9:18pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/13 "2023-07-18T21:18:29Z")

</div>

You can always redact details as needed before posting.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:18pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/14 "2023-07-18T21:18:45Z")

</div>

I think at this stage I need a way to run the tailscale up command after tailscaled has come up. That /etc/rc.local is not working for me…

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:23pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/15 "2023-07-18T21:23:54Z")

</div>

I added this to the startup script to find whats running at start:

`ps -w | grep tail > /tmp/tailscale.info &`

```auto
root@GL-AX1800:~# cat /tmp/tailscale.info
 4750 root 1176 S /bin/sh /usr/bin/gl_tailscale restart
 4752 root 1312 S /bin/sh /etc/rc.common /etc/init.d/tailscale restart
 4776 root 794m S /usr/sbin/tailscaled --port 41641 --state /etc/tailscale/tailscaled.state
 4777 root 1304 S /bin/sh /etc/rc.common /etc/init.d/tailscale running
 4797 root 794m S /usr/sbin/tailscaled --cleanup
 4879 root 1172 S /bin/sh /usr/bin/gl_tailscale set_route
 5313 root 1172 S grep tail
root@GL-AX1800:~#

```

It looks as though its being configured via:

`/bin/sh /usr/bin/gl_tailscale set_route`

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 9:26pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/16 "2023-07-18T21:26:34Z")

</div>

My Flint is running f/w 4.2.3-release5. Try adding some custom params to the launching shell script. You might not even need `rc.local`:

```auto
root@GL-AX1800:~# cat /etc/init.d/tailscale
#!/bin/sh /etc/rc.common

# Copyright 2020 Google LLC.
# Copyright (C) 2021 CZ.NIC z.s.p.o. (https://www.nic.cz/)
# SPDX-License-Identifier: Apache-2.0

USE_PROCD=1
START=80

start_service() {
  local state_file
  local port
  local std_err std_out

  config_load tailscale
  config_get_bool std_out "settings" log_stdout 1
  config_get_bool std_err "settings" log_stderr 1
  config_get port "settings" port 41641
  config_get state_file "settings" state_file /etc/tailscale/tailscaled.state

  /usr/sbin/tailscaled --cleanup
  config_get enabled "settings" enabled 0
  if ["$enabled" -eq "1"];then
        procd_open_instance
        procd_set_param command /usr/sbin/tailscaled

        # Set the port to listen on for incoming VPN packets.
        # Remote nodes will automatically be informed about the new port number,
        # but you might want to configure this in order to set external firewall
        # settings.
        procd_append_param command --port "$port"
        procd_append_param command --state "$state_file"

        # my custom params
        procd_append_param command --advertise-routes "192.168.10.0/23"
        # ... & so on, & so forth....
        # // end my custom params

        procd_set_param respawn
        procd_set_param stdout "$std_out"
        procd_set_param stderr "$std_err"

        procd_close_instance
  fi
}

```

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:29pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/17 "2023-07-18T21:29:20Z")

</div>

That wont work unfortunately… The init.d file runs tailscaled not tailscale - there is no `--advertise-routes` etc for the daemon process. The tailscale binary is the cli interface to the tailscale daemon process.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:31pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/18 "2023-07-18T21:31:07Z")

</div>

`/usr/bin/gl_tailscale` must be running the `tailscale up xxxx` command after it pulls config info that has been set via the UI.

---

<div class="post-metadata">

**Author:** ![bring.fringe18](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bring.fringe18/32/11777_2.png) [@bring.fringe18](https://forum.gl-inet.com/u/bring.fringe18)\
**Post date:** [July 18, 2023, 9:35pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/19 "2023-07-18T21:35:13Z")

</div>

Yeah I see that now after you posted that dir list. The more I look at this the more it seems all so familar:

This is untested code to enable exit nodes I never got feedback on from someone else but here:

```auto
sed '/param="$param --exit-node-allow-lan-access --exit-node=$exit_node_ip"/a\ param=“$param --advertise-exit-node --allow-exit-node --allow-routes”' /usr/bin/gl_tailscale >> \
 /usr/bin/gl_tailscale.new && mv /usr/bin/gl_tailscale /usr/bin/gl_tailscale.stock \
&& mv /usr/bin/gl_tailscale.new /usr/bin/gl_tailscale && chmod +x /usr/bin/gl_tailscale

```

It’ll add more the launch string of `/usr/bin/gl_tailscale` @ this if statement/code block:

```auto
                if [-n "$exit_node_ip"];then
                        param="$param --exit-node-allow-lan-access --exit-node=$exit_node_ip"
                        # new params added here by the `sed` search & replace
                fi

```

You can add your params there or by adding more to the second half of that above `sed` command.

---

<div class="post-metadata">

**Author:** ![ilium007](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/ilium007/32/2123_2.png) [@ilium007](https://forum.gl-inet.com/u/ilium007)\
**Post date:** [July 18, 2023, 9:39pm UTC](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524/21 "2023-07-18T21:39:29Z")

</div>

I hadn’t realised `/usr/bin/gl_tailscale` was a script! I assumed it was a binary - I’ll check out what you have posted above but this will definitely fix things for me.

[Next page](https://forum.gl-inet.com/t/tailscale-settings-lost-on-reboot/31524.md?page=2)
