Skip to content

Commit 9f8355d

Browse files
committed
QualityReviewPilot: firewall-hybrid-ps
1 parent 604b6d3 commit 9f8355d

File tree

1 file changed

+43
-52
lines changed

1 file changed

+43
-52
lines changed

articles/firewall/tutorial-hybrid-ps.md

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Deploy and configure Azure Firewall in a hybrid network using Azure PowerShell
2+
title: 'Tutorial: Deploy and configure Azure Firewall in a hybrid network using Azure PowerShell'
33
description: In this tutorial, you learn how to deploy and configure Azure Firewall using the Azure portal.
44
services: firewall
55
author: vhorne
66
ms.service: firewall
77
ms.topic: tutorial
88
ms.date: 10/27/2018
99
ms.author: victorh
10-
#Customer intent: As an administrator, I want to deploy and configure Azure Firewall in a hybrid network so that I can control access from an on-premise network to an Azure VNet.
10+
#Customer intent: As an administrator, I want to deploy and configure Azure Firewall in a hybrid network so that I can control access from an on-premises network to an Azure virtual network.
1111
---
1212
# Tutorial: Deploy and configure Azure Firewall in a hybrid network using Azure PowerShell
1313

@@ -20,14 +20,14 @@ In this tutorial, you learn how to:
2020
> * Create the virtual machines
2121
> * Test the firewall
2222
23-
For this tutorial, you create three VNets:
24-
- **VNet-Hub** - the firewall is in this VNet.
25-
- **VNet-Spoke** - the spoke VNet represents the workload located on Azure.
26-
- **VNet-Onprem** - The OnPrem VNet represents an on-premise network. In an actual deployment, it can be connected by either a VPN or Express Route connection. For simplicity, this tutorial uses a VPN gateway connection, and an Azure-located VNet is used to represent an on-premise network.
23+
For this tutorial, you create three virtual networks:
24+
- **VNet-Hub** - the firewall is in this virtual network.
25+
- **VNet-Spoke** - the spoke virtual network represents the workload located on Azure.
26+
- **VNet-Onprem** - The on-premises virtual network represents an on-premises network. In an actual deployment, it can be connected by either a VPN or Express Route connection. For simplicity, this tutorial uses a VPN gateway connection, and an Azure-located virtual network is used to represent an on-premises network.
2727

2828
![Firewall in a hybrid network](media/tutorial-hybrid-ps/hybrid-network-firewall.png)
2929

30-
## Key requirements
30+
## Prerequisites
3131

3232
There are three key requirements for this scenario to work correctly:
3333

@@ -62,15 +62,15 @@ $GWHubpipName = "VNet-hub-GW-pip"
6262
$GWIPconfNameHub = "GW-ipconf-hub"
6363
$ConnectionNameHub = "hub-to-Onprem"
6464
65-
# Variables for the spoke VNet
65+
# Variables for the spoke virtual network
6666
6767
$VnetNameSpoke = "VNet-Spoke"
6868
$SNnameSpoke = "SN-Workload"
6969
$VNetSpokePrefix = "10.6.0.0/16"
7070
$SNSpokePrefix = "10.6.0.0/24"
7171
$SNSpokeGWPrefix = "10.6.1.0/24"
7272
73-
# Variables for the OnPrem VNet
73+
# Variables for the on-premises virtual network
7474
7575
$VNetnameOnprem = "Vnet-Onprem"
7676
$SNNameOnprem = "SN-Corp"
@@ -93,62 +93,62 @@ Create a resource group to contain all the resources required for this tutorial:
9393
New-AzureRmResourceGroup -Name $RG1 -Location $Location1
9494
```
9595

96-
## Create and configure the firewall hub Vnet
96+
## Create and configure the firewall hub virtual network
9797

98-
Define the subnets to be included in the VNet:
98+
Define the subnets to be included in the virtual network:
9999

100100
```azurepowershell
101101
$FWsub = New-AzureRmVirtualNetworkSubnetConfig -Name $SNnameHub -AddressPrefix $SNHubPrefix
102102
$GWsub = New-AzureRmVirtualNetworkSubnetConfig -Name $SNnameGW -AddressPrefix $SNGWHubPrefix
103103
```
104104

105-
Now, create the firewall hub VNet:
105+
Now, create the firewall hub virtual network:
106106

107107
```azurepowershell
108108
$VNetHub = New-AzureRmVirtualNetwork -Name $VNetnameHub -ResourceGroupName $RG1 `
109109
-Location $Location1 -AddressPrefix $VNetHubPrefix -Subnet $FWsub,$GWsub
110110
```
111111

