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?

MacOSで自分のIPをIPv6、IPv4で取得する

Posted at

AWSを学んでいて、
自分のIPからのアクセスだけを許可するセキュリティグループを作りました。

セキュリティ考慮なしの、パブリックアクセスは危険が伴うのと、
現場で検証とかでも、社内IPのみから、のような設定が必要だったりします。

自分のIPの把握の仕方をMacOSの場合は、
ターミナルを開いて、以下でできました。

デフォルトでは、IPv6で表示されます。

yusuke@mbp ~ % curl ifconfig.me

IPv4で欲しい場合は、オプションをつけます。

1xxxx:xx:xxx:xxx:xxxx:xxxx:xxxx:xxxx%                                       yusuke@mbp ~ % curl -4 ifconfig.me
xxx.xx.xx.x%
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?