Skip to main content
黑话筒

Windows 7 不能连接L2TP/IPSec VPN的解决办法,以及MacOS拨上VPN后,默认路由没改的解决办法

最近几篇都是讲不能xxx的原因....

Windows 7里连接不上L2TP/IPSec的VPN,提示无法连接主机,主机没响应。

前提是:L2TP都设置正确,协议是L2TP/IPSec,Preshared Key也填写了。

具体解决办法如下:

  1. 确保服务里面“IKE and AuthIP IPSec Keying module” 和“IPSec policy agent”两个服务状态是自动,并且已经运行
  2. 打开注册表,在HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent里添加一个DWORD(32-bit),名称是AssumeUDPEncapsulationContextOnSendRule的key,值为2

重启电脑即可。

如果你是在公司域中,需要在VPN设置里,去掉Include Windows logon domain前面的钩即可。

如果是在MacOS中发现VPN能连上,但是默认路由还是走原来的,并没有走VPN,可以参考这篇文章,把Service Order改一下,让VPN在Wifi/Ethernet之前就好了

参考文章: 《Windows 7 IPSec/L2TP VPN connection problem》

《How to configure an L2TP/IPsec server behind a NAT-T device in Windows Vista and in Windows Server 2008》

《VPN connection does not change the default routing on clients》