Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openwrt package #724

Closed
crawshaw opened this issue Aug 30, 2020 · 47 comments · Fixed by openwrt/packages#15539
Closed

openwrt package #724

crawshaw opened this issue Aug 30, 2020 · 47 comments · Fixed by openwrt/packages#15539
Labels
help wanted Extra attention is needed L3 Some users Likelihood P3 Can't get started Priority level packaging T6 Major usability Issue type

Comments

@crawshaw
Copy link
Contributor

crawshaw commented Aug 30, 2020

User reports say that tailscale works on openwrt with the static arm binary. The only extra step that's required is opkg install kmod-tun.

(This is complicated by the fact that there's more than one flavor of openwrt.)

Front logo Front conversations

@bradfitz
Copy link
Member

bradfitz commented Sep 2, 2020

Notes to self, looking in to how I can run OpenWRT in a VM:

https://openwrt.org/docs/guide-user/installation/openwrt_x86
https://downloads.openwrt.org/releases/19.07.3/targets/x86/64/

@willangley
Copy link

Yes, yes it does :)

That said, I needed opkg install ca-bundle kmod-tun on OpenWrt 19.07.4. ca-bundle is commonly installed to work from the command line though; I probably would have missed it too if I hadn't broken my firmware while experimenting and needed to reinstall.

Blog post with details and a simple init script: How I set up Tailscale on my WiFi router

@bradfitz
Copy link
Member

@willangley, that's great, thanks!

bradfitz added a commit that referenced this issue Sep 22, 2020
And help out with missing packages.

Thanks to @willangley for tips.

Updates #724
@bradfitz
Copy link
Member

@willangley, I pushed 5d8b88b to make things easier for people in the future too.

@talway
Copy link

talway commented Dec 25, 2020

The new version has been tested. The installation can be used in OpenWrt R20.7.1.

But the open boot and pre-authentication keys are missing

Start and start also need script operation, can this be integrated;

@Strykar
Copy link

Strykar commented Jan 14, 2021

It's rather painless to package for OpenWRT, I'm happy to assist.
A web interface like luci-app-tailscale would be an amazing carrot for adoption.

https://openwrt.org/docs/guide-developer/packages
https://openwrt.org/docs/guide-developer/helloworld/chapter3

@talway
Copy link

talway commented Jan 14, 2021

There is no problem with the installation. It is mainly the integration of startup after boot, and I hope it can be integrated into the package. After installation, it can be started

@talway
Copy link

talway commented Jan 14, 2021

``#!/bin/sh /etc/rc.common

Copyright 2020 Google LLC.

SPDX-License-Identifier: Apache-2.0

USE_PROCD=1
START=80

start_service() {
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 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
}

https://willangley.org/how-i-set-up-tailscale-on-my-wifi-router/

This service code is integrated into the application

@adyanth
Copy link

adyanth commented Jan 18, 2021

This is working for me pretty well adyanth/openwrt-tailscale-enabler. Looking into making an ipk from this.

Note that I have to download the tailscale binaries on boot since my flash is only 8MB (3MB free) and the tailscale binaries are 14MB and 9MB.

Thanks to @talway / @willangley this for the inspiration

@Strykar
Copy link

Strykar commented Jan 18, 2021

Pre-built binaries are generally frowned upon by OpenWRT, but here's an example of doing it right - https://github.com/yousong/waller/tree/master/k3s
A package should not be downloading all the binaries, just the one relevant for the architecture.

@adyanth
Copy link

adyanth commented Jan 18, 2021

Yeah, that's correct. But in this case, that script only downloads the MIPS static binary which the (my) router runs on. It's a feeble attempt at automating the install with a version option to switch the arch, and a proper ipk should include compilation for the specific platform.

@talway
Copy link

talway commented Jan 18, 2021

@bradfitz Hello, can you integrate this installation script into the installation program to support the router system openwrt.

@talway
Copy link

talway commented Jan 18, 2021

这对我很有效adyanth / tailscale-enabler。希望以此制作一个ipk。

请注意,由于闪存只有8MB(免费3MB),而尾标二进制文件分别为14MB和9MB,因此必须在引导时下载tailscale二进制文件。

