我有多台计算机(Win10 pro)放置在不同的远程位置(我的合作伙伴),我需要管理。我需要从一个中心位置进入他们。所以我有一个中央的VPN服务器,我想要多个Win10专业实例连接到它。我正在使用L2TP,但我想迁移到wireguard。使用L2TP,可以从任务调度程序在后台启动rasdial.exe。其主要目标是在计算机启动后立即启动隧道,并在隧道关闭时自动重新连接。我需要在任何用户登录到计算机之前(例如在后台)。我想知道,同样的情况是否可以用有线?
我注意到有一个名为C:\Program的程序,它的命令行选项与wg (linux)程序非常相似:
C:\Program Files\WireGuard>wg.exe --help
Usage: wg.exe <cmd> [<args>]
Available subcommands:
show: Shows the current configuration and device information
showconf: Shows the current configuration of a given WireGuard interface, for use with `setconf'
set: Change the current configuration, add peers, remove peers, or change peers
setconf: Applies a configuration file to a WireGuard interface
addconf: Appends a configuration file to a WireGuard interface
syncconf: Synchronizes a configuration file to a WireGuard interface
genkey: Generates a new private key and writes it to stdout
genpsk: Generates a new preshared key and writes it to stdout
pubkey: Reads a private key from stdin and writes a public key to stdout
You may pass `--help' to any of these subcommands to view usage.但我认为这只是为了配置。我认为它不能用来启动隧道。原始文档( https://www.wireguard.com/quickstart/#command-line-interface )解释说,“接口.可以用ifconfig(8)或ip-link(8)激活”,但这当然只适用于unix。在该文档中,还有一个注释“非Linux用户将相反地编写wireguard-go wg0”,但我不知道他们在这里的意思。在任何地方都没有程序名叫"wireguard-go“。隧道的网络适配器仅在隧道已处于活动状态时才会出现在网络灭弧器列表中。例如,在隧道关闭时,没有网络适配器可以“启用”或“激活”。最后是wireguard.exe。在没有参数的情况下启动时,它是一个GUI应用程序。它不能在没有登录用户和桌面的情况下运行,并且它不会自动激活任何隧道。它有一些有趣的命令行选项。"wireguard.exe /managerservice“用于将其作为windows服务启动。"wireguard.exe /tunnelservice CONFIG_PATH“看上去很有希望,但我无法开始。我得到了这个错误,即“流程无法连接到服务管理器”或类似的东西。(当我作为管理员启动它时,也会得到这个错误。)
我没有主意了。我该怎么做?
发布于 2023-04-12 20:09:20
解决这一问题的所有其他办法都不是理想的。我见过的方法是:
wireguard /installtunnelservice C:\path\to\some\myconfname.conf这将创建一个名为
WireGuardTunnel$myconfname的服务,可以使用标准的services.msc或sc等标准服务管理实用程序来控制该服务。- 来源
这是一个关于赢了10的例子。。悬停图标显示隧道的名称。
发布于 2023-03-17 22:29:24
我发现也许更容易的选择是:https://git.zx2c4.com/wireguard-windows/about/docs/enterprise.md
/installtunnelservice C:\path\to\some\myconfname.conf
https://serverfault.com/questions/1096001
复制相似问题