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?

とにかくなんでもつなげちゃえ!Tailscaleという便利サービス

Posted at

はじめに

この記事は、Qiita Advent Calendar 23日目の記事です。
以下の記事より、すべての記事をご覧になれます。

本編

みなさん、VPN接続を使いたい時ってどうしていますか?僕は、かつては全てSoftetherのVPNサーバーを使っていたのですが、ずっと考えていることがありました。それは、サーバーとクライアントのような設定にはしたくない。

これにはいくつかの理由があるのですが、僕の場合、

  • 安定したインターネット環境がないのでどこか一つにVPNサーバーを設置すると全てが使えなくなる可能性がある
  • 時と場合によっては既存のVPNがきちんと使えない中でどこか一つがダメになるというのはめんどくさい
  • そもそもユーザー管理とかの危機管理がきちんとできる自信がない。

そこで辿り着いた一つ目のVPNが、WireGuardでした。

WireGuard、難しすぎる

WireGuardをご存知ですか?(舐めるな)

WireGuardは、僕にとっては非常に難しかったです。というのも、Configファイルの設定とか、もうぐぁーー!て感じです。しかも、僕はVPCを使っていることもあってそこの特殊な設定には少々慣れていない部分もあり、このWireGuardを最初はUTMで試してみたものの接続できずなす術がありませんでした。

万能サービス「Tailscale」

TailscaleはTailscale社が提供しているVPNサービスです。

このTailscaleというサービスは分散型VPNでさまざまなサービスを提供しています。(といっても僕が使っているのは本当にVPNだけですが、、、。)みなさん、ぜひチェックしてみてください!

image.png

引用:https://tailscale.com/

Tailscaleを使ってみよう!

まずは兎にも角にもTailscaleを使ってみましょう!

ログインして登録したらとりあえずアカウントの登録自体は完了です。

ログインが終わったら、自分が持っている端末にそれぞれインストールしていきます。

iOS・Android

アプリをダウンロードしましょう。

ログインして接続したら終わりです!

Captura de pantalla 2024-12-24 a la(s) 10.50.55 2.jpeg

Screenshot_2024-12-24-10-51-46-903_com.tailscale.ipn.jpg

Mac

App Storeかもしくは直接ダウンロードしてインストールします。

終わってこちらもログインしたら接続まで簡単です!

ちなみに、Mac版はインストールが終わったらコマンドが使えるようになります。

(arm64) tailscale
The easiest, most secure way to use WireGuard.

USAGE
  tailscale [flags] <subcommand> [command flags]

For help on subcommands, add --help after: "tailscale status --help".

This CLI is still under active development. Commands and flags will
change in the future.

SUBCOMMANDS
  up          Connect to Tailscale, logging in if needed
  down        Disconnect from Tailscale
  set         Change specified preferences
  login       Log in to a Tailscale account
  logout      Disconnect from Tailscale and expire current node key
  switch      Switches to a different Tailscale account
  configure   [ALPHA] Configure the host to enable more Tailscale features
  syspolicy   Diagnose the MDM and system policy configuration
  netcheck    Print an analysis of local network conditions
  ip          Show Tailscale IP addresses
  dns         Diagnose the internal DNS forwarder
  status      Show state of tailscaled and its connections
  metrics     Show Tailscale metrics
  ping        Ping a host at the Tailscale layer, see how it routed
  nc          Connect to a port on a host, connected to stdin/stdout
  ssh         SSH to a Tailscale machine
  funnel      Serve content and local servers on the internet
  serve       Serve content and local servers on your tailnet
  version     Print Tailscale version
  web         Run a web server for controlling Tailscale
  file        Send or receive files
  bugreport   Print a shareable identifier to help diagnose issues
  cert        Get TLS certs
  lock        Manage tailnet lock
  licenses    Get open source license information
  exit-node   Show machines on your tailnet configured as exit nodes
  update      Update Tailscale to the latest/different version
  whois       Show the machine and user associated with a Tailscale IP (v4 or v6)
  drive       Share a directory with your tailnet
  completion  Shell tab-completion scripts

FLAGS
  --socket value
    	path to tailscaled socket (default /var/run/tailscaled.socket)

Windows

ダウンロードしてログインしたら終わりです。

が、Windows版に関しては少し気をつけないといけないことがありまして。Windowsに複数ユーザーを設定している場合は、インストーラーを実行したユーザー以外が最初にログインしたらうまく接続できなくなりますので、トリガーを設定する必要があります。トリガーには下のコマンドを設定しましょう。

tailscale up

Linux

下のコマンドを入力したら色々勝手にインストールしてくれます。

curl -fsSL https://tailscale.com/install.sh | sh

sudo tailscale up

IPの設定

image.png

インストールが完了したらTailscaleのAdmin画面には下のようにデバイスが一覧のリストになっています。ちなみに、ここでIPの設定とかも変更できるようなので、ぜひみなさんやってみてください。

MagicDNS

MagicDNSは、どうやらユニークなアドレスで各デバイスにアクセスできるようになる機能のようです。(僕は使っていません。)

Nameservers

Nameserversを上書きすることができます。が、これもMagicDNSを使わないのであれば使用しないですし、僕は色々なネットワークが限られた環境で使うことが多いので、この機能を使おうとすると碌にネットに繋がらなくなるようになります:(

Exit nodes

全てのトラフィックを一つのノードから通過させる方法です。これを使うと普通のVPNのように使えます。

最後に

今回はちょっと一風変わったVPNを紹介しました。こんなに便利なサービスはありませんので、ぜひみなさん使ってみてください!

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?