Skip to content

Commit 2a3faea

Browse files
committed
removed NETSH commands
1 parent 929db09 commit 2a3faea

File tree

1 file changed

+28
-40
lines changed

1 file changed

+28
-40
lines changed

articles/virtual-network/how-to-virtual-machine-mtu.md

Lines changed: 28 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ The following table shows the largest MTU size supported on the Azure Network In
2626

2727
| Operating System | Network Interface | Largest MTU for inter virtual network traffic |
2828
|------------------|-------------------|-----------------------------------------------|
29-
| Windows Server | Mellanox Cx3, Cx4, Cx5 | 3900 </br> **When setting the MTU value with `Set-NetAdapterAdvancedProperty`, use the value `4088`. The value used when setting the MTU with `netsh` is 3900.** |
30-
| Windows Server | (Preview) Microsoft Azure Network Adapter MANA | 9000 </br> **When setting the MTU value with `Set-NetAdapterAdvancedProperty`, use the value `9014`. The value used when setting the MTU with `netsh` is 9000.** |
31-
| Linux | Mellanox Cx3, Cx4, Cx5 | 3900 |
29+
| Windows Server | Mellanox Cx-3, Cx-4, Cx-5 | 3900 </br> **When setting the MTU value with `Set-NetAdapterAdvancedProperty`, use the value `4088`.**. **To persist reboots, the value returned by `Test-Connection` must also be set with `Set-NetIPInterface`.** |
30+
| Windows Server | (Preview) Microsoft Azure Network Adapter MANA | 9000 </br> **When setting the MTU value with `Set-NetAdapterAdvancedProperty`, use the value `9014`.** **To persist reboots, the value returned by `Test-Connection` must also be set with `Set-NetIPInterface`.** |
31+
| Linux | Mellanox Cx-3, Cx-4, Cx-5 | 3900 |
3232
| Linux | (Preview) Microsoft Azure Network Adapter | 9000 |
3333

3434
## Prerequisites
@@ -64,7 +64,7 @@ The following resources are used as examples in this article. Replace these valu
6464

6565
## Precautions
6666

67-
- Virtual machines in Azure can support a larger MTU than the 1,500-byte default only for traffic that stays within the virtual network. A larger MTU isn't supported for scenarios outside of inter-virtual network VM-to-VM traffic. Traffic traversing through gateways, peering’s, or to the internet might not be supported. Configuration of a larger MTU can result in fragmentation and reduction in performance. For traffic utilizing these scenarios, utilize the default 1,500 byte MTU for testing to ensure that a larger MTU is supported across the entire network path.
67+
- Virtual machines in Azure can support a larger MTU than the 1,500-byte default only for traffic that stays within the virtual network. A larger MTU isn't supported for scenarios outside of intra-virtual network VM-to-VM traffic. Traffic traversing through gateways, peering’s, or to the internet might not be supported. Configuration of a larger MTU can result in fragmentation and reduction in performance. For traffic utilizing these scenarios, utilize the default 1,500 byte MTU for testing to ensure that a larger MTU is supported across the entire network path.
6868

6969
- Optimal MTU is operating system, network, and application specific. The maximal supported MTU might not be optimal for your use case.
7070

@@ -88,7 +88,7 @@ Use the following steps to change the MTU size on a Linux virtual machine:
8888

8989
1. Sign-in to **vm-1**
9090

91-
1. Use the `ip` command to show the current network interfaces and their MTU settings, Record the IP address for the subsequent steps. In this example, the IP address is **10.0.0.4**.
91+
1. Use the `ip` command to show the current network interfaces and their MTU settings, Record the IP address for the subsequent steps. In this example, the IP address is **10.0.0.4** and the ethernet interface is **eth0**.
9292

9393
```bash
9494
ip address show
@@ -115,7 +115,7 @@ Use the following steps to change the MTU size on a Linux virtual machine:
115115
valid_lft forever preferred_lft forever
116116
```
117117

118-
1. Set the MTU value on **vm-1** to the highest value supported by the network interface.
118+
1. Set the MTU value on **vm-1** to the highest value supported by the network interface. In this example, the name of the network interface is **eth0**. Replace this value with your value.
119119

120120
* For the Mellanox adapter, use the following example to set the MTU value to **3900**:
121121

@@ -428,20 +428,20 @@ Use the following steps to change the MTU size on a Windows Server virtual machi
428428
vm-1 10.0.0.5 1 Success 3892
429429
```
430430

431-
1. Verify the MTU size on the network interface using `PING`. For Windows, use -f and -l. The -f option instructs ping to NOT fragment and -l sets the packet size. To determine the packet size, subtract 28 from the MTU setting of 3900.
431+
1. Verify the MTU size on the network interface using `PING`. For Windows, use -f and -l. The -f option instructs ping to NOT fragment and -l sets the packet size. Use the value returned by the `Test-Connection` command for the MtuSize property. In this example, it's **3892**.
432432
433433
```powershell
434-
ping 10.0.0.5 -f -l 3872
434+
ping 10.0.0.5 -f -l 3892
435435
```
436436
437437
```output
438-
PS C:\Users\azureuser> ping 10.0.0.5 -f -l 3872
438+
PS C:\Users\azureuser> ping 10.0.0.5 -f -l 3892
439439
440-
Pinging 10.0.0.5 with 3872 bytes of data:
441-
Reply from 10.0.0.5: bytes=3872 time=1ms TTL=128
442-
Reply from 10.0.0.5: bytes=3872 time<1ms TTL=128
443-
Reply from 10.0.0.5: bytes=3872 time=1ms TTL=128
444-
Reply from 10.0.0.5: bytes=3872 time=1ms TTL=128
440+
Pinging 10.0.0.5 with 3892 bytes of data:
441+
Reply from 10.0.0.5: bytes=3892 time=1ms TTL=128
442+
Reply from 10.0.0.5: bytes=3892 time<1ms TTL=128
443+
Reply from 10.0.0.5: bytes=3892 time=1ms TTL=128
444+
Reply from 10.0.0.5: bytes=3892 time=1ms TTL=128
445445
446446
Ping statistics for 10.0.0.5:
447447
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
@@ -452,9 +452,9 @@ Use the following steps to change the MTU size on a Windows Server virtual machi
452452
An indication that there is a mismatch in settings between the source and destination displays as an error message in the output. In this case, the MTU isn't set on the source network interface.
453453

