Skip to content

Instantly share code, notes, and snippets.

@odyssey4me
Created September 8, 2015 09:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save odyssey4me/c2f7542f985a953bb1e4 to your computer and use it in GitHub Desktop.
Save odyssey4me/c2f7542f985a953bb1e4 to your computer and use it in GitHub Desktop.
Setting MTU size in Windows

Introduction

Due to the underlying networking services making use of tunnelling and packet tagging a situation may arise where instance network connectivity, especially when downloading large files or transferring files, is found to be unreliable.

This article describes how to adjust the instance to ensure that it uses a suitable MTU size so that packets are not dropped by the underlying infrastructure.

Note that the appropriate MTU size is delivered via DHCP by the underlying network service, but not all operating systems make use of the DHCP option to dynamically set the MTU size for the NIC. This document thus serves as a failback when then DHCP option is not used.

Symptoms

  • Packet loss when transferring data. The packet loss may not show on the instance OS stack itself, but when testing using Ping with specific packet sizes it will be observed that packets will be dropped when above a certain threshold.

Windows Procedure

  1. Open a command prompt with administrative privileges. (ie. right click on All Programs > Accessories > Command Prompt and select Run as administrator)
  2. Execute the following to see the list of interfaces and the current MTU size for each of them.
netsh interface ipv4 show subinterfaces

For example:

C:\Windows\system32>netsh interface ipv4 show subinterfaces

   MTU  MediaSenseState   Bytes In  Bytes Out  Interface
------  ---------------  ---------  ---------  -------------
4294967295                1          0    4760773  Loopback Pseudo-Interface 1
  1300                1   65494507    8885236  Local Area Connection

Then for each applicable interface, set the MTU size as follows:

netsh interface ipv4 set subinterface "Local Area Connection" mtu=1454 store=persistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment