-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVGw_vpn.ps1
126 lines (103 loc) · 3.38 KB
/
VGw_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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Create a resource group
# Create a virtual network
# Add a gateway subnet
# Request a public IP address
# Create the VPN gateway
# Create a resource group
az group create --name rg-vpn --location eastus
az group delete --name rg-vpn --yes
# Create a virtual network
az network vnet create \
-n vpn-fin \
-g rg-vpn \
-l eastus \
--address-prefix 10.240.0.0/24 \
--subnet-name Frontend \
--subnet-prefix 10.240.0.0/24
#
# Add a gateway subnet
az network vnet subnet create \
--vnet-name rg-rpa-tst-eus-vnet \
-n GatewaySubnet \
-g rg-rpa-tst-eus \
--address-prefix 172.17.1.0/24
#
# Request a public IP address
az network public-ip create \
-n win19-fin-rpa-eus284 \
-g rg-rpa-tst-eus \
--allocation-method Static
#
# Create the VPN gateway
az network vnet-gateway create \
-n VGW-VPN \
-l eastus \
-g rg-rpa-tst-eus \
--public-ip-address rg-vpn-pip \
--vnet rg-rpa-tst-eus-vnet \
--gateway-type Vpn \
--sku basic \
--vpn-type RouteBased \
--no-wait
#
# View the VPN gateway
az network vnet-gateway show \
-n VGW-VPN \
-g rg-rpa-tst-eus
#
# View the public IP address
az network public-ip show \
--name VNet1GWIP \
--resource-group TestRG11
#
# Associate an existing VM to a public IP
az network nic ip-config update \
--name ipconfig1 \
--nic-name win19-fin-rpa-eus284 \
--resource-group rg-rpa-tst-eus \
--public-ip-address win19-fin-rpa-eus284
#
# Dissociate an existing VM to a public IP
az network nic ip-config update \
--name ipconfig1 \
--nic-name win19-fin-rpa-eus284 \
--resource-group rg-rpa-tst-eus \
--remove publicIpAddress
#
# List all P2S connections
az network p2s-vpn-gateway list -g rg-rpa-tst-eus
az network p2s-vpn-gateway show -n vgw-vpn -g MC_General_General_eastus
az network p2s-vpn-gateway create
az network p2s-vpn-gateway delete
az network p2s-vpn-gateway vpn-client
az network p2s-vpn-gateway connection show --gateway-name vgw-vpn \
--resource-group MC_General_General_eastus \
--name vgw-vpn
#
az network p2s-vpn-gateway connection list \
--gateway-name vgw-vpn \
--resource-group MC_General_General_eastus
#
az --version
# How to reset VGW
az network vnet-gateway reset -g MC_General_General_eastus -n vgw-vpn
CloudVPN
MIIC4TCCAcmgAwIBAgIQPNdBKOmguLZGiWINiqo1KzANBgkqhkiG9w0BAQsFADAT
MREwDwYDVQQDDAhDbG91ZFZQTjAeFw0yMTExMDMxMzQyMjVaFw0yMjExMDMxNDAy
MjVaMBMxETAPBgNVBAMMCENsb3VkVlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAv5BJ7kCcXsmNJ7/Os2h5nLoCP+oQ0VzJeOx+tUhZ+qgm5eN+Do8c
zSW3h9rnmd2rTkJ9VwRlK67RwCC8dnXbYDnE1Ln9gIJt0Q/nfnmFUMz5/o1AcV13
WmSFD6KhtvWaCbbPItvr14y54TQtaIzeMJuD64TTeC+i18YSov0VY3bMRzsYznnU
I3N5E5HR26iR2iWvdwwTYVPIjAUC5uRr8+XMauVTJDjaxIxNY2OaMGHovSoGpEhr
ploX9dwEIS64K0BWyC4m+iSSQdP+hi24+H4jOS83GKMTkmqJPJDr1evhgIW8g3eT
Q5qCg3Owsf2iEloidiz6kidpMTmxrAfBXQIDAQABozEwLzAOBgNVHQ8BAf8EBAMC
AgQwHQYDVR0OBBYEFHa8L5BF8wy0fTSiSfScmVEetNgJMA0GCSqGSIb3DQEBCwUA
A4IBAQCDKy6Q3xVYMpF4KkXpRLBJC2Rv+EhbeFwb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