只有大的icmp包能通过的时候,才能确定的说,不是mtu的问题。确切的说,icmp包的大小应该等于mtu 因为能直接ping通,说明小的包是可以通的。如果最极限的包都过了,再考虑其他问题。
On Wed, Mar 28, 2012 at 5:54 PM, Earthson <[email protected]> wrote: > 找到一点资料。记得要在ping的时候设置icmp包的大小。可以设置为接口的mtu - 28 > 比如接口ppp0的mtu是1492,就 > ping -s 1464 www.douban.com > > 1464+20+8 = 1492(icmp数据长度,ip头长度,icmp头长度)(网上找的) > > DF(Don't Fragment) 不做IP分片 > 1. linux > 默认情况下, linux的各个发行版的ping在发送icmp包时会设置DF位的, 不需要打开ping其他多余的选项。 当使用ping > 192.168.1.1, 用tcpdump可以看到IP协议的flags域的DF位是设置了的。 > 但是也可以强行要求做IP分片, man ping搜索-M 选项~ > -M hint > Select Path MTU Discovery strategy. hint may be either do > (prohibit fragmentation, even local one), want (do PMTU discovery, fragment > locally when packet size is large), or dont (do not set DF flag). > 亦即: -M do 表示阻止分片 > -M want 表示允许PMTU发现, 当包很大的时候在本机就做IP分片 > -M dont 表示强制不阻止分片 > 另外, 在linux下还可以使用-s 指定icmp包的大小, 比如ping -s 1300 www.qq.com。 > 这里的1300是icmp包的大小, 不包括icmp的首部8字节 > > > On Wed, Mar 28, 2012 at 3:02 PM, Qian Hong <[email protected]> wrote: > >> 2012/3/28 Jyu.. <[email protected]>: >> > yupoo是打不开的。 >> > Gmail有点慢,baidu自如。 >> > >> > 表示刚刚跳出个跟新之后就不能正常了,源更新无速度(就同无网一样),源是163的。 >> > >> > ping是全多可以ping通,可就是不能打开。 >> >> 可不可以分别贴出以下命令的结果: >> >> $ mtr baidu.com >> $ mtr yupoo.com >> >> $ tracepath baidu.com >> $ tracepath yupoo.com >> >> $ curl -v yupoo.com >> >> >> -- >> Regards, >> Qian Hong >> >> - >> Sent from Ubuntu >> http://www.ubuntu.com/ >> -- >> ubuntu-zh mailing list >> [email protected] >> https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh >> > > > > -- > > > > Perfection is achieved > not when there is nothing more to add > but when there is nothing left to take away > > > -- Perfection is achieved not when there is nothing more to add but when there is nothing left to take away -------------- 下一部分 -------------- 一个HTML附件被移除... URL: <https://lists.ubuntu.com/archives/ubuntu-zh/attachments/20120328/37b51017/attachment.html> -- ubuntu-zh mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-zh
