Change your MTU under Vista or Windows 7

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 MTU is misconfigured.

For some reason that has escaped me Path MTU Discovery 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 ICMP 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 Ethernet default of 1500. Here is how:

Step 1: Find your MTU
From an elevated CMD Shell 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 www.cantreachthissite.com -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=persistent

If all has gone well you should have a perfectly working internet connection.

Share this post:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Technorati
  • MySpace
  • Live
  • email
  1. 13 Responses to “Change your MTU under Vista or Windows 7”

  2. Exactly the right answer. I’ve seen sites that recommend the netsh but offer no procedure to determine the correct value. Others have you hacking the registry.
    Thanks.

    By Rich on Feb 14, 2010

  3. This procedure works fine on Vista, but not on my Windows 7 machine, there is no “ipv4″ on my machine, only “ip”.

    Tried variations, but I haven’t managed to get anything to work, thought “ping site -f -l 1430″ shows that this is the route for solving my internet access problems…

    By Chops on Apr 6, 2010

  4. @Chops: What is the result of the command `netsh interface ipv4 show subinterfaces` is there anything special about your setup? do you use a standard ethernet to connect to the internet or are you using PPPoE or similar?

    By Richard Slater on Apr 10, 2010

  5. Thank you Richard, for your clear and concise instructions — you saved me from an internetless hell.

    By thegreatunwashed on Apr 13, 2010

  6. and what if OS is not Windows Vista or 7 an dalso modme is not having MTU like in huawei

    By wajiha on Apr 17, 2010

  7. @wajiah, Microsoft has a HOW TO on changing the MTU under XP ( http://support.microsoft.com/kb/826159 ). If the connection your Huawei modem doesn’t have a MTU property it is doing something slightly different, what that is I wouldn’t like to guess.

    By Richard Slater on Apr 17, 2010

  8. Hello,
    I’ve got a problem.
    When ever I try to upload a file more than 100KB in http, the network connection of my computer stop (disconnect), can’t event login to router
    I have to disable the Network Connection and then enable again to make everything work again
    I ask some friends, they tell me try to reset the MTU.
    I use you command and see that my MTU is 1500, but when use this tool speedguide.net/analyzer.php, the MTU result is 1440
    And I can’t ping any site althought I still can access it in the Internet Browser
    I use windows 7 pro
    Can you please help me to solve this problem?

    By soulofdark on Jun 21, 2010

  9. That sounds more like it is an issue with the router than with Windows 7. Have you got another router you could try? It is possible that the router doesn’t handle some setting or other, however what that setting may be I do not know. I can highly recommend Super User as a great place to get your question answered. When you do post on Super User post back here with a link to help others who may be having a similar problem.

    By Richard Slater on Jun 21, 2010

  10. ping requested could not find host http://www.cantreachthissite.com please check the name and try again
    what does that mean and what should i do?

    By chinaman88 on Jul 6, 2010

  11. You need to use a site that dosn’t work for you, http://www.cantreachthissite.com was simply a place holder. Sites that you can’t reach vary depending on network configuration.

    By Richard Slater on Jul 6, 2010

  12. i also have problem with some websites
    after i did step 2 i had an error message it says general failure 4x. please help

    By chinaman88 on Jul 7, 2010

  13. got it. found out that its my software thats blocking the website..
    thanks so much

    By chinaman88 on Jul 7, 2010

  1. 1 Trackback(s)

  2. Jul 2, 2010: Como cambiar la MTU en Windows Vista/7 « AwesomeBytes

Post a Comment

Please leave these two fields as-is: