In Trusted Cloud, you set the MTU for each VPC network.
Virtual machine (VM) instances that use that network must be configured to use
the same MTU setting for their interfaces.
Linux VMs based on public OS images receive
the VPC network's MTU setting from the DHCP server. DHCP Option
26 contains the MTU setting.
Windows VMs do not use DHCP to configure the MTU setting. If you change the
MTU of a VPC network, you must change the MTU setting of the
VM.
There are two ways to start using a VPC network with a different
MTU setting:
You can change the MTU setting of an existing VPC
network, which requires that you shut down all VMs in the network at the same
time.
You can create a new VPC network with a different MTU setting,
and migrate the VMs to it to it.
Change the MTU of a network
Each VPC network has an MTU. Do not change the network MTU while
the VMs are running. Doing so can result in a period where VMs have different
MTUs, which can lead to unreliable network connectivity.
The recommended way to update the network MTU is to stop all running VM
instances, change the network MTU, then start all instances. VMs based on
public Linux images automatically configure each of their network
interfaces to use the MTU of the attached VPC network when they
start. You must manually update the MTU of Windows VMs
and VMs based on custom images that do not rely on DHCP for network MTU
configuration.
Console
Updating network MTU is not supported in the Trusted Cloud console.
See the Google Cloud CLI or API instructions.
gcloud
Stop all VMs.
For each zone in the network, stop all VMs in that zone.
INSTANCE_NAMES... is a space-separated list of instances.
NETWORK is the name of the VPC network
whose dynamic routing mode you need to change.
MTU specifies whether the network has
an MTU of 1460 (default), 1500, or 8896. Review the maximum
transmission unit overview before setting the MTU to
higher than 1460.
API
Change the MTU of an existing VPC network.
PATCH https://www.s3nsapis.fr/compute/v1/projects/PROJECT_ID/global/networks/NETWORK
{
"mtu": MTU
}
Replace the placeholders with valid values:
PROJECT_ID is the ID of the project that contains the
VPC network to modify.
NETWORK is the name of the VPC network to
modify.
MTU is the maximum transmission unit of the network.
MTU can be set to anything from 1300 through 8896 (default: 1460).
Review the maximum transmission unit overview before
setting the MTU to higher than 1460.
Windows VMs based on public OS images are
configured with a fixed MTU of 1460. Custom Windows VMs might have different
MTU settings.
To set Windows VMs to use a different MTU, do the following on each VM:
Command prompt
Open Command Prompt (cmd.exe) as Administrator.
Run the following command to determine the index of the interface that you
want to update:
netsh interface ipv4 show interface
Update the interface:
netsh interface ipv4 set interface INTERFACE_INDEX mtu=MTU store=persistent
Update the device driver configuration:
Open the Device Manager with following command:
devmgmt.msc
Expand the Network adapters category.
Right-click the Google VirtIO Ethernet Adapter/Google Ethernet Adapter device.
Select Properties.
Click the Advanced tab.
In the Init.MTUSize field, enter the MTU setting.
Click OK.
The instance briefly loses connectivity, because the driver
automatically restarts when the registry entries change.
PowerShell
Open PowerShell as Administrator.
Run the following command:
Set-NetIPInterface -InterfaceAlias INTERFACE_NAME -AddressFamily IPv4 -NlMtu MTU
Run the following command to update device driver settings:
Set-NetAdapterAdvancedProperty -Name "Ethernet" -RegistryKeyword MTU -RegistryValue MTU
You will briefly lose connectivity to the VM, because the driver
automatically restarts when the registry entries change.
Migrate VMs to a different MTU network
You might decide to migrate your services to new VMs in a new network rather
than changing the MTU of your existing network. In such a case, you might have a
server, such as a database server, that needs to be accessible to all VMs during
the migration. If so, the following general approach might help you migrate
cleanly:
Create any necessary firewall rules and routes in the new network.
Create a VM with multiple network
interfaces
in the old network. One interface connects to the new network using the new
MTU and the other connects to the old network using the old MTU.
Configure this new VM as a secondary server for the existing one.
Fail the primary server over to the secondary one.
Either Migrate VMs to the new
network or
create new VMs in the new network. If you create new VMs, you can create them
from scratch, from an existing image, or by creating a
snapshot of the existing VMs and
using that to populate the new persistent disks.
Configure these VMs to use the operational server in that network.
Migrate traffic to the new VMs.
If you intend to delete the old network, create a new server in the new
network, get it in sync with the existing server, and fail over to it.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[],[],null,["# Change the MTU setting of a VPC network\n=======================================\n\nIn Google Cloud, you set the MTU for each VPC network.\nVirtual machine (VM) instances that use that network must be configured to use\nthe same MTU setting for their interfaces.\n\n- Linux VMs based on [public OS images](/compute/docs/images/os-details) receive\n the VPC network's MTU setting from the DHCP server. DHCP Option\n 26 contains the MTU setting.\n\n- Windows VMs do not use DHCP to configure the MTU setting. If you change the\n MTU of a VPC network, you must [change the MTU setting of the\n VM](#change-mtu-windows).\n\nFor more information about VMs and MTU settings, see [VMs and MTU\nsettings](/vpc/docs/mtu#vms_and_mtu_settings).\n\nThere are two ways to start using a VPC network with a different\nMTU setting:\n\n- You can [change the MTU setting](#change-mtu) of an existing VPC\n network, which requires that you shut down all VMs in the network at the same\n time.\n\n- You can create a new VPC network with a different MTU setting,\n and [migrate the VMs to it](#migrate-vms-mtu) to it.\n\nChange the MTU of a network\n---------------------------\n\nEach VPC network has an MTU. Do not change the network MTU while\nthe VMs are running. Doing so can result in a period where VMs have different\nMTUs, which can lead to unreliable network connectivity.\n\nFor detailed considerations regarding changing the MTU of a network, see the\n[maximum transmission unit overview](/vpc/docs/mtu).\n\nThe recommended way to update the network MTU is to stop all running VM\ninstances, change the network MTU, then start all instances. VMs based on\npublic Linux images automatically configure each of their network\ninterfaces to use the MTU of the attached VPC network when they\nstart. You must manually [update the MTU of Windows VMs](#change-mtu-windows)\nand VMs based on custom images that do not rely on DHCP for network MTU\nconfiguration. \n\n### Console\n\nUpdating network MTU is not supported in the Google Cloud console.\nSee the Google Cloud CLI or API instructions.\n\n### gcloud\n\n1. Stop all VMs.\n\n For each zone in the network, stop all VMs in that zone. \n\n ```\n gcloud compute instances stop INSTANCE_NAMES... \\\n --zone=ZONE\n ```\n2. Update network MTU.\n\n ```\n gcloud compute networks update NETWORK \\\n --mtu=MTU\n ```\n3. Start all VMs.\n\n For each zone in the network, start all VMs in that zone. \n\n ```\n gcloud compute instances start INSTANCE_NAMES... \\\n --zone=ZONE\n ```\n\n Replace the placeholders with valid values:\n - \u003cvar translate=\"no\"\u003eINSTANCE_NAMES...\u003c/var\u003e is a space-separated list of instances.\n - \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e is the name of the VPC network whose dynamic routing mode you need to change.\n - \u003cvar translate=\"no\"\u003eMTU\u003c/var\u003e specifies whether the network has an MTU of `1460` (default), `1500`, or `8896`. Review the [maximum\n transmission unit overview](/vpc/docs/mtu) before setting the MTU to higher than `1460`.\n\n### API\n\nChange the MTU of an existing VPC network. \n\n```\nPATCH https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/networks/NETWORK\n{\n \"mtu\": MTU\n}\n```\n\nReplace the placeholders with valid values:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID of the project that contains the VPC network to modify.\n- \u003cvar translate=\"no\"\u003eNETWORK\u003c/var\u003e is the name of the VPC network to modify.\n- \u003cvar translate=\"no\"\u003eMTU\u003c/var\u003e is the maximum transmission unit of the network. MTU can be set to anything from `1300` through `8896` (default: `1460`). Review the [maximum transmission unit overview](/vpc/docs/mtu) before setting the MTU to higher than `1460`.\n\nFor more information, refer to the\n[`subnetworks.patch`](/compute/docs/reference/rest/v1/subnetworks/patch)\nmethod.\n\nChange the MTU setting of a Windows VM\n--------------------------------------\n\nWindows VMs based on [public OS images](/compute/docs/images/os-details) are\nconfigured with a fixed MTU of `1460`. Custom Windows VMs might have different\nMTU settings.\n\nTo set Windows VMs to use a different MTU, do the following on each VM:\n**Note:** You can set custom MTU sizes ranging from 576 to 4080 for gVNIC network adapters, but jumbo frames (setting the MTU to `8896`) is available only for the Virt-IO network adapter. To use jumbo frames with gVNIC on supported [third generation](/compute/docs/machine-resource#vm_terminology) and later machine series (except for N4), you can [update to the latest gVNIC driver for Windows](/compute/docs/networking/using-gvnic#manual-gvnic-setup). \n\n### Command prompt\n\n1. Open Command Prompt (cmd.exe) as Administrator.\n2. Run the following command to determine the index of the interface that you\n want to update:\n\n ```\n netsh interface ipv4 show interface \n ```\n3. Update the interface:\n\n ```\n netsh interface ipv4 set interface INTERFACE_INDEX mtu=MTU store=persistent \n ```\n4. Update the device driver configuration:\n\n 1. Open the Device Manager with following command: \n\n ```\n devmgmt.msc\n ```\n 2. Expand the **Network adapters** category.\n 3. Right-click the **Google VirtIO Ethernet Adapter** /**Google Ethernet Adapter** device.\n 4. Select **Properties**.\n 5. Click the **Advanced** tab.\n 6. In the **Init.MTUSize** field, enter the MTU setting.\n 7. Click **OK**.\n\n The instance briefly loses connectivity, because the driver\n automatically restarts when the registry entries change.\n\n### PowerShell\n\n1. Open PowerShell as Administrator.\n2. Run the following command:\n\n ```\n Set-NetIPInterface -InterfaceAlias INTERFACE_NAME -AddressFamily IPv4 -NlMtu MTU \n ```\n3. Run the following command to update device driver settings:\n\n ```\n Set-NetAdapterAdvancedProperty -Name \"Ethernet\" -RegistryKeyword MTU -RegistryValue MTU \n ```\n\n You will briefly lose connectivity to the VM, because the driver\n automatically restarts when the registry entries change.\n\nMigrate VMs to a different MTU network\n--------------------------------------\n\nYou might decide to migrate your services to new VMs in a new network rather\nthan changing the MTU of your existing network. In such a case, you might have a\nserver, such as a database server, that needs to be accessible to all VMs during\nthe migration. If so, the following general approach might help you migrate\ncleanly:\n\n1. [Create the new network](/vpc/docs/create-modify-vpc-networks#create-custom-network) with the new MTU.\n2. Create any necessary firewall rules and routes in the new network.\n3. [Create a VM with multiple network\n interfaces](/vpc/docs/create-use-multiple-interfaces#creating_virtual_machine_instances_with_multiple_network_interfaces) in the old network. One interface connects to the new network using the new MTU and the other connects to the old network using the old MTU.\n4. Configure this new VM as a secondary server for the existing one.\n5. Fail the primary server over to the secondary one.\n6. Either [Migrate VMs to the new\n network](/compute/docs/instances/migrating-interfaces-between-networks) or create new VMs in the new network. If you create new VMs, you can create them from scratch, from an existing image, or by [creating a\n snapshot](/compute/docs/disks/create-snapshots) of the existing VMs and using that to populate the new persistent disks.\n7. Configure these VMs to use the operational server in that network.\n8. Migrate traffic to the new VMs.\n9. If you intend to delete the old network, create a new server in the new network, get it in sync with the existing server, and fail over to it.\n10. Delete the old server and old network.\n\nTry it for yourself\n-------------------\n\n\nIf you're new to Google Cloud, create an account to evaluate how\nVPC performs in real-world\nscenarios. New customers also get $300 in free credits to run, test, and\ndeploy workloads.\n[Try VPC free](https://console.cloud.google.com/freetrial)"]]