454454
```output
455-
PS C:\Users\azureuser> ping 10.0.0.5 -f -l 3872
455+
PS C:\Users\azureuser> ping 10.0.0.5 -f -l 3892
456456
457-
Pinging 10.0.0.5 with 3872 bytes of data:
457+
Pinging 10.0.0.5 with 3892 bytes of data:
458458
Packet needs to be fragmented but DF set.
459459
Packet needs to be fragmented but DF set.
460460
Packet needs to be fragmented but DF set.
@@ -464,33 +464,27 @@ Use the following steps to change the MTU size on a Windows Server virtual machi
464464
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
465465
```
466466

467-
1. Use `netsh` to determine the subinterface name for the subsequent commands.
467+
1. Use `Get-NetIPInterface` to determine the current MTU value. The interface alias used in the following example is **Ethernet 2**. Replace this value with your value.
468468

469469
```powershell
470-
netsh interface ipv4 show subinterface
470+
Get-NetIPInterface -InterfaceAlias "Ethernet 2"
471471
```
472472

473473
```output
474-
C:\Users\azureuser>netsh interface ipv4 show subinterface
475-
476-
MTU MediaSenseState Bytes In Bytes Out Interface
477-
---------- --------------- ------------ ------------ -------------
478-
4294967295 1 0 0 Loopback Pseudo-Interface 1
479-
4074 1 696088 890076 Ethernet 2
480474
```
481475

482-
1. Use `netsh` to set the MTU value for **vm-1** to persist reboots.
476+
1. Use `Set-NetIPInterface` to set the MTU value for **vm-1** to persist reboots. For the MTU value, **3892** is used in this example. Replace this value with your value returned by the `Test-Connection` command.
483477

484478
* Mellanox interface:
485479

486480
```powershell
487-
netsh interface ipv4 set subinterface "Ethernet 2" mtu=3900 store=persistent
481+
Set-NetIPInterface -InterfaceAlias "Ethernet 2" -NIMtuBytes 3892
488482
```
489483

490484
* Microsoft Azure Network Adapter:
491485

492486
```powershell
493-
netsh interface ipv4 set subinterface "Ethernet 2" mtu=9000 store=persistent
487+
Set-NetIPInterface -InterfaceAlias "Ethernet 2" -NIMtuBytes 9000
494488
```
495489

496490
1. Sign-in to **vm-2**.
@@ -552,33 +546,27 @@ Use the following steps to change the MTU size on a Windows Server virtual machi
552546
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
553547
```
554548

555-
1. Use `netsh` to determine the subinterface name for the subsequent commands.
549+
1. Use `Get-NetIPInterface` to determine the current MTU value. The interface alias used in the following example is **Ethernet 2**. Replace this value with your value.
556550

557551
```powershell
558-
netsh interface ipv4 show subinterface
552+
Get-NetIPInterface -InterfaceAlias "Ethernet 2"
559553
```
560554

561555
```output
562-
C:\Users\azureuser>netsh interface ipv4 show subinterface
563-
564-
MTU MediaSenseState Bytes In Bytes Out Interface
565-
---------- --------------- ------------ ------------ -------------
566-
4294967295 1 0 0 Loopback Pseudo-Interface 1
567-
4074 1 696088 890076 Ethernet 2
568556
```
569557

570-
1. Use the following steps on **vm-2** to set the MTU value for **vm-2** to persist reboots.
558+
1. Use `Set-NetIPInterface` to set the MTU value for **vm-2** to persist reboots. For the MTU value, **3892** is used in this example. Replace this value with your value returned by the `Test-Connection` command.
571559

572-
* Mellanox interface:
560+
* Mellanox interface:
573561

574562
```powershell
575-
netsh interface ipv4 set subinterface "Ethernet 2" mtu=3900 store=persistent
563+
Set-NetIPInterface -InterfaceAlias "Ethernet 2" -NIMtuBytes 3892
576564
```
577565

578566
* Microsoft Azure Network Adapter:
579567

580568
```powershell
581-
netsh interface ipv4 set subinterface "Ethernet 2" mtu=9000 store=persistent
569+
Set-NetIPInterface -InterfaceAlias "Ethernet 2" -NIMtuBytes 9000
582570
```
583571

584572
---
@@ -656,7 +644,7 @@ To revert the changes made in this article, use the following steps:
656644
1. Use the following steps on **vm-1** to set the MTU value for **vm-1** to persist reboots.
657645
658646
```powershell
659-
netsh interface ipv4 set subinterface "Ethernet 2" mtu=1500 store=persistent
647+
Set-NetIPInterface -InterfaceAlias "Ethernet 2" -NIMtuBytes 1500
660648
```
661649
662650
1. Sign-in to **vm-2** to repeat the previous steps to set the MTU value to the default value of **1500**.

0 commit comments

Comments
 (0)