感谢@talway /这个的启发

This script yes@willangley, I just see the copy, can you push your script to this code base

https://github.com/willangley

@Strykar
Copy link

Strykar commented Jan 18, 2021

@adyanth There is no need to create an .ipk, just create a Makefile.
Use https://github.com/yousong/waller/blob/master/k3s/Makefile as an example and see https://openwrt.org/docs/guide-developer/packages

If it's accepted upstream into OpenWRT, then end users can simply run opkg install scaleway-tailscale or whatever.
If it's not accepted upstream, end users just use your Makefile and create their own package, or you provide a package feed users add to their own build system's feeds.conf, see https://openwrt.org/docs/guide-developer/feeds.

Here's an example of a 3rd party package feed: https://github.com/zhaojh329/openwrt-feed

@talway
Copy link

talway commented Jan 18, 2021

@Strykar
Hello, can you make an automatic script and push it to this library, so that each release can have the corresponding openwrt installation package, which simplifies the openwrt installation of this system. Thank you!

@talway
Copy link

talway commented Jan 18, 2021

Do this and this
https://openwrt.org/packages/pkgdata/syncthing
https://github.com/openwrt/packages/tree/openwrt-19.07/utils/syncthing

@adyanth
Copy link

adyanth commented Jan 18, 2021

@Strykar that's interesting. Will check that out soon, and see if I can get something running. The issue is opkg by default installs in flash, but for many routers, ~20MB free space in flash is doubtful.
If installed to /tmp using -o that would make sense.

@Strykar
Copy link

Strykar commented Jan 18, 2021

@Strykar
Hello, can you make an automatic script and push it to this library, so that each release can have the corresponding openwrt installation package, which simplifies the openwrt installation of this system. Thank you!

I could, but honestly, IMHO, an openwrt luci-app-tailscale would be the way forward and scale adoption. Sadly, I am not the person to create and maintain a luci web interface app.

@Strykar
Copy link

Strykar commented Jan 18, 2021

but for many routers, ~20MB free space in flash is doubtful.
If installed to /tmp using -o that would make sense.

@adyanth 32 MB Flash / 128 MB RAM is recommended going forward.
This may not solve your issue, but it is the type of hardware Openwrt developers and package maintainers will look to support now and in the future.
4MB FLASH / 32MB RAM device support ended in 2019. See https://openwrt.org/supported_devices/432_warning

@adyanth
Copy link

adyanth commented Jan 18, 2021

Openwrt supports 8MB or above. Mine is 8MB flash with 128MB RAM, and is running the latest openwrt with no issues. I was surprised that I was even able to install packages such as openvpn in it, most of them being much less than 500kb in size.

Maybe a highly stripped down version of tailscale would work. But I get that 32MB flash would provide more headroom to work with. Sadly this is the hardware I'm stuck with for now :/

@talway
Copy link

talway commented Jan 18, 2021

@Strykar
您好,您可以制作一个自动脚本并将其推送到该库中,以便每个发行版都可以具有相应的openwrt安装软件包,从而简化了该系统的openwrt安装。谢谢!

@Strykar
Hello, can you make an automatic script and push it to this library, so that each release can have the corresponding openwrt installation package, which simplifies the openwrt installation of this system. Thank you!

I could, but honestly, IMHO, an openwrt luci-app-tailscale would be the way forward and scale adoption. Sadly, I am not the person to create and maintain a luci web interface app.

Oh, I understand. I don't think it's a problem. How about writing it first? This can be solved through communication;

@DentonGentry DentonGentry added the help wanted Extra attention is needed label Feb 8, 2021
@kgursu
Copy link

kgursu commented Feb 26, 2021

Do you need testers in the future? Count me in...

@thatsthat
Copy link

thatsthat commented Mar 28, 2021

@Strykar that's interesting. Will check that out soon, and see if I can get something running. The issue is opkg by default installs in flash, but for many routers, ~20MB free space in flash is doubtful.
If installed to /tmp using -o that would make sense.

Most routers nowadays have a USB port, so I wonder if a cheap flash pendrive wouldn't solve this issue in most cases. Instructions here can be followed.

