Advertisement
Guest User

Untitled

a guest
Sep 11th, 2017
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 6.95 KB | None | 0 0
  1. @echo off
  2.  
  3. rem reset winsock:
  4. netsh winsock reset
  5. rem reset ip/dhcp:
  6. netsh int ip reset
  7. rem reset tcp params:
  8. netsh int tcp reset
  9.  
  10. rem Get the status of these tcp => netsh int tcp show global
  11. netsh interface tcp set global rss=enabled chimney=automatic netdma=disabled dca=disabled autotuninglevel=normal
  12. netsh interface tcp set global congestionprovider=none ecncapability=disabled timestamps=disabled
  13.  
  14. netsh interface tcp set heuristics enabled
  15. netsh interface tcp set heuristics wsh=enabled
  16.  
  17. rem  Large Scale Offload (LSO) is buggy on a lot of NIC's. You can disable it with these commands
  18. netsh interface tcp set global chimney=disabled
  19.  
  20. rem Other ip releated settings => netsh int ip show global
  21. netsh interface ip set global neighborcachelimit=4096
  22. netsh interface ip set global defaultcurhoplimit=64
  23. netsh interface ip set global taskoffload=enabled mediasenseeventlog=disabled
  24.  
  25. rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters]
  26. rem "AllowUnqualifiedQuery"=dword:00000001              # allow DNS query without domain name
  27. rem "DefaultTTL"=dword:00000040                         # 64 hops
  28. rem "DisableMediaSenseEventLog"=dword:00000001          # no entry in eventlog of cable (dis-)connect
  29. rem "DisableRss"=dword:00000000                         # disable Receiver Side Scaling tcp windows
  30. rem "DisableTaskOffload"=dword:00000000                 # disable task offloading to nic
  31. rem "DisableTcpChimneyOffload"=dword:00000000           # disable chimney offload
  32. rem "DnsOutstandingQueriesCount"=dword:000003e8         #
  33. rem "DnsQueryTimeouts"=REG_MULTI_SZ:"1 1 2 2 4 0"       # don't wat too long for DNS server response
  34. rem "EnableAddrMaskReply"=dword:00000000                # dont reply to subnet pings
  35. rem "EnableBcastArpReply"=dword:00000000                # dont reply to arp broadcast requests
  36. rem "EnableConnectionRateLimiting"=dword:00000000       # bypass the limitation on half open tcp
  37. rem "EnableDca"=dword:00000000                          # enable Direct Cache Access from nic to cpu
  38. rem "EnableHeuristics"=dword:00000001                   # let windows tcp find optimum, works with Chimney offload
  39. rem "EnableIPAutoConfigurationLimits"=dword:00000000    # no auto ip from microsoft
  40. rem "EnableTCPA"=dword:00000000                         # enable Net DMA
  41. rem "EnableWsd"=dword:00000000                          # enable Windows Scaling Diagnostics, choppy flash video if enable!!!
  42. rem "IPEnableRouter"=dword:00000000                     # don't discover routers
  43. rem "QualifyingDestinationThreshold"=dword:ffffffff     # QOS no threshold
  44. rem "StrictTimeWaitSeqCheck"=dword:00000001             # does activate TcpTimedWaitDelay (only from win8+?)
  45. rem "SynAttackProtect"=dword:00000001                   # protect against syn flood (DOS) attacks
  46. rem "Tcp1323Opts"=dword:00000001                        # windows scaling (1) and timestamps (2)
  47. rem "TCPMaxDataRetransmissions"=dword:00000002          # limit the max nr of data retransmissions
  48. rem "TcpTimedWaitDelay"=dword:0000001e                  # wait 30 secs before closing inactive connection (StrictTimeWaitSeqCheck 1)
  49.  
  50. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v AllowUnqualifiedQuery /d 1 /t REG_DWORD /f
  51. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DisableMediaSenseEventLog /d 1 /t REG_DWORD /f
  52. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DisableRss /d 0 /t REG_DWORD /f
  53. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DisableTaskOffload /d 0 /t REG_DWORD /f
  54. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DisableTcpChimneyOffload /d 0 /t REG_DWORD /f
  55. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DnsOutstandingQueriesCount /d 1000 /t REG_DWORD /f
  56. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v DnsQueryTimeouts /d "1 1 2 2 4 0" /t REG_MULTI_SZ  /f
  57. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableAddrMaskReply /d 0 /t REG_DWORD /f
  58. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableBcastArpReply /d 0 /t REG_DWORD /f
  59. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableConnectionRateLimiting /d 0 /t REG_DWORD /f
  60. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableDca /d 0 /t REG_DWORD /f
  61. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableHeuristics /d 1 /t REG_DWORD /f
  62. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableIPAutoConfigurationLimits /d 0 /t REG_DWORD /f
  63. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableTCPA /d 0 /t REG_DWORD /f
  64. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v EnableWsd /d 0 /t REG_DWORD /f
  65. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v IPEnableRouter /d 0 /t REG_DWORD /f
  66. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v QualifyingDestinationThreshold /d "0xffffffff" /t REG_DWORD /f
  67. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v StrictTimeWaitSeqCheck /d 1 /t REG_DWORD /f
  68. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v SynAttackProtect /d 1 /t REG_DWORD /f
  69. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v Tcp1323Opts /d 1 /t REG_DWORD /f
  70. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v TCPMaxDataRetransmissions /d 2 /t REG_DWORD /f
  71. reg add HKLM\SYSTEM\CurrentControlSet\services\Tcpip\Parameters /v TcpTimedWaitDelay /d "0x0000001e" /t REG_DWORD /f
  72.  
  73.  
  74. rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\<UID>]
  75. rem "TcpAckFrequency"=dword:00000001                    # def 2 outstanding ACKS. Use 5 for 100Mbit, 13 for 1Gbit network connection (1 beats timeouts Outlook)
  76. rem "TcpDelAckTicks"=dword:00000000                     # Disable Nagling
  77.  
  78. rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NDIS\Parameters]
  79. rem "RssBaseCpu"=dword:00000001                         #
  80. rem "MaxNumRssCpus"=dword:00000002                      # (4)  (2=server, 1=workstation) Receive Side Scaling to one CPU (all cores)
  81.  
  82. rem [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AFD\Parameters]
  83. rem "FastCopyReceiveThreshold"=dword:000005dc           # UDP streaming threshold 1500 bytes/s
  84. rem "FastSendDatagramThreshold"=dword:000005dc          # UDP streaming threshold 1500 bytes/s
  85.  
  86. rem Other settings affecting copying files with explorer over tcpip:
  87.  
  88. reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v CopyBufferSize /d 65536 /t REG_DWORD /f
  89.  
  90. rem [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
  91. rem "CopyBufferSize"=dword:00010000                     # x2000-x100000 else x40000 (64 KB)
  92.  
  93. reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v CopyFileBufferedSynchronousIo /d 1 /t REG_DWORD /f
  94. reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v CopyFileChunkSize /d "0x00004000" /t REG_DWORD /f
  95. reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\System /v CopyFileOverlappedCount /d "0x10" /t REG_DWORD /f
  96.  
  97. rem [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System]
  98. rem "CopyFileBufferedSynchronousIo"=dword:00000001      # do it synchronous
  99. rem "CopyFileChunkSize"=dword:00004000                  # copy 16KB blocks
  100. rem "CopyFileOverlappedCount"=dword:00000010            #  ?, 16 (0x10) works best
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement