Files
for-servers/windows/win-network-boost.ps1
T

55 lines
2.8 KiB
PowerShell

# win-network-boost.ps1 — улучшение интернет-соединения на Windows 11
# Запуск от админа: PowerShell → правый клик → Run as Administrator → .\win-network-boost.ps1
Write-Host "=== Network Boost — Windows 11 ===" -ForegroundColor Cyan
Write-Host ""
# 1. Network Throttling — снимает ограничение на игровой трафик
Write-Host "[1/5] Network throttling off..." -ForegroundColor Yellow
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" /v "NetworkThrottlingIndex" /t REG_DWORD /d 0xffffffff /f | Out-Null
Write-Host " OK"
# 2. Nagle's algorithm off — меньше задержка TCP
Write-Host "[2/5] Nagle off..." -ForegroundColor Yellow
reg add "HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" /v "TCPNoDelay" /t REG_DWORD /d 1 /f | Out-Null
Write-Host " OK"
# 3. TCP autotuning — нормальный уровень (не отключен)
Write-Host "[3/5] TCP autotuning..." -ForegroundColor Yellow
netsh int tcp set global autotuninglevel=normal >$null
netsh int tcp set global rss=enabled >$null
netsh int tcp set global chimney=enabled >$null
netsh int tcp set global initialRto=2000 >$null
Write-Host " OK"
# 4. DNS — сохраняем текущий, только сбрасываем кэш
Write-Host "[4/5] DNS cache flush..." -ForegroundColor Yellow
$ifaces = Get-NetAdapter | Where-Object {$_.Status -eq "Up"}
ipconfig /flushdns >$null
foreach ($iface in $ifaces) {
$dns = (Get-DnsClientServerAddress -InterfaceIndex $iface.InterfaceIndex -AddressFamily IPv4).ServerAddresses -join ", "
if ($dns) { Write-Host " $($iface.Name): $dns (сохранён)" }
else { Write-Host " $($iface.Name): DHCP DNS" }
}
# 5. RSS на сетевых адаптерах
Write-Host "[5/5] RSS (Receive Side Scaling)..." -ForegroundColor Yellow
foreach ($iface in $ifaces) {
Set-NetAdapterRss -Name $iface.Name -Enabled $true -MaxProcessors 4 2>$null
Write-Host " $($iface.Name): RSS ON"
}
# Сброс DNS кэша уже сделан в шаге 4
Write-Host "============================================" -ForegroundColor Cyan
Write-Host " Готово" -ForegroundColor Green
Write-Host "============================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Что сделано:"
Write-Host " - Network throttling OFF (снято ограничение)"
Write-Host " - Nagle OFF (меньше задержка TCP)"
Write-Host " - TCP autotuning normal + RSS + Chimney"
Write-Host " - DNS: сохранён текущий, кэш сброшен"
Write-Host " - RSS по ядрам"
Write-Host ""
Write-Host "Для полного эффекта — перезагрузи ПК." -ForegroundColor Yellow