-
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a55d29a
Showing
6 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh /etc/rc.common | ||
|
||
# Copyright 2020 Google LLC. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
USE_PROCD=1 | ||
START=99 | ||
STOP=1 | ||
|
||
start_service() { | ||
procd_open_instance | ||
procd_set_param command /usr/bin/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 41641 | ||
|
||
# OpenWRT /var is a symlink to /tmp, so write persistent state elsewhere. | ||
procd_append_param command --state /etc/tailscale/tailscaled.state | ||
|
||
procd_set_param respawn | ||
procd_set_param stdout 1 | ||
procd_set_param stderr 1 | ||
|
||
procd_close_instance | ||
} | ||
|
||
stop_service() { | ||
/usr/sbin/tailscaled --cleanup | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh /etc/rc.common | ||
USE_PROCD=1 | ||
START=98 | ||
STOP=01 | ||
start_service() { | ||
procd_open_instance | ||
procd_set_param command /usr/bin/tailscale_enabler | ||
procd_close_instance | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Tailscale on OpenWRT | ||
|
||
1. Extract the contents of root to your filesystem root using: | ||
``` | ||
tar x -zvf tailscale_enabler.tgz -C / | ||
``` | ||
|
||
2. Install the prerequisites for wget and tailscale using: | ||
``` | ||
opkg update | ||
opkg install libustream-openssl ca-bundle kmod-tun | ||
``` | ||
|
||
3. Run tailscale for the first time: | ||
``` | ||
tailscale_enabler | ||
/etc/init.d/tailscale start | ||
tailscale up --accept-dns=false --advertise-routes=10.0.0.0/24 | ||
``` | ||
|
||
The tailscale_enabler will download the tailscale binaries to /tmp and tailscale will start the tailscale daemon. | ||
The last command uses the tailscale CLI to configure the login and add some settings to prevent dns changes and advertise routes. Use the URL printed to login to tailscale. | ||
|
||
4. Enable tailscale at boot: | ||
``` | ||
/etc/init.d/tailscale_enabler enable | ||
/etc/init.d/tailscale enable | ||
``` | ||
|
||
Verify by looking for two entries here: | ||
``` | ||
ls /etc/rc.d/S*tailscale* | ||
``` | ||
|
||
5. Reboot the router and verify that it shows up online on the [Tailscale Admin portal](https://login.tailscale.com/admin/machines). | ||
|
||
6. To update the version of tailscale, grab the latest version [here](https://pkgs.tailscale.com/stable/#static) of the form `1.2.10_mips` and replace the same in /usr/bin/tailscale_enabler: `version="1.2.10_mips"`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tmp/tailscale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
version='1.2.10_mips' | ||
|
||
if [ ! -f /tmp/tailscaled ]; then | ||
echo "Downloading Tailscale ${version} .." | ||
|
||
echo -e "tailscale_${version}/tailscale\ntailscale_${version}/tailscaled" > /tmp/tailscale_${version}_files.txt | ||
|
||
wget -O- https://pkgs.tailscale.com/stable/tailscale_${version}.tgz | tar x -zvf - -C /tmp -T /tmp/tailscale_${version}_files.txt | ||
|
||
mv /tmp/tailscale_$version/* /tmp | ||
rm -rf /tmp/tailscale_${version}* | ||
|
||
echo "Done!" | ||
|
||
else | ||
echo "Tailscale already exists!" | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tmp/tailscaled |