gpt4 book ai didi

networking - Azure 虚拟网络点到站点(例如 Azure Connect)自动连接

转载 作者:行者123 更新时间:2023-12-04 22:05:34 25 4
gpt4 key购买 nike

虽然 Azure Connect 即将退役,并且 Azure 虚拟网络提供了类似的功能且速度更快,但我注意到了一些缺点。

Azure Connect 能够自动维持连接,甚至无需用户登录。但是,Azure 虚拟网络要求用户以交互方式连接/重新连接到 VPN。这使得它在生产环境中完全无法使用。有什么办法可以克服这个障碍吗?

最佳答案

要解决此问题,您可以使用 rasdial。我第一次使用 rasdial 时遇到了这个问题:此系统不支持此函数。不要被此消息所欺骗,因为这只是您没有提供正确的语法。

rasdial "Your VPN name" /phonebook:%userprofile%\AppData\Roaming\Microsoft\Network\Connections\Cm\Your-VPN\Your-VPN.pbk"
  • %userprofile% 是您用于安装 Azure VPN 的用户配置文件。
  • Your-VPN 是 azure vpn 连接的名称。

一个简单的方法是制作批处理脚本:

SET VPN_NAME=azureVPN
:loop
rasdial %VPN_NAME% /PHONEBOOK:C:\Users\bas\AppData\Roaming\Microsoft\Network\Connections\Cm\%VPN_NAME%\%VPN_NAME%.pbk
timeout 10
goto loop

结果将是:

Connecting to test...
Verifying username and password...
Registering your computer on the network...
Successfully connected to test.
Command completed successfully.

10秒后:

You are already connected to test.
Command completed successfully.

要让此脚本在计算机启动时启动,请使用任务调度程序。

关于networking - Azure 虚拟网络点到站点(例如 Azure Connect)自动连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17524710/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com