Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configure the MTU for a Private LAN

The IONOS CLOUD Dynamic Host Configuration Protocol (DHCP) server supports the interface maximum transmission unit (MTU) option, DHCP option 26, on private LANs. If a virtual machine's (VM's) DHCP client requests this option, the VM is automatically configured with the largest MTU that the private LAN supports, up to 4074 bytes. Larger packets increase throughput and reduce CPU overhead for traffic between VMs in the same private LAN. Because the MTU is set through DHCP, it's consistent across all VMs in the LAN without manual configuration.

The option applies to Dedicated Core Servers, vCPU Servers, and Cubes with a NIC on a private LAN with DHCP enabled. Use this guide to check which MTU your VM uses and, if required, keep an MTU of 1500 bytes.

Prerequisites:

  • A VM with a NIC on a private LAN with DHCP enabled. For more information, see Configure a Private LAN.

  • Administrator (root) access to the VM's operating system.

Note:

  • NICs with a public IP address keep their existing MTU.

  • If the VM's DHCP client doesn't request the option, the VM keeps its existing MTU, typically 1500 bytes.

  • Windows doesn't request DHCP option 26, so Windows VMs keep their existing MTU.

Procedure

1

Check the current MTU

Replace [device_name] with the name of the network interface, for example, eth1, and check the mtu value in the output:

ip link show [device_name]

If the value is larger than 1500 and you haven't set it manually, the VM uses the MTU assigned by the IONOS CLOUD DHCP server. To keep the larger MTU, no further action is required.

2

Keep an MTU of 1500 bytes

Use one of the following methods:

Set a static MTU of 1500 on the interface in the operating system's network configuration. Some DHCP clients still apply the MTU from the DHCP server over a static MTU.

For ISC dhclient, add the following line to the DHCP client configuration to keep an MTU of 1500 bytes:

supersede interface-mtu 1500;

Configure the DHCP client not to request the MTU option:

  • ISC dhclient: Remove interface-mtu from the request line in /etc/dhcp/dhclient.conf.

  • systemd-networkd: Set UseMTU=no in the [DHCPv4] section:

    [DHCPv4]
    UseMTU=no
  • Netplan: Set dhcp4-overrides: { use-mtu: false }. If cloud-init manages your Netplan configuration, verify that the setting persists after a restart.

3

Apply the change

Renew the VM's DHCP lease or restart its network. The MTU configuration takes effect when the DHCP lease is renewed or the network is restarted.

4

Verify the MTU

Run the command again and check that the mtu value is 1500:

ip link show [device_name]

Restart the VM, then run the command again and check that the mtu value is still 1500. If the value has changed, your network configuration was overwritten during startup. Use the Static MTU method or make the change in a configuration file that persists across restarts.

Last updated

Was this helpful?