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?

More than 1 year has passed since last update.

ネットワークのトラシューに使うコマンドのメモ

Last updated at Posted at 2022-03-29

net-toolsとiproute2

  • net-tools
    • ifconfig等が含まれているパッケージ
    • 開発が2011年で止まっている
    • /proc以下のファイルから情報を収集しているため、正確さに欠ける
  • iproute2
    • ipコマンド等が含まれているパッケージ
    • net-toolsよりもパフォーマンスが高い
    • Netlink APIを使用して情報を収集しているため、正確

NICの確認

# ip linkで出力される情報 + IPの情報
$ ip a
# net-toolsを使用する場合
$ ifconfig
# 有線LANのNICの詳細
$ ethtool en0
# 無線LANのNICの詳細
$ iwconfig wlan0
# 統計情報の確認
$ ip -statistics link
# net-toolsの場合
$ netstat -i

ARPテーブル

# 一覧
$ ip neigh show
# net-toolsを使用する場合
$ arp -a
# 動的に追加されたエントリを削除
$ sudo ip neigh flush 192.168.0.1
# net-toolsを使用する場合
$ sudo arp -d 192.168.0.1
# ARPテーブルのモニタリング
$ ip monitor

ルーティングテーブル

$ ip route
# net-toolsの場合
$ route

ソケット

$ ss
# net-toolsの場合
$ netstat

ハードウェアの確認

$ lshw

疎通確認

  • 送信側
$ ping 192.168.0.1
  • 受信側
$ sudo tcpdump -i eth0 src host 192.168.0.1
# キャプチャしたパケットをファイルに出力する場合
# 出力されたファイルはWiresharkから読み込むことも可能
$ sudo tcpdump -w hoge.cap -C 1 -Z root -i eth0 src host 192.168.0.1

余談

  • iproute2にはtc(Traffic Control)コマンドが含まれており、ネットワークのレイテンシやスループットを制御することが可能となっている
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?