4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Claude Code + wslでAPIがタイムアウトになるのを治す

4
Last updated at Posted at 2025-05-27

スクリーンショット 2025-05-28 000134.png

解決策

2025.7 より簡単な方法
https://www.reddit.com/r/ClaudeAI/comments/1l3y7tm/claude_code_via_wsl_failed_to_connect_to/

wslのshell実行

resolf.confの自動生成を止める

sudo nano /etc/wsl.conf

[network]
generateResolvConf = false

resolv.conf 書き換え

sudo rm /etc/resolv.conf

sudo bash -c 'echo "nameserver 8.8.8.8" > /etc/resolv.conf'

↓ 以前の方法

  1. ipv6を無効にする

sysctlで無効化
/etc/sysctl.conf の末尾に以下を追記

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

  1. 設定を反映

sudo sysctl -p

  1. ipv6無効化を確かめる

ip a

出力結果に「inet6」の行(IPv6アドレス)が表示されていなければ、IPv6は無効化されています

4
1
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
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?