OpenVPN and Clients and Windows
Nothing ever works like one wants it to. Take for instance a client connecting into an OpenVPN server. Communication back to the client? Nah! Who needs that. In the case of Windows, it isn't OpenVPN's fault.
If you can't ping from a VPN Server to a Windows Client, try this script on Windows;
pktmon stop 2>$null
pktmon filter remove
pktmon filter add "Physical-IP-Ping" -t ICMP -i 192.168.2.51
pktmon filter add "VPN-IP-Ping" -t ICMP -i 172.16.20.100
pktmon start --capture --comp all --pkt-size 0 --log-mode real-timeSee? OpenVPN is trying. But alas, Windows just isn't responding.
09:09:02.687395600 PktGroupId 1407374883553307, PktNumber 1, Appearance 1, Direction Rx , Type IP , Component 247, Edge 1, Filter 1, OriginalSize 84, LoggedSize 84
ip: SourceIP > DestinationIP: ICMP echo request, id 3491, seq 9, length 64
09:09:02.687411300 PktGroupId 1407374883553307, PktNumber 1, Appearance 2, Direction Rx , Type IP , Component 248, Edge 1, Filter 1, OriginalSize 84, LoggedSize 84
ip: SourceIP > DestinationIP: ICMP echo request, id 3491, seq 9, length 64
09:09:03.685967700 PktGroupId 1407374883553308, PktNumber 1, Appearance 1, Direction Rx , Type IP , Component 247, Edge 1, Filter 1, OriginalSize 84, LoggedSize 84
ip: SourceIP > DestinationIP: ICMP echo request, id 3491, seq 10, length 64Change the setting needed for it to reply;
Set-NetIPInterface `
-InterfaceAlias "WhatEverAdapterName" `
-AddressFamily IPv4 `
-WeakHostReceive Enabled `
-WeakHostSend EnabledCheck on the status;
Get-NetIPInterface `
-InterfaceAlias "WhatEverAdapterName" `
-AddressFamily IPv4 |
Format-Table InterfaceAlias,InterfaceIndex,WeakHostReceive,WeakHostSendOK, put it back the way it was, if desired;
Set-NetIPInterface `
-InterfaceAlias "WhatEverAdapterName" `
-AddressFamily IPv4 `
-WeakHostReceive Disabled `
-WeakHostSend DisabledMore Commands That Work (Experimental)
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''LAN_NIC'' -AddressFamily IPv4 -WeakHostReceive Disabled -WeakHostSend Disabled`"'"
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''OpenVPN_NIC'' -AddressFamily IPv4 -WeakHostReceive Disabled -WeakHostSend Disabled`"'"
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''LAN_NIC'' -AddressFamily IPv4 -WeakHostReceive Enable -WeakHostSend Enable`"'"
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''OpenVPN_NIC'' -AddressFamily IPv4 -WeakHostReceive Enable -WeakHostSend Enable`"'"
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''LAN_NIC'',''OpenVPN_NIC'' -AddressFamily IPv4 -WeakHostReceive Disabled -WeakHostSend Disabled`"'"
powershell.exe -NoProfile -Command "Start-Process powershell.exe -Verb RunAs -Wait -ArgumentList '-NoProfile -Command `"Set-NetIPInterface -InterfaceAlias ''LAN_NIC'',''OpenVPN_NIC'' -AddressFamily IPv4 -WeakHostReceive Enabled -WeakHostSend Enabled`"'"
Set-NetIPInterface -InterfaceA 'LAN_NIC','OpenVPN_NIC' -Add IPv4 -WeakHostR Disabled -WeakHostS Disabled
Set-NetIPInterface -InterfaceA 'LAN_NIC','OpenVPN_NIC' -Add IPv4 -WeakHostR Enabled -WeakHostS Enabled
powershell.exe -NoP -C "Start-Process powershell.exe -Verb RunAs -Wai -A '-NoP -C `"Set-NetIPInterface -InterfaceA ''LAN_NIC'',''OpenVPN_NIC'' -Add IPv4 -WeakHostR Enabled -WeakHostS Enabled`"'"
powershell.exe -NoP -C "Start-Process powershell.exe -Verb RunAs -Wai -A '-NoP -C `"Set-NetIPInterface -InterfaceA ''LAN_NIC'',''OpenVPN_NIC'' -Add IPv4 -WeakHostR Disabled -WeakHostS Disabled`"'"