Precaution
Editing the MTU of a VPC only affects virtual machines that are added to the VPC afterwards, and will not be synchronized to existing virtual machines in the VPC. You can modify the MTU of existing virtual machines as needed.
Procedure
Enter the AOC Network and security page, and click VPC in the left sidebar.
Locate the target VPC, click the ellipsis (...) and select Edit; or click the VPC to be edited and click Edit on the details panel.
Edit the MTU of the VPC as needed.
The following example describes the steps to modify the NIC MTU of a virtual machine using a Linux operating system. The methods and commands for modification may vary depending on different operating systems and versions. Refer to the official documentation of the respective operating system for specific details.
Use the command netstat -i
to view the current MTU of the virtual machine's NIC.
netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens4 1400 51878953 0 140518 0 400336 0 0 0 BMRU
After editing the MTU of the VPC, use any of the following methods to modify the NIC MTU of the virtual machine.
Restart the virtual machine to resend the DHCP request.
Use the service network restart
command to restart the network and resend the DHCP request.
Use the following command to manually send a DHCP request.
dhclient -x
dhclient ens4
Use the command ifconfig ens4 mtu VPC_MTU
to directly set the NIC's MTU to the modified VPC MTU. Here, VPC_MTU
should be replaced with the actual MTU value set for the VPC.
Use the command netstat -i
to verify the NIC MTU modification result of the virtual machine.