Ubuntuサーバー - githubに接続できません

Ubuntuサーバー - githubに接続できません

新しくインストールされたUbuntuサーバーのコマンドラインではgithubを使用できません。 Pingとカールのgithubは失敗しますが、他のホストではうまく動作します。

オペレーティングシステム:Ubuntu 22.04.1 LTS

pingテスト

# google works fine
ping -c3 google.com
...
3 packets transmitted, 3 received, 0% packet loss, time 2004ms

# github fails - each ping attempt results in 'Destination Host Unreachable'
ping -c3 github.com
...
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2051ms

カールテスト

# google works fine
curl -s --head --request GET google.com > /dev/null; echo $?
0

# github fails
curl -s --head --request GET github.com > /dev/null; echo $?
7

子クローンテスト

# fails with 'no route to host'
git clone https://github.com/pi-hole/pi-hole.git
Cloning into 'pi-hole'...
fatal: unable to access 'https://github.com/pi-hole/pi-hole.git/': Failed to connect to github.com port 443 after 18534 ms: No route to host

私が知っている限り、私はプロキシや異常なファイアウォール設定を扱っていません。

どんなアドバイスもありがとうございます。

ベストアンサー1

新しくインストールしましたが、Ubuntu 22.04.1 LTS同じ問題が発生しました。

nmcli d show | grep IP4.GATEWAY私のIP4ゲートウェイが設定されていないため、「--」結果が出たことがわかりました。

設定が完了し、sudo ip route add default via 192.168.X.Y正常に複製できます。

これが役に立つことを願っています:)

おすすめ記事