{"id":27185253,"url":"https://github.com/anasfanani/magisk-tailscaled","last_synced_at":"2025-04-09T17:14:28.412Z","repository":{"id":212360218,"uuid":"731314843","full_name":"anasfanani/Magisk-Tailscaled","owner":"anasfanani","description":"Magisk/KernelSU module for running Tailscale on rooted Android devices. The easiest, most secure way to use WireGuard and 2FA.","archived":false,"fork":false,"pushed_at":"2024-06-11T00:52:24.000Z","size":431332,"stargazers_count":267,"open_issues_count":11,"forks_count":27,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T17:14:20.242Z","etag":null,"topics":["android","kernelsu","kernelsu-module","magisk","magisk-module","tailscale","tunnel","vpn","wireguard","wireguard-tunnel","wireguard-vpn","wireguard-vpn-setup"],"latest_commit_sha":null,"homepage":"https://t.me/systembinsh/158","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anasfanani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-13T20:02:49.000Z","updated_at":"2025-04-08T06:02:46.000Z","dependencies_parsed_at":"2024-06-11T02:39:08.664Z","dependency_job_id":null,"html_url":"https://github.com/anasfanani/Magisk-Tailscaled","commit_stats":null,"previous_names":["anasfanani/magisk-tailscaled"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasfanani%2FMagisk-Tailscaled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasfanani%2FMagisk-Tailscaled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasfanani%2FMagisk-Tailscaled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasfanani%2FMagisk-Tailscaled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anasfanani","download_url":"https://codeload.github.com/anasfanani/Magisk-Tailscaled/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074924,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","kernelsu","kernelsu-module","magisk","magisk-module","tailscale","tunnel","vpn","wireguard","wireguard-tunnel","wireguard-vpn","wireguard-vpn-setup"],"created_at":"2025-04-09T17:14:27.732Z","updated_at":"2025-04-09T17:14:28.404Z","avatar_url":"https://github.com/anasfanani.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![anasfanani - Magisk-Tailscaled](https://img.shields.io/static/v1?label=anasfanani\u0026message=Magisk-Tailscaled\u0026color=blue\u0026logo=github)](https://github.com/anasfanani/Magisk-Tailscaled \"Go to GitHub repo\")\r\n[![Check and Update Tailscale Binary](https://github.com/anasfanani/Magisk-Tailscaled/actions/workflows/update.yml/badge.svg)](https://github.com/anasfanani/Magisk-Tailscaled/actions/workflows/update.yml)\r\n[![Github All Releases](https://img.shields.io/github/downloads/anasfanani/Magisk-Tailscaled/total.svg)]()\r\n[![GitHub release](https://img.shields.io/github/release/anasfanani/Magisk-Tailscaled?include_prereleases=\u0026sort=semver\u0026color=blue)](https://github.com/anasfanani/Magisk-Tailscaled/releases/)\r\n[![issues - Magisk-Tailscaled](https://img.shields.io/github/issues/anasfanani/Magisk-Tailscaled)](https://github.com/anasfanani/Magisk-Tailscaled/issues)\r\n[![Static Badge](https://img.shields.io/badge/Discussion-Telegram-blue?style=flat\u0026logo=telegram\u0026link=t.me%2Fsystembinsh%2F158)](https://t.me/systembinsh/158)\r\n\r\n# Magisk Tailscaled\r\n\r\nThis repository contains a Magisk module for running Tailscale on rooted Android devices.\r\n\r\n## What is Tailscale?\r\n\r\nTailscale is a networking tool that allows you to connect each of your devices as if they were on the same VPN. For example, an Android phone connected to the Tailscale network can communicate with any other device connected to Tailscale. You can install it on your PC and Android device and then connect them using the Tailscale IP. For more information, check out [How Tailscale Works](https://tailscale.com/blog/how-tailscale-works).\r\n\r\n## Difference between this Magisk module and the Tailscale app on Play Store\r\n\r\nThe [Tailscale app](https://play.google.com/store/apps/details?id=com.tailscale.ipn) on the Play Store runs with Android's VPN, which means you can't use Tailscale while another VPN is active. This Magisk module, on the other hand, allows you to use both an Android VPN and Tailscale at the same time.\r\n\r\n## Requirements\r\n\r\n- A basic networking knowledge.\r\n- An Android device with Magisk root installed.\r\n\r\n## Quick Start \u0026 Installation\r\n\r\n1. Download the latest zip file from the [Releases](https://github.com/anasfanani/Magisk-Tailscaled/releases/latest) page.\r\n2. Install the downloaded zip file using Magisk \u0026 reboot your phone.\r\n3. Open the Terminal.\r\n4. Login with `su -c tailscale login`\r\n5. Disable accept-dns `su -c tailscale set --accept-dns=false`\r\n6. Run 'tailscale login' to login to your Tailscale account.\r\n7. Open the URL in a browser to authorize your device.\r\n8. Run 'tailscale ip' to retrieve your Tailscale IP.\r\n9. Alternatively, you can open the [Tailscale Admin Dashboard](https://login.tailscale.com/admin/machines) to manage your devices.\r\n\r\nAfter installation, the Tailscale daemon (`tailscaled`) will run automatically on boot.\r\n\r\n## Limitation\r\n\r\n- This module only support for `arm` or `arm64` architecture, you can download manually for other architecture.\r\n- Tailscale binary is designed to run in Linux environment, Some feature might not works properly.\r\n- MagicDNS currently not working.\r\n- Runs in userspace mode, read more at [https://tailscale.com/kb/1112/userspace-networking](https://tailscale.com/kb/1112/userspace-networking) \r\n- Subnet routes is manually routed with socks5-tun, you must define your own ip routes to `tailscaled.tun.up` and `tailscaled.tun.down`\r\n\r\n## Usage of this module\r\n\r\nThis module runs `tailscaled` with the following command:\r\n\r\n```bash\r\ntailscaled -tun=userspace-networking -statedir=/data/adb/tailscale/tmp/ -state=/data/adb/tailscale/tmp/tailscaled.state -socket=/data/adb/tailscale/tmp/tailscaled.sock -port=41641\r\n```\r\nThe state file for tailscaled is stored at `/data/adb/tailscale/tmp/tailscaled.state`, and the log output is written to `/data/adb/tailscale/run/tailscaled.log`.\r\n\r\n## Available command\r\n\r\n- `tailscale`: This command is execute tailscale operation.\r\n- `tailscaled`: This command is execute tailscaled daemon operation.\r\n- `tailscaled.service`: This command for manage tailscaled service, you can start,stop,restart daemon and view live logs the tailscaled operation.\r\n- `tailscaled.tun`: This command is for manage hev-socks5-tunnel.\r\n  \r\n## Example of Using Tailscale\r\n\r\n### SSH to Termux\r\n\r\nYou can use Tailscale to connect SSH from Termux on Android to a Windows PC. Here's how:\r\n\r\n#### On your Android device:\r\n\r\n1. Set up SSHD:\r\n\r\n```bash\r\napt update \u0026\u0026 apt upgrade\r\napt install openssh\r\npasswd\r\n```\r\n\r\nEnter your password when prompted, for example, `123`.\r\n\r\n2. Run ssh daemon with command `sshd`\r\n3. Get your IP with the command `tailscale ip` or check your IP in the [Tailscale Admin Dashboard](https://login.tailscale.com/admin/machines).\r\n\r\n#### On your Windows PC:\r\n\r\n1. Download \u0026 install [Tailscale for Windows](https://tailscale.com/download/windows)\r\n1. Open app \u0026 login to the Tailscale.\r\n3. Open the terminal \u0026 SSH to your Android IP:\r\n\r\n```bash\r\nssh \u003croot\u003e@\u003ctailscale_ip\u003e -p 8022\r\n```\r\n\r\nFor example:\r\n\r\n```bash\r\nssh root@100.95.95.95 -p 8022\r\n```\r\n\r\n### SSH access to your Android device\r\n\r\nYou can also enable SSH access to your Android device using [Tailscale SSH](https://tailscale.com/kb/1193/tailscale-ssh?slug=kb\u0026slug=1193\u0026slug=tailscale-ssh). To do this, advertise SSH on the host with the command `tailscale up --ssh`.\r\n\r\nBy default, Tailscale's SSH feature may not work on Android because it requires `getent`, which is part of GNU libc, and relies on glibc-specific features like nsswitch.conf.\r\n\r\nTo overcome this, I've created a mock `getent` and placed it in `tailscale/bin/`. This mock `getent` is used by Tailscale's [userLookupGetent](https://github.com/tailscale/tailscale/blob/5812093d31c8a7f9c5e3a455f0fd20dcc011d8cd/util/osuser/user.go#L121C19-L121C33) function.\r\n\r\nAfter advertising SSH on the host, you can SSH into your Android device using `ssh root@\u003ctailscale_ip\u003e`.\r\n\r\n### ADB over Tailscale\r\n\r\nYou can run ADB over Tailscale. First, you need to enable ADB over TCP/IP. You can do this with the following commands:\r\n\r\n```bash\r\nsetprop service.adb.tcp.port 5555\r\nstop adbd\r\nstart adbd\r\n```\r\n\r\nThese commands set the ADB daemon to listen on TCP port 5555 and then restart the ADB daemon to apply the change.\r\n\r\nAfter enabling ADB over TCP/IP, you can connect to your Android device from your Windows machine using the `adb connect` command followed by your Tailscale IP and the port number:\r\n\r\n```bash\r\nadb connect \u003ctailscale_ip\u003e:5555\r\n```\r\n\r\n## Avalilable command\r\n\r\n```\r\nUSAGE\r\n  tailscale [flags] \u003csubcommand\u003e [command flags]\r\n\r\nFor help on subcommands, add --help after: \"tailscale status --help\".\r\n\r\nThis CLI is still under active development. Commands and flags will\r\nchange in the future.\r\n\r\nSUBCOMMANDS\r\n  up         Connect to Tailscale, logging in if needed\r\n  down       Disconnect from Tailscale\r\n  set        Change specified preferences\r\n  login      Log in to a Tailscale account\r\n  logout     Disconnect from Tailscale and expire current node key\r\n  switch     Switches to a different Tailscale account\r\n  configure  [ALPHA] Configure the host to enable more Tailscale features\r\n  netcheck   Print an analysis of local network conditions\r\n  ip         Show Tailscale IP addresses\r\n  status     Show state of tailscaled and its connections\r\n  ping       Ping a host at the Tailscale layer, see how it routed\r\n  nc         Connect to a port on a host, connected to stdin/stdout\r\n  ssh        SSH to a Tailscale machine\r\n  funnel     Turn on/off Funnel service\r\n  serve      Serve content and local servers\r\n  version    Print Tailscale version\r\n  web        Run a web server for controlling Tailscale\r\n  file       Send or receive files\r\n  bugreport  Print a shareable identifier to help diagnose issues\r\n  cert       Get TLS certs\r\n  lock       Manage tailnet lock\r\n  licenses   Get open source license information\r\n  exit-node\r\n\r\nFLAGS\r\n  --socket string\r\n        path to tailscaled socket (default /var/run/tailscale/tailscaled.sock)\r\n```\r\n\r\nFor more details about CLI commands, check out the [Tailscale CLI documentation](https://tailscale.com/kb/1080/cli#using-the-cli).\r\n\r\n## FAQ \u0026 Troubleshooting\r\n\r\nTailscale has manny issues. You can check them out [here](https://github.com/tailscale/tailscale/issues).\r\n\r\n### Cannot access other tailnet devices\r\n\r\nThis module runs the `tailscaled` binary in userspace-networking mode. To access other devices in the tailnet, you must use a local proxy on port 1099. I've implemented a workaround using `hev-socks5-tunnel` to tunnel local socks5 on port 1099 and bind it to the interface named `tailscale0`. \r\n\r\nPlease note, this `tailscale0` interface is different from the original `tailscale0` interface on Linux. In Linux, `tailscale0` is managed by the `tailscaled` daemon, whereas in this module, `tailscale0` is managed by `hev-socks5-tunnel`. The default gateway is `100.100.100.100`, as defined in the `tailscaled.tun.config.yaml` file.\r\n\r\nThis solution should work on most common devices. However, if you encounter problems accessing other tailnet devices, follow these troubleshooting steps:\r\n\r\n1. Verify that `tailscaled.service` is running. If not, restart it with `tailscaled.service restart`.\r\n2. Verify that `tailscaled.tun` is running. If not, restart it with `tailscaled.tun restart`.\r\n3. Check if your device is connected to tailscaled and try a ping connection with `tailscale ping \u003cyour_tailnet_ip\u003e`.\r\n4. Verify the port you want to access is accessible. You can do this by accessing it with another tailscale device or using the Tailscale Android App.\r\n5. Check if the local socks5 server is working with curl. Execute the following command:\r\n    ```\r\n    curl 1.1.1.1 -vI -x localhost:1099\r\n    ```\r\n    If it connects, then the local socks5 server is running and working.\r\n\r\n6. Check if the local socks5 server can connect to the tailnet network.\r\n    ```\r\n    curl \u003cyour_tailnet_ip\u003e:\u003cport\u003e -vI -x localhost:1099\r\n    ```\r\n    If it connects, then the local socks5 server is functioning correctly.\r\n\r\n7. Finally, check the connection directly with `curl \u003cyour_tailnet_ip\u003e:\u003cport\u003e -vI`.\r\n\r\nIf the last step fails, the problem likely lies with `socks5-tun`. Verify there is an interface named `tailscale0`. If it exists, the problem may be with the iptables route, either due to a conflict with another rule or some other issue. Feel free to explore your own solutions. If you're unable to resolve the issue, contact me on Telegram and I'll see if I can assist you.\r\n\r\n### My subnet-routes is'nt working\r\n\r\nYes because we need define the routes with `iptables` in file `tailscaled.tun.up` and `tailscaled.tun.down`, you can check this [issue reference](https://github.com/anasfanani/Magisk-Tailscaled/issues/17).\r\nI suppose you're already know the iptables works, if dont, there are chatAI to ask.\r\nYou can copy whole `tailscaled.tun.up` script to chatAI and send instruction with please add 192.168.1.1/24 to this route, also dont forget `tailscaled.tun.down` \r\n\r\nIf you still can't do it by yourself, I'm verry welcome to people who needs help.\r\n\r\n### Exit nodes\r\n\r\nYou can check this [issue reference](https://github.com/anasfanani/Magisk-Tailscaled/issues/17).\r\n\r\n### ipv6\r\n\r\nUnfortunately, I'm verry lazy to learn ipv6.\r\n\r\n### Headscale \r\n\r\nCheck [this](https://github.com/anasfanani/Magisk-Tailscaled/issues/19#issuecomment-2091579177).\r\nAlso explore on the issue first, then you can ask trough telegram.\r\n\r\n\r\n### Other Error \u0026 Bugs\r\n\r\nYou can explore to the issue tab, if there not exists, you can open issue, for help me resolve the problem, you can include fresh log.\r\n\r\n1. Restart tailscaled with `tailscaled.service restart`\r\n2. Reproduce what are you doing which has problem.\r\n3. Get log at `/data/adb/tailscale/run/tailscaled.log`\r\n\r\n## Notes\r\n\r\nThis module is confirmed to be supported for KernelSU, as [confirmed by the author of KernelSU](https://github.com/anasfanani/Magisk-Tailscaled/issues/2#issue-2055047162). If you encounter any problems, please let me know.\r\n\r\nFor more information, check out the links below:\r\n\r\n## Links\r\n\r\n- [Tailscale Userspace Networking](https://tailscale.com/kb/1112/userspace-networking/)\r\n- [Termux Issue #10166](https://github.com/termux/termux-packages/issues/10166)\r\n- [Tailscale Static Packages](https://pkgs.tailscale.com/stable/#static)\r\n- [Tailscale Knowledge Base](https://tailscale.com/kb)\r\n\r\n## Credits\r\n\r\n- [Tailscale Inc \u0026 AUTHORS](https://github.com/tailscale/tailscale). for the static binaries of tailscale \u0026 tailscaled\r\n- [John Wu \u0026 Authors](https://github.com/topjohnwu/Magisk). for The Magic Mask for Android\r\n- [heiher \u0026 Authors](https://github.com/heiher/hev-socks5-tunnel). for the hev-socks5-tunnel\r\n\r\n## Disclaimer\r\n\r\nThis module is provided as-is, I'm not employee at official tailscale, not a verry genius people which can resolve all your problem.\r\nThis module is not affiliated with the official Tailscale. It is a third-party implementation and the author is not responsible for any damage to your device that may occur from its use. Use at your own risk.\r\nAny improvements is required, any PR is verry required, not just welcome.\r\n\r\n## License\r\n\r\nReleased under [BSD 3-Clause License](/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasfanani%2Fmagisk-tailscaled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanasfanani%2Fmagisk-tailscaled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasfanani%2Fmagisk-tailscaled/lists"}