netsh interface show interface, then apply the MTU setting by referencing that numeric index rather than the text name. This bypasses the parsing errors that cause the display of question marks in Windows 10 CMD environments.
Understanding the Cause of Question Marks
When you attempt to set network parameters usingnetsh in the Command Prompt, Windows relies on string parsing to locate the target network adapter. If the interface name contains spaces, non-ASCII characters, or if the console's code page does not match the system's locale, the shell may fail to interpret the string correctly. Instead of displaying the actual name, it substitutes invalid characters with question marks (?). This is a rendering and parsing issue, not necessarily a failure of the network stack itself.
Another common cause is attempting to use a dynamic name that changes between reboots or network state changes. The text-based name might be ambiguous, leading the parser to return a placeholder. Using the static Interface Index number is the most robust method for scripting and manual configuration because it remains constant regardless of how the adapter is named in the Network Connections panel.
For more details on managing MTU values specifically, you can refer to our guide on How to Change MTU Value to 1500 for WiFi Interface in netsh int IPv4. This resource covers the specific syntax variations for different IP versions.
Identifying the Correct Interface Index
Before applying any settings, you need to find the numeric ID associated with your Wi-Fi or Ethernet adapter. Open Command Prompt as an administrator. Run the following command to list all interfaces along with their states and indices:netsh interface show interface
The output will look similar to this:
Admin State State Type Interface Name
-------------------------------------------------------------------------
Enabled Connected Dedicated Wi-Fi
Disabled Disconnected Dedicated Local Area Connection
...
Note the number in the first column next to your desired interface. For example, if "Wi-Fi" has the index 12, you will use 12 in subsequent commands. This number is unique and stable, eliminating the ambiguity that causes question marks.
If you are scripting these changes, remember that variables in CMD do not persist across sessions unless explicitly saved. For complex automation involving multiple adapters, consider reading Persisting Windows Variables in CMD Files to ensure your scripts handle environment data correctly.
Setting MTU Using the Interface Index
Once you have the index number, you can set the Maximum Transmission Unit (MTU) without risking parsing errors. Use theset subinterface command followed by the protocol (IPv4 or IPv6), the index, and the MTU value.
For IPv4, run:
netsh interface ipv4 set subinterface <Index> mtu=1400 store=persistent
Replace <Index> with the number you identified earlier. Replace 1400 with your desired MTU size. Common values are 1500 for standard Ethernet/Wi-Fi, 1400 for some VPNs, or 1380 for PPPoE connections. The store=persistent flag ensures the setting survives a reboot.
If you need to configure IPv6 instead, use:
netsh interface ipv6 set subinterface <Index> mtu=1400 store=persistent
Verify the change by running:
netsh interface ipv4 show subinterface
This should display the current MTU for each interface, confirming that your setting was applied successfully.
Troubleshooting Encoding and Syntax Issues
If you still encounter issues when trying to use names instead of indices, check your console's encoding. Older versions of Windows CMD use Code Page 437 or 850 by default, which may not support Unicode characters used in modern interface names. You can temporarily change the code page to UTF-8 by running:chcp 65001
However, even with UTF-8, using the index is preferred for reliability. Ensure that you are running CMD with administrative privileges. Non-administrator accounts lack the permissions required to modify network interface properties, which can result in vague error messages or silent failures.
Additionally, avoid using quotes around the interface name unless absolutely necessary. In many cases, netsh parses quoted strings differently than unquoted ones, especially if the name contains hyphens or apostrophes. If you must use a name, enclose it in double quotes:
netsh interface ipv4 set subinterface "Wi-Fi" mtu=1400 store=persistent
But again, the index method is superior for stability. If you are experiencing broader connectivity issues after changing MTU, such as inability to reach local servers, you might need to adjust routing rules. See Routing all traffic to local socket server to act as a tunnel for context on how network layer changes affect traffic flow.
Frequently Asked Questions
Why does my MTU setting revert after a reboot?
If the setting disappears, you likely omitted the store=persistent parameter in your command. Without this flag, netsh applies the change only to the current runtime session. Always include store=persistent to write the configuration to the registry.
Can I use PowerShell instead of CMD for this task?
Yes, PowerShell offers more robust object handling and avoids many CMD encoding pitfalls. You can use the Set-NetIPInterface cmdlet with the -InterfaceIndex parameter to achieve the same result. PowerShell is generally recommended for modern Windows administration tasks.
What happens if I set an MTU that is too high?
Setting an MTU higher than what your network path supports causes packet fragmentation or drop. Devices will fail to communicate properly, often resulting in slow speeds or complete loss of connectivity for large packets like video streams or file transfers. Stick to 1500 unless your ISP requires a lower value.
How do I reset the MTU to its default value?
To revert to the default, use the same command but specify mtu=0 or omit the MTU parameter entirely depending on the version. The system will automatically calculate the optimal MTU based on the physical link layer capabilities. This effectively clears any custom overrides you previously set.
Is it safe to change MTU on Ethernet while Wi-Fi is active?
Yes, changing the MTU on one interface does not directly affect another. However, if you are using both simultaneously for load balancing or failover, inconsistent MTU sizes can lead to unpredictable behavior. It is best practice to test changes on one interface at a time to isolate any potential issues.