Modificar la MTU de una tarjeta de red en un servidor Windows Server 2016 / 2019 vía comandos de Powershell.
Primero corremos Windows PowerShell como administrador
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\Windows\system32>
Con el siguiente comando podemos ver el estado de los interfaces:
netsh interface ipv4 show interfaces
>>
Idx Met MTU State Name
--- ---------- ---------- ------------ ---------------------------
1 75 4294967295 connected Loopback Pseudo-Interface 1
6 15 1500 connected Ethernet0
15 15 1500 connected Ethernet1
Revisamos el valor de Idx y pasamos el siguiente comando para modificar la MTU de las interfaces 6 y 15
netsh interface ipv4 set subinterface "6" mtu=9014 store=persistent
netsh interface ipv4 set subinterface "15" mtu=9014 store=persistent
netsh interface ipv4 show interfaces
Idx Met MTU State Name
--- ---------- ---------- ------------ ---------------------------
1 75 4294967295 connected Loopback Pseudo-Interface 1
6 15 9014 connected Ethernet0
15 15 9014 connected Ethernet1
Para comprobar usaremos el comando ping. En caso de error veremos: “Packet needs to be fragmented but DF set” y si se ha hecho bien veremos una respuesta correcta al ping con el valor que pasamos de la MTU:
ping -f -l 8972 192.168.205.21
Pinging 192.168.1.3 with 8972 bytes of data:
Reply from 192.168.1.3: bytes=8972 time<1ms TTL=64
Reply from 192.168.1.3: bytes=8972 time<1ms TTL=64
Reply from 192.168.1.3: bytes=8972 time<1ms TTL=64
Reply from 192.168.1.3: bytes=8972 time<1ms TTL=64
Ping statistics for 192.168.205.21:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Otro comando que se debe usar para combrobar el tamaño de los paquetes jumbo:
Get-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket"
Name DisplayName DisplayValue RegistryKeyword RegistryValue
---- ----------- ------------ --------------- -------------
Ethernet1 Jumbo Packet 1514 *JumboPacket {1514}
Ethernet0 Jumbo Packet 1514 *JumboPacket {1514}
Cambiar los parámetros para jumboframes 9014:
Set-NetAdapterAdvancedProperty -Name "Ethernet0" -RegistryKeyword "*JumboPacket" -RegistryValue 9014
Set-NetAdapterAdvancedProperty -Name "Ethernet1" -RegistryKeyword "*JumboPacket" -RegistryValue 9014
Comprobar las interfaces
PS C:\Windows\system32> Get-NetAdapterAdvancedProperty -RegistryKeyword "*JumboPacket"
Name DisplayName DisplayValue RegistryKeyword RegistryValue
---- ----------- ------------ --------------- -------------
Ethernet1 Jumbo Packet 9014 *JumboPacket {9014}
Ethernet0 Jumbo Packet 9014 *JumboPacket {9014}
Listo!