@bhyde
Copy link

bhyde commented Apr 22, 2021

FYI - On this here openwrt router uname -m reports mips, but the mips version didn't work,

But yeah! /etc/openwrt_release says:

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='19.07.3'
DISTRIB_REVISION='r11063-85e04e9f46'
DISTRIB_TARGET='ramips/mt7621'
DISTRIB_ARCH='mipsel_24kc'
DISTRIB_DESCRIPTION='OpenWrt 19.07.3 r11063-85e04e9f46'
DISTRIB_TAINTS=''

Note mipsel which lead me to use the mipsle version provided here: https://pkgs.tailscale.com/stable/#static.

Apparently there is some confusion about mipsel v.s. mipsle which I didn't investigate much.

@willangley
Copy link

@bhyde did the mipsle version work, or did both fail?

I'm happy to update my blog post based on your experience – uname -m is clearly not the right command, but since I don't have any MIPS devices right now it'd be good to know if that worked for you 😀 .

@ja-pa
Copy link

ja-pa commented Apr 29, 2021

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . Package is based on info from this issue . If you have any suggestions, please let me know.

@bradfitz
Copy link
Member

@ja-pa, thank you!

@bhyde
Copy link

bhyde commented Apr 30, 2021

@willangley

@bhyde did the mipsle version work, or did both fail?

The mipsle worked, at least I could ssh into the router using the magic dns name and the tailscale IP.

Sadly advertising it as an exit node didn't work out. But that maybe due to excessively clever things I'd done to the router in the past. Fixed on my end, was an issue with my DNS settings in the tailscale admin panel.

I'm happy to update my blog post based on your experience – uname -m is clearly not the right command, but since I don't have any MIPS devices right now it'd be good to know if that worked for you 😀 .

My excessively opaque comment "confusion about mipsel v.s. mipsle" was due to a brief glance at this posting - https://superuser.com/questions/1262144/naming-mipsle-vs-mipsel.

@ja-pa
Copy link

ja-pa commented May 7, 2021

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . The package is based on info from this issue . If you have any suggestions, please let me know.

Hi,
tailscale package was merged to OpenWrt packages repo and should be soon available for download from OpenWrt snapshots https://downloads.openwrt.org/snapshots

The list of supported architectures is here https://github.com/openwrt/packages/blob/master/lang/golang/golang-values.mk#L126

(example https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscale_1.6.0-1_arm_cortex-a8_vfpv3.ipk and https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscaled_1.6.0-1_arm_cortex-a8_vfpv3.ipk )

Feel free to test it and let me know if you have any problems or suggestions for improvements.

@talway
Copy link

talway commented May 12, 2021

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . The package is based on info from this issue . If you have any suggestions, please let me know.

Hi,
tailscale package was merged to OpenWrt packages repo and should be soon available for download from OpenWrt snapshots https://downloads.openwrt.org/snapshots

The list of supported architectures is here https://github.com/openwrt/packages/blob/master/lang/golang/golang-values.mk#L126

(example https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscale_1.6.0-1_arm_cortex-a8_vfpv3.ipk and https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscaled_1.6.0-1_arm_cortex-a8_vfpv3.ipk )

Feel free to test it and let me know if you have any problems or suggestions for improvements.

Thank you for your work. Can this version be kept up to date

@talway
Copy link

talway commented May 12, 2021

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . The package is based on info from this issue . If you have any suggestions, please let me know.

Hi,
tailscale package was merged to OpenWrt packages repo and should be soon available for download from OpenWrt snapshots https://downloads.openwrt.org/snapshots

The list of supported architectures is here https://github.com/openwrt/packages/blob/master/lang/golang/golang-values.mk#L126

(example https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscale_1.6.0-1_arm_cortex-a8_vfpv3.ipk and https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscaled_1.6.0-1_arm_cortex-a8_vfpv3.ipk )

Feel free to test it and let me know if you have any problems or suggestions for improvements.

I see that there are 2 files in each schema, one of which has an extra d ending. What is the difference between these 2 files

https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/tailscale_1.8.1-1_aarch64_cortex-a53.ipk
https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/tailscaled_1.8.1-1_aarch64_cortex-a53.ipk
What's the difference

