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?

#0007(2024/01/07)プライベートIP・パブリックIPアドレスの調べ方

Posted at

モチベーション

  • 最近、パブリックIPアドレスを聞かれたので、そのときの調べ方を記録する
  • ついでに、プライベートIPアドレスの調べ方も記録する

プライベートIP

  • mac の場合
ifconfig # en0の結果を見る
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
	ether [MACアドレス]
	inet6 [IPv6アドレス] prefixlen 64 secured scopeid 0xb
	inet6 [IPv6アドレス] prefixlen 64 autoconf secured
	inet6 [IPv6アドレス] prefixlen 64 autoconf temporary
	inet [IPv4アドレス] netmask 0xffffff00 broadcast 192.168.11.255
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active

パブリックIPアドレス

WEBサービス

コマンド

  • macの場合
curl ifconfig.me
curl icanhazip.com

参考

  • chatgptの回答
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?