0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenWrt で縮小版 Tailscale を使用する

Last updated at Posted at 2024-10-08

この記事を書いた目的

以下の記事に従って、縮小版 Tailscale (約 5MB)を使用したところ、問題なく動作したので使用手順を説明します。

👉 opkg install tailscale でインストールされるファイルに比べ、サイズが格段に小さくなります。🎉

👉 よりタイトな環境での Tailscale の導入記事「フラッシュメモリの空き容量が 10MB しかない OpenWrt で Tailscale を使用する」を書きました。🎉

使用手順

1. 標準版 Tailscale のインストール

1. 必要なパッケージをインストール

opkg update
opkg install tailscale

OpenWrt 22.03 以降であれば以下のパッケージを追加

opkg install iptables-nft kmod-nft-nat \
  kmod-ipt-conntrack kmod-ipt-conntrack-extra kmod-ipt-conntrack-label

👉 2024/10/06 に OpenWrt の Tailscale ページが更新され、それ以前は opkg install iptables-nft だけだったものが上記内容に変更されています。

conntrack 関連のパッケージが追加された理由はこちら -> issue #13859

2. InterfaceFirewall の追加

以下のページを参照

日本語の方が良い場合は以下のページを参照

👉 私の /etc/config での設定
  1. /etc/config/network での追加部分

    /etc/config/network
    config interface 'tailscale'
       option proto 'none'
       option device 'tailscale0'
    
  2. /etc/config/firewall での追加部分

    Subnet Router として使うため、以下の設定にしています。

    /etc/config/firewall
    config rule
       option name 'Allow-Tailscale'
       option src '*'
       option target 'ACCEPT'
       option proto 'udp'
       option dest_port '41641'
    
    config zone
       option name 'tailscale'
       option input 'ACCEPT'
       option output 'ACCEPT'
       option forward 'ACCEPT'
       option masq '1'
       option mtu_fix '1'
       list network 'tailscale'
    
    config forwarding
       option src 'tailscale'
       option dest 'lan'
    
    config forwarding
       option src 'lan'
       option dest 'tailscale'
    
    config forwarding
       option src 'tailscale'
       option dest 'wan'
    

2. 縮小版 Tailscale への置き換え

xz のインストール

opkg update
opkg install xz

👉 こんな事件もありましたね。。。

ファイルのダウンロードと置き換え

  • 補足 1.
    64-bit ARM CPU 専用ですが、ダウンロードするファイル( tailscaled-linux-arm64 の部分)を変更すれば他のプラットフォームでも使用できます。
  • 補足 2.
    アップデートスクリプトとしても使用できます。
/etc/config/tailscale-tiny.sh
service tailscale stop
sleep 5

wget -O /tmp/tailscaled \
  https://github.com/Admonstrator/glinet-tailscale-updater/releases/latest/download/tailscaled-linux-arm64

mv /tmp/tailscaled /usr/sbin/tailscaled
ln -svf /usr/sbin/tailscaled /usr/sbin/tailscale
chmod +x /usr/sbin/tailscaled

service tailscale start
tailscale set --auto-update=false

👉 元々のスクリプトはこちらです。

使用するバイナリの安全性

使用するバイナリの安全性を検証したい場合は、以下のページでビルドの内容を確認してください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?