1

I have some Rackspace VM's and need to disable these advanced NIC properties:

  • Correct TCP/UDP checksum value
  • IPv4 checksum offload
  • Large receive offload
  • Large send offload version 2
  • TCP checksum offload
  • UDP checksum offload

Now i need to do this using Powershell/Batch and until now i have this.

Disable-NetAdapterChecksumOffload -Name private -UdpIPv4 -TcpIPv4
Disable-NetAdapterLso -Name private

cmd.exe /C "netsh int tcp set global chimney=disabled"
cmd.exe /C "netsh int tcp set global rss=disabled"
cmd.exe /C "netsh int tcp set global netdma=disabled"
cmd.exe /C "netsh int ip set global taskoffload=disabled"

new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name DisableTaskOffload -Value 1
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name TCPChecksumOffloadIPv4  -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name UDPChecksumOffloadIPv4  -Value 0

But i cant make it work.

ccamacho
  • 203
  • 4
  • 10

2 Answers2

1

I manage to do this with this powershell script.

$root = 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
$items = Get-ChildItem -Path Registry::$Root -Name
Foreach ($item in $items) {
    if ($item -ne "Properties") {
        $path = $root + "\" + $item
        $DriverDesc = Get-ItemProperty -Path Registry::$path | Select-Object -expandproperty DriverDesc
        if ($DriverDesc -eq "Citrix PV Ethernet Adapter") {
            Set-ItemProperty -path Registry::$path -Name LROIPv4 -Value 0
        }
    }
}

new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name IPChecksumOffloadIPv4  -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name LSOv2IPv4 -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name NeedChecksumValue  -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name TCPChecksumOffloadIPv4  -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name UDPChecksumOffloadIPv4  -Value 0
new-ItemProperty -force -Path hklm:\\\\HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\TCPIP\\Parameters -Name LROIPv4  -Value 0

The important thing its to see the pproperties to be changed.

Using:

PS > Get-NetAdapter

PS > Get-NetAdapterAdvancedProperty name_of_the_nic

PS > Get-NetAdapterAdvancedProperty name_of_the_nic | ft RegistryKeyword

Now update that RegistryKeyword as you need it

ccamacho
  • 203
  • 4
  • 10
0

Presuming that 'Ethernet' is the name of your NIC:

# Display valid values
Get-NetAdapterAdvancedProperty Ethernet | ft DisplayName , ValidDisplayValues
# Display existing settings:
Get-NetAdapterAdvancedProperty Ethernet | ft DisplayName, DisplayValue, RegistryKeyword ,   RegistryValue
# Set all the settings required to switch of TCP IPv4 offloading to fix SQL Server connection dropouts in high connection, high transaction environment:
# Note that RDP connection to instance will drop out momentarily
Set-NetAdapterAdvancedProperty Ethernet -DisplayName "IPv4 Checksum Offload" -DisplayValue "Disabled" -NoRestart
Set-NetAdapterAdvancedProperty Ethernet -DisplayName "Large Send Offload V2 (IPv4)" -DisplayValue "Disabled" -NoRestart
Set-NetAdapterAdvancedProperty Ethernet -DisplayName "TCP Checksum Offload (IPv4)" -DisplayValue "Disabled" -NoRestart
Set-NetAdapterAdvancedProperty Ethernet -DisplayName "Large Receive Offload (IPv4)" -DisplayValue "Disabled" 
# Check its worked
Get-NetAdapterAdvancedProperty Ethernet | ft DisplayName, DisplayValue, RegistryKeyword ,   RegistryValue
RobG
  • 101
  • 2