PROXMOX - MTU
MTU Configuration on Proxmox
MTU (Maximum Transmission Unit) defines the largest size of a packet that can be transmitted over a network. Configuring the correct MTU on Proxmox is crucial for optimizing network performance, preventing fragmentation, and ensuring network efficiency.
MTU on Proxmox NICs
Proxmox Virtual Environment (VE) relies on network interfaces for communication, and each NIC (Network Interface Card) has an MTU value that can be adjusted. By default, the MTU is usually set to 1500 bytes, but in some cases, it may need to be increased for optimal performance, such as with jumbo frames.
Default MTU Settings on Proxmox
On Proxmox, network interfaces are usually configured with an MTU of 1500 bytes. However, this may vary depending on the hardware and specific network configuration.
To check the current MTU of your network interfaces, use the following command:
ip link show
The MTU will be displayed in the output, e.g.:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
Configuring MTU on Proxmox NICs
Changing MTU on Proxmox Network Interface
You can change the MTU on a network interface by editing the network configuration file for the respective NIC. Proxmox uses the `/etc/network/interfaces` file for network configuration.
For example, to change the MTU on the `eth0` interface to 9000 bytes (which is common for jumbo frames), add or modify the following lines in the configuration file:
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
mtu 9000
After making changes to the configuration file, apply the changes by restarting the networking service:
systemctl restart networking
Or, alternatively, use the following command to apply the new MTU:
ifdown eth0 && ifup eth0
Changing MTU Temporarily
To temporarily change the MTU on a NIC without editing the configuration file, you can use the `ip` command:
ip link set dev eth0 mtu 9000
This change will persist only until the next reboot or interface restart.
Max Possible MTU on NICs
The maximum MTU that can be set on a NIC depends on the NIC hardware and the network infrastructure (e.g., switches, routers). Generally, the maximum MTU supported on most NICs is 9000 bytes for jumbo frames. However, this is highly dependent on the underlying hardware and the network configuration.
Determining Maximum MTU for a NIC
To determine the maximum MTU supported by a NIC, you can use the `ethtool` command:
ethtool -i eth0
This will display information about the NIC, including supported MTU values. For example:
Supports jumbo frames: Yes Maximum MTU: 9000
Ensure that all network devices between the Proxmox server and the destination machine support the same MTU to avoid fragmentation issues.
MTU and Virtual Machines
In Proxmox, virtual machines (VMs) inherit the MTU configuration from the host system. To configure MTU for a VM's network interface, you need to adjust the settings within the VM’s configuration file.
Changing MTU in VM Configuration
1. Locate the configuration file for the VM, typically found at `/etc/pve/qemu-server/<VMID>.conf`. 2. Edit the configuration to include the MTU setting, for example:
net0: virtio=XX:XX:XX:XX:XX:XX,bridge=vmbr0,mtu=9000
Changing MTU in VM Operating System
Additionally, you can set the MTU within the VM's operating system. For example, in a Linux-based VM:
ip link set dev eth0 mtu 9000
Troubleshooting MTU Issues
Incorrect MTU settings can cause network connectivity issues such as packet fragmentation, poor performance, or even dropped packets. Here are common troubleshooting steps for MTU-related problems:
Verify MTU Settings
Ensure that the MTU is consistent across the entire network path, including switches, routers, and all NICs. Mismatched MTUs may result in packet fragmentation or loss. You can verify the MTU by using the following command:
ping -M do -s 1472 <destination>
If the ping succeeds, the MTU is sufficient. If it fails, lower the packet size until it succeeds.
Diagnose Network Connectivity
You can use `ping` with the `-s` option to test different packet sizes and determine if fragmentation is happening:
ping -M do -s 1500 <destination>
Check Interface Status
Ensure the interface is up and the correct MTU is configured. Use:
ip link show eth0
This will show the current MTU and status of the interface.
Check for Jumbo Frame Support
If you're configuring jumbo frames (MTU > 1500), ensure that all network devices, including switches and routers, support jumbo frames. Use `ethtool` to verify:
ethtool -i eth0
Ensure the "Supports jumbo frames" line is set to "Yes."
Verify Bridge MTU Settings
If your Proxmox server uses bridges (e.g., `vmbr0`), verify the MTU on the bridge interface as well. You can check this using:
ip link show vmbr0
Ensure that the bridge MTU is compatible with the NIC MTU.
Useful Links
- [Proxmox Network Configuration Documentation](https://pve.proxmox.com/pve-docs/pve-admin-guide.html#network_configuration)
- [Linux MTU Configuration Guide](https://www.cyberciti.biz/faq/linux-change-the-network-interface-maximum-transmission-unit-mtu-size/)
- [Proxmox Community Forum](https://forum.proxmox.com/)
- [ethtool Documentation](https://man7.org/linux/man-pages/man8/ethtool.8.html)
