Enable P2P while the device connects via VPN: registry value DOAllowVPNPeerCachingComputerHKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization

Policy ID
AllowVPNPeerCaching
Scope
Computer Configuration
Supported on
At least Windows Server 2016, Windows 10
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
Windows Components › Delivery Optimization

Registry

DOAllowVPNPeerCaching

REG_DWORDComputer
Checked
1
Unchecked
0
Element
Enable P2P while the device connects via VPN
Value type
REG_DWORD
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization]

; Options (use only one)
; Checked
"DOAllowVPNPeerCaching"=dword:00000001
; Unchecked
"DOAllowVPNPeerCaching"=dword:00000000
CMD
:: Options (use only one)

:: Checked
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v "DOAllowVPNPeerCaching" /t REG_DWORD /d 1 /f
:: Unchecked
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization" /v "DOAllowVPNPeerCaching" /t REG_DWORD /d 0 /f
PowerShell
# Common: create the key
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization' -Force | Out-Null

# Options (use only one)
# Checked
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization' -Name 'DOAllowVPNPeerCaching' -PropertyType DWord -Value 1 -Force | Out-Null
# Unchecked
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization' -Name 'DOAllowVPNPeerCaching' -PropertyType DWord -Value 0 -Force | Out-Null