使用 ping 命令,参数 -f 不允许拆分数据包、参数 -l 指定包大小。
ping -f -l 1452 www.baidu.com
正在 Ping www.baidu.com [220.181.38.150] 具有 1452 字节的数据:
来自 220.181.38.150 的回复: 字节=1452 时间=34ms TTL=52
来自 220.181.38.150 的回复: 字节=1452 时间=34ms TTL=52
来自 220.181.38.150 的回复: 字节=1452 时间=34ms TTL=52
ping -f -l 1453 www.baidu.com
正在 Ping www.baidu.com [220.181.38.150] 具有 1453 字节的数据:
需要拆分数据包但是设置 DF。
需要拆分数据包但是设置 DF。
需要拆分数据包但是设置 DF。
经过测试后,取上限值 1452,然后加上 28 后最终为 1480,所以设置最佳 MTU 值为 1480。
netsh interface ipv4 show subinterfaces
MTU MediaSenseState 传入字节 传出字节 接口
------ --------------- --------- --------- -------------
4294967295 1 0 0 Loopback Pseudo-Interface 1
1500 1 220753208 12495436 本地连接
netsh interface ipv4 set subinterface "本地连接" mtu=1480 store=persistent
版权声明:本文为原创文章,版权归 BenhoN 所有。
本文链接:https://blog.benhon.net/archives/134.html
所有原创文章采用知识共享 署名-非商业性使用 4.0 国际 许可协议进行许可,你可以自由地转载和修改,但请务必注明文章来源并且不可用于商业目的。