112-
Request a public IP address to be allocated to the VPN gateway you will create for your VNet. Notice that the *AllocationMethod* is **Dynamic**. You cannot specify the IP address that you want to use. It's dynamically allocated to your VPN gateway.
112+
Request a public IP address to be allocated to the VPN gateway you will create for your virtual network. Notice that the *AllocationMethod* is **Dynamic**. You cannot specify the IP address that you want to use. It's dynamically allocated to your VPN gateway.
113113

114114
```azurepowershell
115115
$gwpip1 = New-AzureRmPublicIpAddress -Name $GWHubpipName -ResourceGroupName $RG1 `
116116
-Location $Location1 -AllocationMethod Dynamic
117117
```
118118

119-
## Create and configure the spoke Vnet
119+
## Create and configure the spoke virtual network
120120

121-
Define the subnets to be included in the spoke VNet:
121+
Define the subnets to be included in the spoke virtual network:
122122

123123
```azurepowershell
124124
$Spokesub = New-AzureRmVirtualNetworkSubnetConfig -Name $SNnameSpoke -AddressPrefix $SNSpokePrefix
125125
$GWsubSpoke = New-AzureRmVirtualNetworkSubnetConfig -Name $SNnameGW -AddressPrefix $SNSpokeGWPrefix
126126
```
127127

128-
Create the spoke VNet:
128+
Create the spoke virtual network:
129129

130130
```azurepowershell
131131
$VNetSpoke = New-AzureRmVirtualNetwork -Name $VnetNameSpoke -ResourceGroupName $RG1 `
132132
-Location $Location1 -AddressPrefix $VNetSpokePrefix -Subnet $Spokesub,$GWsubSpoke
133133
```
134134

135-
## Create and configure the OnPrem VNet
135+
## Create and configure the on-premises virtual network
136136

137-
Define the subnets to be included in the VNet:
137+
Define the subnets to be included in the virtual network:
138138

139139
```azurepowershell
140140
$Onpremsub = New-AzureRmVirtualNetworkSubnetConfig -Name $SNNameOnprem -AddressPrefix $SNOnpremPrefix
141141
$GWOnpremsub = New-AzureRmVirtualNetworkSubnetConfig -Name $SNnameGW -AddressPrefix $SNGWOnpremPrefix
142142
```
143143

144-
Now, create the OnPrem VNet:
144+
Now, create the on-premises virtual network:
145145

146146
```azurepowershell
147147
$VNetOnprem = New-AzureRmVirtualNetwork -Name $VNetnameOnprem -ResourceGroupName $RG1 `
148148
-Location $Location1 -AddressPrefix $VNetOnpremPrefix -Subnet $Onpremsub,$GWOnpremsub
149149
```
150150

151-
Request a public IP address to be allocated to the gateway you will create for the VNet. Notice that the *AllocationMethod* is **Dynamic**. You cannot specify the IP address that you want to use. It's dynamically allocated to your gateway.
151+
Request a public IP address to be allocated to the gateway you will create for the virtual network. Notice that the *AllocationMethod* is **Dynamic**. You cannot specify the IP address that you want to use. It's dynamically allocated to your gateway.
152152

153153
```azurepowershell
154154
$gwOnprempip = New-AzureRmPublicIpAddress -Name $GWOnprempipName -ResourceGroupName $RG1 `
@@ -157,7 +157,7 @@ Request a public IP address to be allocated to the gateway you will create for t
157157

158158
## Configure and deploy the firewall
159159

160-
Now deploy the firewall into the hub VNet.
160+
Now deploy the firewall into the hub virtual network.
161161

162162
```azurepowershell
163163
# Get a Public IP for the firewall
@@ -193,9 +193,9 @@ Set-AzureRmFirewall -AzureFirewall $Azfw
193193

194194
## Create and connect the VPN gateways
195195

196-
The hub and OnPrem VNets are connected via VPN gateways.
196+
The hub and on-premises virtual networks are connected via VPN gateways.
197197

198-
### Create a VPN gateway for the hub VNet
198+
### Create a VPN gateway for the hub virtual network
199199

200200
Create the VPN gateway configuration. The VPN gateway configuration defines the subnet and the public IP address to use.
201201

