Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用于配置虚拟网络网关的Azure cli命令_Azure_Azure Cli_Openvpn_Azure Vpn - Fatal编程技术网

用于配置虚拟网络网关的Azure cli命令

用于配置虚拟网络网关的Azure cli命令,azure,azure-cli,openvpn,azure-vpn,Azure,Azure Cli,Openvpn,Azure Vpn,配置点到点VPN设置的azure cli命令是什么 我正在寻找通过门户执行这些步骤的az等效代码: - From the settings section for a Virtual network gateway - Click on Point-to-site configuration settings - Set address pool, tunnel type, authentication type, and a root certificate - Save - Download

配置点到点VPN设置的azure cli命令是什么

我正在寻找通过门户执行这些步骤的az等效代码:

- From the settings section for a Virtual network gateway
- Click on Point-to-site configuration settings
- Set address pool, tunnel type, authentication type, and a root certificate
- Save
- Download VPN Client (vpnconfig.ovpn file)

要通过Azure CLI命令创建虚拟网络网关,可以按照中的步骤操作。但是,当要创建虚拟网络网关时,您应该添加更多的参数

--地址前缀

以空间分隔的CIDR前缀列表,表示P2S客户端的地址空间

--客户端协议

用于连接的协议

接受值:IkeV2、OpenVPN、SSTP

因此,完整的命令如下所示:

az network vnet-gateway create \
  -n VNet1GW \
  -l eastus \
  --public-ip-address VNet1GWIP \
  -g TestRG1 \
  --vnet VNet1 \
  --gateway-type Vpn \
  --sku VpnGw1 \
  --vpn-type RouteBased \
  --address-prefixes 192.168.0.0/24 \
  --client-protocol OpenVPN
然后需要上载根证书的证书:

az network vnet-gateway root-cert create -g TestRG1 -n vpncliCert --gateway-name VNet1GW --public-cert-data path/to/your/certificate

一切正常后,您可以下载VPN客户端使用。请不要忘记在您的计算机中安装根证书的客户端证书。

我花了一个小时试图使用
az cli
找到“指向站点”配置,然后回答说这称为“地址前缀”,因为它当然是。非常感谢。