天天看點

ping -R ICMP協定研究

ICMP p i n g程式為我們提供了檢視 I P記錄路由( R R)選項的機會

ping 使用ICMP協定,并隻運作在IP網絡層.

ping -R ICMP協定研究

[16:33 t ~]$ ping -R home.test.com

PING home.test.com (172.16.2.200) 56(124) bytes of data.

64 bytes from itappdoc.inside.test.com (172.16.2.200): icmp_seq=1 ttl=127 time=1.32 ms

NOP

RR:     localhost.localdomain (172.16.12.100)

    172.16.2.2

    home.inside.test.com (172.16.2.200)

    172.16.12.3

    localhost.localdomain (172.16.12.100)

64 bytes from itappdoc.inside.test.com (172.16.2.200): icmp_seq=2 ttl=127 time=1.34 ms

NOP    (same route)

ping -R ICMP協定研究

下面是tcpdump抓取的選項,RR選項是ping路由資訊,IP是出口位址.

[16:43 t ~]$ sudo tcpdump -ev icmp

[sudo] password for t:

tcpdump: listening on enp19s0, link-type EN10MB (Ethernet), capture size 262144 bytes

16:45:09.110818 18:03:73:67:c5:75 (oui Unknown) > 00:00:5e:00:01:0c (oui Unknown), ethertype IPv4 (0x0800), length 138: (tos 0x0, ttl 64, id 54241, offset 0, flags [DF], proto ICMP (1), length 124, options (NOP,RR localhost.localdomain, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))

    localhost.localdomain > home.inside.sky-mobi.com: ICMP echo request, id 7140, seq 1, length 64

16:45:09.112104 68:ef:bd:08:3f:bf (oui Unknown) > 18:03:73:67:c5:75 (oui Unknown), ethertype IPv4 (0x0800), length 138: (tos 0x0, ttl 127, id 577, offset 0, flags [DF], proto ICMP (1), length 124, options (NOP,RR localhost.localdomain, 172.16.2.2, home.inside.sky-mobi.com, 172.16.12.3, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))

    home.inside.sky-mobi.com > localhost.localdomain: ICMP echo reply, id 7140, seq 1, length 64

16:45:10.112267 18:03:73:67:c5:75 (oui Unknown) > 00:00:5e:00:01:0c (oui Unknown), ethertype IPv4 (0x0800), length 138: (tos 0x0, ttl 64, id 55000, offset 0, flags [DF], proto ICMP (1), length 124, options (NOP,RR localhost.localdomain, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))

    localhost.localdomain > home.inside.sky-mobi.com: ICMP echo request, id 7140, seq 2, length 64

16:45:10.114050 68:ef:bd:08:3f:bf (oui Unknown) > 18:03:73:67:c5:75 (oui Unknown), ethertype IPv4 (0x0800), length 138: (tos 0x0, ttl 127, id 622, offset 0, flags [DF], proto ICMP (1), length 124, options (NOP,RR localhost.localdomain, 172.16.2.2, home.inside.sky-mobi.com, 172.16.12.3, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))

    home.inside.sky-mobi.com > localhost.localdomain: ICMP echo reply, id 7140, seq 2, length 64

16:45:11.113256 18:03:73:67:c5:75 (oui Unknown) > 00:00:5e:00:01:0c (oui Unknown), ethertype IPv4 (0x0800), length 138: (tos 0x0, ttl 64, id 55378, offset 0, flags [DF], proto ICMP (1), length 124, options (NOP,RR localhost.localdomain, 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0 0.0.0.0))

繼續閱讀