@@ -206,15 +206,15 @@ Create the VPN gateway configuration. The VPN gateway configuration defines the
206206
-Subnet $subnet1 -PublicIpAddress $gwpip1
207207
```
208208

209-
Now create the VPN gateway for the hub VNet. VNet-to-VNet configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.
209+
Now create the VPN gateway for the hub virtual network. Network-to-network configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.
210210

211211
```azurepowershell
212212
New-AzureRmVirtualNetworkGateway -Name $GWHubName -ResourceGroupName $RG1 `
213213
-Location $Location1 -IpConfigurations $gwipconf1 -GatewayType Vpn `
214214
-VpnType RouteBased -GatewaySku basic
215215
```
216216

217-
### Create a VPN gateway for the OnPrem VNet
217+
### Create a VPN gateway for the on-premises virtual network
218218

219219
Create the VPN gateway configuration. The VPN gateway configuration defines the subnet and the public IP address to use.
220220

@@ -225,7 +225,7 @@ $gwipconf2 = New-AzureRmVirtualNetworkGatewayIpConfig -Name $GWIPconfNameOnprem
225225
-Subnet $subnet2 -PublicIpAddress $gwOnprempip
226226
```
227227

228-
Now create the VPN gateway for the OnPrem VNet. VNet-to-VNet configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.
228+
Now create the VPN gateway for the on-premises virtual network. Network-to-network configurations require a RouteBased VpnType. Creating a VPN gateway can often take 45 minutes or more, depending on the selected VPN gateway SKU.
229229

230230
```azurepowershell
231231
New-AzureRmVirtualNetworkGateway -Name $GWOnpremName -ResourceGroupName $RG1 `
@@ -235,7 +235,7 @@ New-AzureRmVirtualNetworkGateway -Name $GWOnpremName -ResourceGroupName $RG1 `
235235

236236
### Create the VPN connections
237237

238-
Now you can create the VPN connections between the hub and OnPrem gateways
238+
Now you can create the VPN connections between the hub and on-premises gateways
239239

240240
#### Get the VPN gateways
241241

@@ -246,14 +246,14 @@ $vnetOnpremgw = Get-AzureRmVirtualNetworkGateway -Name $GWOnpremName -ResourceGr
246246

247247
#### Create the connections
248248

249-
In this step, you create the connection from the hub VNet to the OnPrem VNet. You'll see a shared key referenced in the examples. You can use your own values for the shared key. The important thing is that the shared key must match for both connections. Creating a connection can take a short while to complete.
249+
In this step, you create the connection from the hub virtual network to the on-premises virtual network. You'll see a shared key referenced in the examples. You can use your own values for the shared key. The important thing is that the shared key must match for both connections. Creating a connection can take a short while to complete.
250250

251251
```azurepowershell
252252
New-AzureRmVirtualNetworkGatewayConnection -Name $ConnectionNameHub -ResourceGroupName $RG1 `
253253
-VirtualNetworkGateway1 $vnetHubgw -VirtualNetworkGateway2 $vnetOnpremgw -Location $Location1 `
254254
-ConnectionType Vnet2Vnet -SharedKey 'AzureA1b2C3'
255255
```
256-
Create the OnPrem to hub VNet connection. This step is similar to the previous one, except you create the connection from Vnet-Onprem to VNet-hub. Make sure the shared keys match. The connection will be established after a few minutes.
256+
Create the on-premises to hub virtual network connection. This step is similar to the previous one, except you create the connection from VNet-Onprem to VNet-hub. Make sure the shared keys match. The connection will be established after a few minutes.
257257

258258
```azurepowershell
259259
New-AzureRmVirtualNetworkGatewayConnection -Name $ConnectionNameOnprem -ResourceGroupName $RG1 `
@@ -278,9 +278,9 @@ After the cmdlet finishes, view the values. In the following example, the connec
278278
"egressBytesTransferred": 4142431
279279
```
280280

281-
## Peer the hub and spoke VNets
281+
## Peer the hub and spoke virtual networks
282282

283-
Now peer the spoke and hub VNets.
283+
Now peer the hub and spoke virtual networks.
284284

