Skip to content

How to change the MTU in Windows Server 2008 & 2012

When I finally got a Windows Server 2012 image built and deployed on OpenStack, I started having some seriously squirrely problems with networking. I was able to ping and resolve DNS. I was even able to browse network shares on other servers that were well up the chain outside of the virtual environment, but I was unable to actually browse the internet from the Windows Server 2012 instance on OpenStack. I was having no issues with Linux based images.

I immediately suspected MTU as the culprit. I double check my neutron-dnsmasq.conf file to make sure the MTU was set at 1454, via DHCP configuration. It was. So, I checked the MTU settings on the Windows image and it was in fact 1500. For some reason the DHCP option was not having any effect on the Windows image. This is supposed to be addressed by the CloudBase VirtIO driver, allowing the MTU to be set via DHCP in OpenStack environments, but it obviously wasn’t working. You can check your MTU by doing the following:

 

Open an Administrator command prompt.

netsh interface ipv4 show interfaces

 

Screen Shot 2015-04-27 at 7.29.38 PM

 

This will show you your current MTU settings. Pay close attention to the Idx # of the ethernet interface. You will need this information to change the MTU. To change the MTU to 1454 use this command. (you will need to replace the “10” with the Idx for your ethernet interface)

netsh interface ipv4 set subinterface "10" mtu=1454 store=persistent

 

Now, if you aren’t sure what you need to set the MTU at to get things working, there is a trick you can use. From a command line, run this command:

 

ping google.com -f -l 1500

 

This command sends a ping using a 1500 byte packet size (MTU). You can slowly decrease the packet size, in increments of 10 or so, until you stop getting fragmented packet results. If the packet is too large, you will get “Packet needs to be fragmented but DF is set.” If it’s not to large you will get a successful ping (as long as the destination isn’t restricting ICMP ping packet size. Here is an example of both:

 

Screen Shot 2015-04-27 at 7.26.56 PM

 

Subscribe to future posts and updates!

4 thoughts on “How to change the MTU in Windows Server 2008 & 2012

  1. Tiberiu Pfiszter says:

    Hi
    I am facing the following issue on a Windows Server 2008 R2:
    – initially MTU is set to 1500, many connectivity problems
    – I tried several values until I got:
    ping something.com -f -l 1430
    Reply from xxx.xxx.xxx.xxx: bytes=64 (sent 1430) time=8ms TTL=56
    – now I changed the MTU
    netsh interface ipv4 set subinterface “15” mtu=1430 store=persistent
    Ok.
    – and when I tried again
    ping something.com -f -l 1430
    Packet needs to be fragmented but DF set. – at this point I did not understand anything anymore…
    I tried to reboot but still the same problem.
    Does anybody have any hint about it?

    Reply
    • Guest says:

      The value you set with -l ping parameter is the size of ICMP packet payload, not the MTU. To find out the MTU value you’ll have to add 28 to it (20 bytes IP packet header and 8 bytes ICMP header), so the correct MTU for 1430 payload is 1458. Please note that there are a lot of “trusty” sites that are totally wrong about how you test MTU with ping

      Reply
      • Mike Smith says:

        Thank you for the info. I will update the post to reflect this when I get a chance.

        Mike

        Reply
  2. Pingback: Modificando MTU…y no hablamos en vacuno | Histerias de la cripta

Leave a Reply