Chinaunix首页 | 论坛 | 博客
  • 博客访问: 357683
  • 博文数量: 51
  • 博客积分: 916
  • 博客等级: 准尉
  • 技术积分: 539
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-01 15:37
文章分类

全部博文(51)

文章存档

2014年(1)

2012年(49)

2011年(1)

我的朋友

分类: WINDOWS

2012-05-11 14:35:23

October 23, 2009 – 21:11

This information is available in many many other places, however I am putting it on here because I know it will be here for me to refer to. Also it is handy, as I know I can access my web-site even if the is misconfigured.

For some reason that has escaped me in Windows just doesn’t seem to figure out the MTU for a given path (something to do with routers being poorly configured to not respond to requests). So Windows uses the default. For the most part this doesn’t affect anyone, however if it dos affect you, it really annoys you. Failure of PMTUD will result in some websites not loading correctly, having trouble connecting to normally reliable online services and general Internet weirdness.

The resolution is to set your default MTU to one lower than the default of 1500. Here is how:

Step 1: Find your MTU
From an enter the following command:

netsh interface ipv4 show subinterfaces

You should get something like this

MTU MediaSenseState Bytes In Bytes Out Interface ---------- --------------- --------- --------- ------------- 4294967295 1 0 13487914 Loopback Pseudo-Interface 1 1500 1 3734493902 282497358 Local Area Connection

If you are using Ethernet cable you will be looking for “Local Area Connection” or “Local Area Connection 2″ (if you happened to plug into the second network port). If you are using Wireless you will be looking for “Wireless Network Connection”. The MTU is in the first column.

Step 2: Find out what it should be

In the CMD shell type:

ping -f -l 1472

The host name should be a site you can not reach, -f marks the packet as one that should not be fragmented the -l 1472 sets the size of the packet (1472 = Ethernet Default MTU – Packet Header, where the Ethernet Default MTU is 1500 and the Packet Header is 28 bytes)

If the packet can’t be sent because it would need to be fragmented you will get something similar to this:

Packet needs to be fragmented but DF set.

Keep trying lower packet sizes by 10 (i.e. -l 1460, 1450, 1440, etc.) until you get a successful ping request. Raise your packet sizes by one until you get a “Packet needs to be fragmented but DF set.”. The last successful value plus 28 will be your MTU value.

In my case a packet size of 1430 succeeds but 1431 fails, so 1430 + 28 = 1458.

Step 3: Set your MTU

Now you have identified the interface you need to change and the ideal MTU for you, now it is time to make the change. Again from an elevated CMD Shell type the following replacing my MTU of 1458 with your own value:

netsh interface ipv4 set subinterface "Local Area Connection" mtu=1458 store=persistent

Or if you are using a Wireless connection:

netsh interface ipv4 set subinterface "Wireless Network Connection" mtu=1458 store=persisten
阅读(1223) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~