使用Openwrt系统架设VPN(Padavan潘多拉)
VPN(虚拟专用网络)第一层隧道协议PPtp所使用的默认端口号是TCP 1723

在子路由器中配置以下内容:

创建客户端账号:

使用以下脚本 MY-VPN.ps1 运行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| # VPN地址 $vpnName = "IP_ADDRESS"; $user = "USER"; $pass = "PASS";
$ErrorActionPreference = 'SilentlyContinue' $vpn = Get-VpnConnection -Name $vpnName # 检查是否需要创建 if(!$?){ # 创建 Add-VpnConnection -Name $vpnName -ServerAddress $vpnName -TunnelType PPTP -EncryptionLevel Required -RememberCredential -PassThru $vpn = Get-VpnConnection -Name $vpnName } # 直接连接 if($vpn.ConnectionStatus -eq "Disconnected"){ rasdial $vpnName $user $pass; } # 删除命令 # Remove-VpnConnection -Name $vpnName -F
Get-VpnConnection -Name $vpnName | findstr ConnectionStatus;
# 查公网ip curl ip.sb
echo '点击回车断开连接...' cmd /c "pause>nul" rasdial $vpnName /DISCONNECT sleep 2
|