3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Tailscaleで繋がらなくなったときにまずやること

Last updated at Posted at 2021-09-20

普段m75q tiny gen 2にUbuntuとTailscaleを入れて、MBPからVS Code Remote SSHでつないで開発機にしているのですが、今日一台が止まってしまって一瞬途方にくれたので、試した手順を残しておきます。

まずは tailscaled のログを見てみる。

mumoshu@m75q2a:~$ journalctl -u tailscaled -f
-- Logs begin at Tue 2021-03-23 04:27:16 UTC. --
Sep 20 00:33:56 m75q2a tailscaled[494123]: wgengine: Reconfig: configuring router
Sep 20 00:33:56 m75q2a tailscaled[494123]: wgengine: Reconfig: configuring DNS
Sep 20 00:33:56 m75q2a tailscaled[494123]: dns: Set: {DefaultResolvers:[] Routes:{} SearchDomains:[] Hosts:0}
Sep 20 00:33:56 m75q2a tailscaled[494123]: dns: Resolvercfg: {Routes:{} Hosts:0 LocalDomains:[]}
Sep 20 00:33:56 m75q2a tailscaled[494123]: dns: OScfg: {Nameservers:[] SearchDomains:[] MatchDomains:[]}
Sep 20 00:33:56 m75q2a tailscaled[494123]: authReconfig: blocked, skipping.
Sep 20 00:33:56 m75q2a tailscaled[494123]: control: authRoutine: state:url-visit-required; wantLoggedIn=true
Sep 20 00:33:56 m75q2a tailscaled[494123]: control: direct.WaitLoginURL
Sep 20 00:33:56 m75q2a tailscaled[494123]: control: doLogin(regen=false, hasUrl=true)
Sep 20 00:33:56 m75q2a tailscaled[494123]: control: RegisterReq: onode=[z4dNC] node=[f40t/] fup=true

特段エラーメッセージが出ているとか、エラー終了してしまっているということはないようだ。

次に tailscale コマンドを引数なしで実行してみて、状況調査に使えそうなものを探す。今回は netcheckstatus を選ぶ。

$ tailscale netcheck

Report:
	* UDP: false
	* IPv4: (no addr found)
	* IPv6: no
	* MappingVariesByDestIP: 
	* HairPinning: 
	* PortMapping: 
	* Nearest DERP: unknown (no response to latency probes)
mumoshu@m75q2a:~$ tailscale status
Logged out.

Log in at: https://login.tailscale.com/a/**REDACTED**

status のほうは tailscale.com へのログインが行われていない状態になってしまっている(特にログアウトの操作はしていないが)のは明らかにおかしいので、ひとまず再ログインを試みる。

指定されたURLからログインを行った後に tailscale statustailscale netcheck を実行してみると、ログイン前と結果が変わっていた。

mumoshu@m75q2a:~$ tailscale status
100.93.169.59   m75q2a               ykuoka@      linux   -
100.101.102.103 ("hello")            services@    linux   -
100.92.190.40   m75q2b               ykuoka@      linux   -
100.81.211.118  mymac                ykuoka@      macOS   active; direct 183.176.176.81:41641, tx 5280 rx 4532
mumoshu@m75q2a:~$ tailscale netcheck

Report:
	* UDP: true
	* IPv4: yes, 121.2.182.55:11787
	* IPv6: yes, [240b:253:4840:bf00:e24f:43ff:fee8:449a]:57712
	* MappingVariesByDestIP: false
	* HairPinning: false
	* PortMapping: 
	* Nearest DERP: Tokyo
	* DERP latency:
		- tok: 18.1ms  (Tokyo)
		- sin: 90.7ms  (Singapore)
		- sea: 121.3ms (Seattle)
		- sfo: 124.5ms (San Francisco)
		- blr: 131.3ms (Bangalore)
		- dfw: 148.5ms (Dallas)
		- ord: 156.1ms (Chicago)
		- nyc: 184.7ms (New York City)
		- syd: 204.9ms (Sydney)
		- lhr: 267.7ms (London)
		- fra: 269.2ms (Frankfurt)
		- sao: 296.6ms (São Paulo)

この直後にVS CodeでRemote SSHしてみると、無事接続できるようになっていた。

tailscale statusで異常が見られないとき

上記の例だと status コマンドの結果 Logged out. が出力されていて認証がきれているのが明らかだったが、そうならないのに疎通しないこともあった。

ssh 100.xx.xx.xx で接続できないが、 LAN からは ssh で繋がる。 LAN から ssh で接続して taiilscale status を打ってみると以下の状態(m75q2bが疎通しないのにIPアドレスが認識されているし、Logged outでもない):

$ tailscale status
100.92.190.40   m75q2b               ykuoka@      linux   -
100.101.102.103 ("hello")            services@    linux   -
100.93.169.59   m75q2a               ykuoka@      linux   -

稼働している m75q2a と m75q2b で tailscale version を打ってみると、動いていない方はバージョンが古い

mumoshu@m75q2b:~$ tailscale version
1.6.0
  tailscale commit: ddc975fcb268a06dc39923ec5db93f1c95b8cfc4
  other commit: 995460c32665f1dab78c78512386235d275cf074
  go version: go1.16.2-ts3b83fb3

mumoshu@m75q2a:~$ tailscale version
1.14.3
  tailscale commit: 3a762776e6f39f4af53762f1e686a116665d3378
  other commit: 75eaf27e5d03055ba3b0ad5d7791c6c4ab0b79a7
  go version: go1.17-tsdd6b269c77

最終的には、 tailscale up を実行してログインしなおしたところ接続できるようになった。

mumoshu@m75q2b:~$ sudo tailscale up
[sudo] password for mumoshu: 

To authenticate, visit:

	https://login.tailscale.com/a/REDACTED

Success.
3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?