ping -R ICMP协议研究

ICMP p i n g程序为我们提供了查看 I P记录路由( R R)选项的机会
ping 使用ICMP协议,并只运行在IP网络层.

[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)

下面是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))



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值