285285
```azurepowershell
286286
# Peer hub to spoke
@@ -298,7 +298,7 @@ Next, create a couple routes:
298298
- A default route from the spoke subnet through the firewall IP address
299299

300300
> [!NOTE]
301-
> Azure Firewall learns your on-premise networks using BGP. This may include a default route, which will route Internet traffic back through your on-premise network. If instead you want Internet traffic to be sent directly from the firewall to the Internet, add a user-defined default route (0.0.0.0/0) on the AzureFirewallSubnet with next hop type **Internet**. Your on-premise destined traffic is still forced-tunneled through the VPN/ExpressRoute gateway using the more specific routes learned from BGP.
301+
> Azure Firewall learns your on-premises networks using BGP. This may include a default route, which will route Internet traffic back through your on-premises network. If instead you want Internet traffic to be sent directly from the firewall to the Internet, add a user-defined default route (0.0.0.0/0) on the AzureFirewallSubnet with next hop type **Internet**. Your on-premises destined traffic is still forced-tunneled through the VPN/ExpressRoute gateway using the more specific routes learned from BGP.
302302
303303
```azurepowershell
304304
#Create a route table
@@ -359,11 +359,11 @@ Set-AzureRmVirtualNetwork
359359

360360
## Create virtual machines
361361

362-
Now create the spoke workload and OnPrem virtual machines, and place them in the appropriate subnets.
362+
Now create the spoke workload and on-premises virtual machines, and place them in the appropriate subnets.
363363

364364
### Create the workload virtual machine
365365

366-
Create a virtual machine in the spoke VNet, running IIS, with no public IP address, and allows pings in.
366+
Create a virtual machine in the spoke virtual network, running IIS, with no public IP address, and allows pings in.
367367
When prompted, type a user name and password for the virtual machine.
368368

369369
```azurepowershell
@@ -411,9 +411,9 @@ Set-AzureRmVMExtension `
411411
-SettingString '{"commandToExecute":"powershell New-NetFirewallRule –DisplayName “Allow ICMPv4-In” –Protocol ICMPv4"}' `
412412
-Location $Location1--->
413413

414-
### Create the OnPrem virtual machine
414+
### Create the on-premises virtual machine
415415

416-
This is a simple virtual machine that you can connect to using Remote Desktop to the public IP address. From there, you can then connect to the OnPrem server through the firewall. When prompted, type a user name and password for the virtual machine.
416+
This is a simple virtual machine that you can connect to using Remote Desktop to the public IP address. From there, you can then connect to the on-premises server through the firewall. When prompted, type a user name and password for the virtual machine.
417417

418418
```azurepowershell
419419
New-AzureRmVm `
@@ -434,23 +434,23 @@ First, get and note the private IP address for **VM-spoke-01** virtual machine.
434434
$NIC.IpConfigurations.privateipaddress
435435
```
436436

437-
1. From the Azure portal, connect to the **VM-Onprem** virtual machine.
437+
From the Azure portal, connect to the **VM-Onprem** virtual machine.
438438
<!---2. Open a Windows PowerShell command prompt on **VM-Onprem**, and ping the private IP for **VM-spoke-01**.
439439
440440
You should get a reply.--->
441-
2. Open a web browser on **VM-Onprem**, and browse to http://\<VM-spoke-01 private IP\>
441+
Open a web browser on **VM-Onprem**, and browse to http://\<VM-spoke-01 private IP\>.
442442

443-
You should see the Internet Information Services default page.
443+
You should see the Internet Information Services default page.
444444

445-
3. From **VM-Onprem**, open a remote desktop to **VM-spoke-01** at the private IP address.
445+
From **VM-Onprem**, open a remote desktop to **VM-spoke-01** at the private IP address.
446446

447-
Your connection should succeed, and you should be able to sign in using your chosen username and password.
447+
Your connection should succeed, and you should be able to sign in using your chosen username and password.
448448

449449
So now you have verified that the firewall rules are working:
450450

451451
<!---- You can ping the server on the spoke VNet.--->
452-
- You can browse web server on the spoke VNet.
453-
- You can connect to the server on the spoke VNet using RDP.
452+
- You can browse web server on the spoke virtual network.
453+
- You can connect to the server on the spoke virtual network using RDP.
454454

455455
Next, change the firewall network rule collection action to **Deny** to verify that the firewall rules work as expected. Run the following script to change the rule collection action to **Deny**.
456456

@@ -469,15 +469,6 @@ You can keep your firewall resources for the next tutorial, or if no longer need
469469

470470
## Next steps
471471

472-
In this tutorial, you learned how to:
473-
474-
> [!div class="checklist"]
475-
> * Set up the network environment
476-
> * Configure and deploy the firewall
477-
> * Create the routes
478-
> * Create the virtual machines
479-
> * Test the firewall
480-
481472
Next, you can monitor the Azure Firewall logs.
482473

483474
> [!div class="nextstepaction"]

0 commit comments

Comments
 (0)