Amazon EC2サーバのPingができない
数ヶ月前、arch linuxをインストールしているときに、インターネット接続を確認する必要がありました。Pingを打つのは簡単な方法だった。私はgoogleにpingを打った。いい感じです。次に自分のサーバーにpingを打ってみた。何も出ませんでした。
重要ではなかったのでそのままにしておきましたが、なんとなく気になりました。
日曜日に早送りします。私は自分のサイトでの検索のためにSOLRを研究している。チュートリアルでは、solrが動作しているかどうかを確認するために、自分のサーバーにpingを打つことを提案している。そして、私はそれができないことを思い出しました。
数時間後
Ubuntuのiptablesとubuntuのファイアーウォールufwをいじった後、あるサイトで正しい方向に導いてくれる参考資料を見つけましたが、100%ではありませんでした。
解決策
解決策は、AWSマネジメントコンソールに行きました。
- EC2Dashboardに行き、セキュリティグループを表示します。
- サーバーに適したグループを選択します。
-
- 「INbound」タブをクリックします。
- 編集」ボタンをクリックします。
- ルールの追加」をクリックし、「カスタムICMPルール」を選択します。
- プロトコルを「echo reply」に設定し、適切なIPソースを設定する。
- 6と5を繰り返しますが、今回はプロトコルを「echo request」にします。
- 完了です。
これで、サーバーへのpingがうまくできるようになります。
Can't Ping my Amazon EC2 Server
A few months ago, when I was installing arch linux, I needed to check my internet connection. Pinging was an easy way to go. I ping-ed google. Good. Then i tried to ping my own server. Nothing.
I left it since it wasn’t important, but it sort of bothered me.
Fast forward to Sunday. I am studying SOLR for searches on my site. The tutorial suggests using ping to my server to check if solr is working or not. Then I remember that I can’t!!
A Few Hours Later
After mucking about with Ubuntu iptables and ubuntu’s firewall ufw, I finally stumble on a reference in a site the pretty much sent me in the right directions, but not quite 100%.
The Solution
The solution was to go to the AWS Management Console.
- Go to the EC2Dashboard, and bring up your security groups.
- Choose the correct group for your server.
- Click the INbound tab.
- Click the Edit button.
- Click ‘add rule’, and choose ‘Custom ICMP Rule’.
- Set the protocol to ‘echo reply’, and appropriate ip source.
- repeat 6 and 5 but this time protocol is ‘echo request’
- done!
Now you should be able to ping your server nicely.