@ja-pa
Copy link

ja-pa commented May 12, 2021

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . The package is based on info from this issue . If you have any suggestions, please let me know.

Hi,
tailscale package was merged to OpenWrt packages repo and should be soon available for download from OpenWrt snapshots https://downloads.openwrt.org/snapshots
The list of supported architectures is here https://github.com/openwrt/packages/blob/master/lang/golang/golang-values.mk#L126
(example https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscale_1.6.0-1_arm_cortex-a8_vfpv3.ipk and https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscaled_1.6.0-1_arm_cortex-a8_vfpv3.ipk )
Feel free to test it and let me know if you have any problems or suggestions for improvements.

I see that there are 2 files in each schema, one of which has an extra d ending. What is the difference between these 2 files

https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/tailscale_1.8.1-1_aarch64_cortex-a53.ipk
https://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a53/packages/tailscaled_1.8.1-1_aarch64_cortex-a53.ipk
What's the difference

tailscale package contains just CLI utility (https://tailscale.com/kb/1080/cli/). It cannot be installed without installing tailscaled package.

tailscaled package contains tailscaled binary, init script and uci config. Tailscaled runs as a daemon and provides connectivity to tailscale network.

The reason why is tailscale utility separated is, that most users won't need it installed for the whole time and will use it only for setup. So it can be uninstalled later and save 6,8M of disk space. (That is the idea why it is packaged separately).

I created a small readme how to use it https://github.com/openwrt/packages/tree/master/net/tailscale.

@djeraseit
Copy link

Has anyone tried tailscale using the --exit-node paramenter?

I'm able to use the exit node directly from the router (i.e. curl https://ifconfig.me shoes the exit node IP address).

Unfortunately, it seems there needs to be something put in /etc/config/firewall rules (or maybe even /etc/config/network) to have traffic from my LAN exit out of the tailscale0 interface.

Has anyone had any luck? I've also tried to --advertise-routes flag.

@bhyde
Copy link

bhyde commented May 13, 2021

Has anyone tried tailscale using the --exit-node paramenter

I'll assume you mean on openwrt. Yes, I have some openwrt devices around the house acting to bridge the LAN Ethernet to wifi. On one of these I have the exit node setup, and that works.

For example, I tell tailscale on my phone when I'm out and about to use that exit node and my traffic flows back to my house and then out again. I used https://myip.com/ to check that.

I'll admit I haven't used it much; so it might be slow, fail under load, etc. And i've yet to upgrade to the new opkg.

@felixn-unity
Copy link

Hi

I am not so much into OpenWRT, but when to "--accept-routes" on tailscale UP all bridge-lan traffic died - I am running wlan over wireless

Any clues thanks

Felix

@adyanth
Copy link

adyanth commented Sep 20, 2021

Accepting routes messes with the routing table that OpenWRT uses to, well, route everything, lan and wan traffic. Tailscale routes have higher priority. If you have overlapping IPs, it would cause issues.

I always disable both accepting routes and DNS when using on routers.

@felixn-unity
Copy link

Tailscale normally only add routes to each subnet advertised from the tailscale mesh. I need "accept-routes" or else my tailscale client can't reach stuff on the mesh. - maybe tailscale is doing this differently on Openwrt

Thanks

@adyanth
Copy link

adyanth commented Sep 20, 2021

Ohh, you are using the router as a Tailscale client for all the devices behind it? Then yes, you need to accept routes. But I have had issues using it in such a way. I'll let others comment on this usecase.

PS: it's probably OpenWRT, not Tailscale client messing it up

@felixn-unity
Copy link

felixn-unity commented Sep 20, 2021

Yes and thanks - if I don't do "accept-routes" there is no issue with local bridge-lan

@bitsn1per
Copy link

Hi, I created PR with tailscale package to OpenWrt packages repo openwrt/packages#15539 . The package is based on info from this issue . If you have any suggestions, please let me know.

Hi, tailscale package was merged to OpenWrt packages repo and should be soon available for download from OpenWrt snapshots https://downloads.openwrt.org/snapshots

The list of supported architectures is here https://github.com/openwrt/packages/blob/master/lang/golang/golang-values.mk#L126

(example https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscale_1.6.0-1_arm_cortex-a8_vfpv3.ipk and https://downloads.openwrt.org/snapshots/packages/arm_cortex-a8_vfpv3/packages/tailscaled_1.6.0-1_arm_cortex-a8_vfpv3.ipk )

Feel free to test it and let me know if you have any problems or suggestions for improvements.

Hello, friend!

Thank you so much for your work! Those, who wants to use Tailscale appreciate it, and me too)

About a month ago I started to use Tailscale on my fresh OpenWRT install. Most of the features works well, except using the exit node.

There is some problems I don't know how to solve yet. When I'm trying to start using exit node in order to give access to devices connected to the router it fails.

In other words router connects to the node, and It can establish connection through exit node (I've tried ping with it some servers and it works) but all the other devices cannot get access to the Internet.

Hope you can help to find the solution for this issue. Thanks in advance!

@yousaf465
Copy link

Can the Openwrt router be used as tailscale subnet?

@Editst
Copy link

Editst commented Jun 26, 2022

I usr it on OpenWrt and set the subnet 10.0.0.0/24, but I can not ping the 10.0.0.1 on other computer. Tailscale can recive the ICMP package like this

tailscaled[2582]: 2022/06/26 16:20:23 Accept: ICMPv4{100.65.43.37:0 > 10.0.0.1:0} 60 icmp ok

It seems like tailscale can not send the package back to other computer. Do I need to set the firewall on OpenWrt?

@yfhyou
Copy link

yfhyou commented Jun 27, 2022

There seems to be a bit of confusion about subnet and exit routes.
If tailscale is installed as a subnet router it can help outside tailscale nodes get to devices behind the router. However, the opposite is not true by default.
In order to send devices behind a subnet router to the tailscale network, you would need to modify the ip route tables to include something like ip route add 100.64.0.0/10 via 192.168.1.1 where 192.168.1.1 is the tailscale subnet router. 100.64.0.0/10 is the CIDR of all tailscale possible address.
Tailscale itself is not capable of intersecting all network traffic destined for that range.
https://tailscale.com/kb/1019/subnets/
https://www.procustodibus.com/blog/2020/12/wireguard-site-to-site-config/
Perhaps the above link will help explain what i mean a bit better. I was able to get this to work on DD-WRT, although tailscale is too unreliable to run full time and don't have a openwrt router :(

@yousaf465
Copy link

There seems to be a bit of confusion about subnet and exit routes. If tailscale is installed as a subnet router it can help outside tailscale nodes get to devices behind the router. However, the opposite is not true by default. In order to send devices behind a subnet router to the tailscale network, you would need to modify the ip route tables to include something like ip route add 100.64.0.0/10 via 192.168.1.1 where 192.168.1.1 is the tailscale subnet router. 100.64.0.0/10 is the CIDR of all tailscale possible address. Tailscale itself is not capable of intersecting all network traffic destined for that range. https://tailscale.com/kb/1019/subnets/ https://www.procustodibus.com/blog/2020/12/wireguard-site-to-site-config/ Perhaps the above link will help explain what i mean a bit better. I was able to get this to work on DD-WRT, although tailscale is too unreliable to run full time and don't have a openwrt router :(

how you will enter the CIDR when ips are in range of 100.66.32.11 to 100.125.55.64?

@yfhyou
Copy link

yfhyou commented Jun 28, 2022

how you will enter the CIDR when ips are in range of 100.66.32.11 to 100.125.55.64?

The 100.64.0.0/10 CIDR include 100.64.0.0 - 100.127.255.255. The address you asked about are included in this range already. https://www.subnet-calculator.com/cidr.php

@DentonGentry
Copy link
Contributor

Likely relevant for this audience: https://tailscale.com/kb/1207/small-tailscale/

@DentonGentry
Copy link
Contributor

Fixed by openwrt/packages#15539

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed L3 Some users Likelihood P3 Can't get started Priority level packaging T6 Major usability Issue type
Projects
None yet
Development

Successfully merging a pull request may close this issue.