You can run different commands to view the network interface MTU of the cloud server. The specific command type depends on the operating system. If the Windows operating system is used, you can run the netsh command to view and modify the MTU value and view the MTU command of the current network interface (the following command can list all network interfaces and MTU values) :
netsh interface ipv4 show subinterfaces
In Linux, you can run the ip link command to view the MTU of the network interface:
ip link show eth0
You can view detailed information about the eth0 interface, such as the MTU value. These commands require permissions, and you may need to use sudo to obtain administrator permissions. The MTU change takes effect only after the network service or cloud server is restarted. Before modifying data packets, ensure that the impact on network performance is known and that all related network devices and services are compatible to avoid packet fragmentation or loss. If you want to change the MTU value, perform the following steps.
In Windows, open the command prompt as an administrator and check the current MTU value:
netsh interface ipv4 show subinterfaces
Find the network interface and MTU value that you want to modify, and then set a new MTU value:
netsh interface ipv4 set subinterface Interface Name mtu= New value
Replace the interface name with the network interface name you want to modify, and replace the new value with the MTU value you want to set. Reconfirm the modification:
netsh interface ipv4 show subinterfaces
Run the command again to confirm that the MTU value is changed. You may need to restart the network service to save your changes:
net stop winnat
net start winnat
You can also restart the server directly.
In Linux, open the terminal to view the current MTU value:
ip link show eth0
Replace "eth0" with the name of the network interface you want to modify. Then temporarily set a new MTU value:
sudo ip link set eth0 Indicates the new mtu value
Replace "eth0" with the name of your network interface and "new value" with the MTU value you want to set.
If you want to set the MTU value all the time, the change takes effect permanently. To modify the network configuration file on a Debian-based system, edit the /etc/network/interfaces file. Edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file on a Red Hat-based system (replace "eth0" with the name of your network interface).
In the corresponding configuration file, locate the network interface section that you want to modify and add or modify the MTU line:
MTU= New value
Save and close the file. Restart the network service to ensure that the changes apply (or just restart the server) :
sudo systemctl restart networking
The modification of the MTU may affect network performance and stability. Before the modification, ensure that the modification affects the network environment. The production environment should be fully tested first, and it is best to consult professional technicians.