May 17, 2013

Configuring custom MTU size on vmxnet3

A few weeks ago I visited a customer who had a few servers configured with vmxnet2. I asked him why and he told me that if he changed nic to vmxnet3 he would loose the ability to configure a custom MTU size. With vmxnet2 the MTU size can be configured directly from the driver by specifying the size you want while on vmxnet3 you can only choose between the standard (1500) and Jumbo Frames (9000).


As this customer had ipsec communication between servers and GRE encrypted WAN links, none of these options would work too well. He needed to set a lower MTU than 1500 to keep things running.



While there exists some registry hack we found that the best method to configure a custom MTU was not in the driver (or registry), but rather by using the command line utility netsh. This solution is not vmxnet3 specific, but a general solution that should work independent on the type of nic you're using.



You will first need to figure out the index number of your nic with the command netsh interface ipv4 show interfaces
After finding the index number (16 in our case) you will need to use it in the next command (NB: needs admin privileges) netsh interface ipv4 set subinterface "16" mtu=1340 store=persistent


PS: The size of 1340 is just used as an example here. I don't remember the exact MTU used in this scenario, but I'm pretty sure it was 1300-something. If in doubt you can use tools like ping or mturoute to find the optimal size.

No comments:

Post a Comment