問題 lpic-102-500-topic-1-question-99・第4版

ip statsが利用できるiproute2と、従来のnet-toolsを使う。eth0の送受信バイト数を表示できるコマンドを3つ選べ。

  1. A route -v via eth0
  2. B ip stats show dev eth0
  3. C netstat -s -i eth0
  4. D ifconfig eth0
  5. E ip -s link show eth0

正解:B、D、E

理由

次のコマンドはいずれも機器のカウンターを読む操作である。

コマンド・構文 作用・条件
ifconfig eth0 eth0のリンク統計を表示する。
ip -s link show eth0 eth0のリンク統計を表示する。
ip stats show dev eth0 対応するiproute2でeth0のリンク統計を表示する。

選択肢ごとの説明

A. route -v via eth0

経路の表示は受信・送信バイト数の表示ではない。

B. ip stats show dev eth0

ip stats showは既定でリンク統計も要求し、eth0の送受信バイト数を表示できる。

C. netstat -s -i eth0

通常のnetstatのインターフェース統計のパケット数はバイト数とは異なり、この引数をeth0の指定として扱うものでもない。

D. ifconfig eth0

eth0の受信・送信のバイト数などを表示する。

E. ip -s link show eth0

eth0のリンクの統計を表示する。

参考資料

お問い合わせ

演習する →