LoginSignup
2
1

More than 5 years have passed since last update.

tracerouteコマンドでネットワークインターフェイスを指定する方法

Posted at

macOSでのtracerouteコマンドでネットワークインターフェイスを指定するには小文字-sオプションを使う。

利用シーン

例えば、WiFiとLANケーブルの2つにMacBookを繋いでいる場合、ネットワークインターフェイスが2つできる。

ping -Sの使い方

traceroute -s [インターフェイスに割り当てられたIPアドレス] [対象ホスト]

「インターフェイスに割り当てられたIPアドレス」を調べる方法は、『Macでネットワークインターフェイスに割り当てられたIPアドレスを調べる方法』を参照。

例えば、ネットワークインターフェイスに割り当てられたIPアドレスが192.168.5.67で、対象ホストが1.1.1.1の場合は次のコマンドを実行する:

$ traceroute -s 192.168.5.67 1.1.1.1
traceroute to 1.1.1.1 (1.1.1.1) from 192.168.5.67, 64 hops max, 52 byte packets
 1  192.168.5.1 (192.168.5.1)  0.493 ms  0.277 ms  0.264 ms
 2  fs76eefb41.tkyc510.ap.nuro.jp (118.238.251.65)  2.246 ms  2.409 ms  2.557 ms
 3  182.171.93.178 (182.171.93.178)  3.881 ms  3.901 ms  3.160 ms
 4  39.110.252.241 (39.110.252.241)  2.485 ms
    39.110.252.73 (39.110.252.73)  2.296 ms
    39.110.252.69 (39.110.252.69)  1.929 ms
 5  202.213.194.15 (202.213.194.15)  2.293 ms
    202.213.194.47 (202.213.194.47)  2.236 ms
    202.213.193.81 (202.213.193.81)  2.227 ms
 6  218.100.6.62 (218.100.6.62)  2.405 ms
    13335.tyo.equinix.com (203.190.230.72)  2.669 ms  14.392 ms
 7  1dot1dot1dot1.cloudflare-dns.com (1.1.1.1)  2.370 ms  2.486 ms  2.285 ms
2
1
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
2
1