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.
Procedure
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.
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-mtufrom therequestline in/etc/dhcp/dhclient.conf.systemd-networkd: Set
UseMTU=noin the[DHCPv4]section:[DHCPv4] UseMTU=noNetplan: Set
dhcp4-overrides: { use-mtu: false }. If cloud-init manages your Netplan configuration, verify that the setting persists after a restart.
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.
Related topics
Last updated
Was this helpful?