Articles on: Tutorials

Setting proper MTU on your server

Setting proper MTU values on your server


This article is based on setting the proper MTU on your machine if you are having basic networking issues with your machine. The reason on clamping the MTU on our network is to ensure stability on our network.
It can help to have a basic understanding on what an MTU does. An MTU (Maximum Transmission Unit) is the largest packet or frame size allowed through a network before fragmentation is required. A mismatch in MTU between your server and our local switches can cause issues with packets being reassembled resulting in packet-loss and other connectivity issues.

Luckily setting your MTU is easy, this tutorial will show you how to do it across both Windows and Linux based platforms.

Your servers MTU should be set to 1440 for all servers on the Tempest network

Windows


You can edit the MTU for your machine via the command prompt. Our example was taken from Windows Server 2019, however the process should be similar for other versions.

Finding interface and checking current MTU

We can use the command netsh interface ipv4 show subinterface to view interfaces giving an output similar to the following:

You can also find your interface name in your Network Connections (Control Panel > Network and Internet > Network Connections)

In this example our Ethernet 2 is the interface that we use primarily, and as you can see the MTU is currently set to 1500 and will need changing.

Setting the correct MTU in Windows

We will be using the netsh command again to set the MTU to 1440.
netsh interface ipv4 set subinterface "Ethernet 2" mtu=1440 store=persistent
Remember to change Ethernet 2 to whatever your network device/ethernet adapter is named.

You may need to restart your Windows server for these changes to take affect.
You are then able to run the command netsh interface ipv4 show subinterface again to check the changes.


Linux


You can use ip route to find your interface name on Linux systems


There are several ways you can do this, one of them by using the package net-tools and ifconfig.
ifconfig <interfacename> mtu 1440

Other options include using ip link or modifying /etc/network/interfaces which you can set as follows
ip link set mtu 1440 dev <interfacename>



To make the setting permanent for your interface, edit the configuration file:
/etc/network/interfaces (Debian/Ubuntu Linux file)
/etc/sysconfig/network-scripts/ifcfg-eth0 (CentOS/RedHat Linux )

Example File For Debian / Ubuntu:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254
mtu 1440

Example File For RedHat CentOS
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
HWADDR=FF:FF:FF:FF:FF:FF
IPADDR=192.168.1.111
NETMASK=255.255.255.0
NETWORK=192.168.1.0
MTU=1440
ONBOOT=yes
TYPE=Ethernet


Restarting your network service(s)

If you are using Redhat you can use the command service network restart
If you are using Debian / Ubuntu you should use systemctl systemctl restart networking

Updated on: 22/03/2023

Was this article helpful?

Share your feedback

Cancel

Thank you!