LoginSignup
6
8

More than 3 years have passed since last update.

ネットワーク系コマンドチートシート(macOS)

Last updated at Posted at 2017-07-12
  • 特記なき場合はすべて macOS Sierra を想定しています
  • Linux版はこちら

ネットワークアダプタのリンク状態を調べたい

ethtoolを使う?

IPアドレスがどこの組織に所属するか調べる

$ whois -h whois.nic.ad.jp 2408:210:a524:3c00:1048:5dd6:xxxx:xxxx | nkf

ネットワークのスループットを実測する

iperfを使う。

経路の一覧を表示する

$ netstat -nr   # -r 経路を表示する  -n 名前を問い合わせしない

IPv4のみ

$ netstat -nr -f inet

IPv6のみ

$ netstat -nr -f inet6

プロセスが使用中のポートの一覧を表示する

lsof -i
  • lsofコマンドってobsolateなの?fuserコマンドしかないシステムもある

LISTENしているポートの一覧を表示する

sudo lsof -i -P -n | grep LISTEN

DHCPリクエストが送られているか確認する

tcpdump -i eth0 -n port 67 and port 68

自分のいるネットワークのIPアドレスなどを調べる

curl http://ifconfig.co/json | jq .
6
8
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
6
8