@@ -40,7 +40,7 @@ In this article, you learn how to:
4040> * Create a default route
4141> * Configure an application rule to allow access to www.google.com
4242> * Configure a network rule to allow access to external DNS servers
43- > * Deploy Azure Bastion for secure VM access
43+ > * Configure a NAT rule to allow a remote desktop to the test server
4444> * Test the firewall
4545
4646> [ !NOTE]
@@ -103,20 +103,17 @@ This virtual network has two subnets.
103103Now create the workload virtual machine, and place it in the ** Workload-SN** subnet.
104104
1051051 . On the Azure portal menu or from the ** Home** page, select ** Create a resource** .
106- 2 . Select ** Ubuntu Server 22.04 LTS ** .
106+ 2 . Select ** Windows Server 2019 Datacenter ** .
1071074 . Enter these values for the virtual machine:
108108
109109 | Setting | Value |
110110 | ---------| ---------|
111111 | Resource group | ** Test-FW-RG** |
112112 | Virtual machine name | ** Srv-Work** |
113113 | Region | Same as previous|
114- | Image| Ubuntu Server 22.04 LTS - x64 Gen2|
115- | Size| Standard_B2s|
116- | Authentication type| SSH public key|
117- | Username | ** azureuser** |
118- | SSH public key source| Generate new key pair|
119- | Key pair name| ** Srv-Work_key** |
114+ | Image| Windows Server 2019 Datacenter|
115+ | Administrator user name | Type a user name|
116+ | Password | Type a password|
120117
1211184 . Under ** Inbound port rules** , ** Public inbound ports** , select ** None** .
1221196 . Accept the other defaults and select ** Next: Disks** .
@@ -127,7 +124,6 @@ Now create the workload virtual machine, and place it in the **Workload-SN** sub
1271241 . Accept the defaults and select ** Next: Monitoring** .
1281251 . For ** Boot diagnostics** , select ** Disable** to disable boot diagnostics. Accept the other defaults and select ** Review + create** .
1291261 . Review the settings on the summary page, and then select ** Create** .
130- 1 . On the ** Generate new key pair** dialog, select ** Download private key and create resource** . Save the key file as ** Srv-Work_key.pem** .
1311271 . After the deployment is complete, select ** Go to resource** and note the ** Srv-Work** private IP address that you'll need to use later.
132128
133129[ !INCLUDE [ ephemeral-ip-note.md] ( ~/reusable-content/ce-skilling/azure/includes/ephemeral-ip-note.md )]
@@ -213,36 +209,24 @@ This is the network rule that allows outbound access to two IP addresses at port
2132091 . For ** Destination Ports** , type ** 53** .
2142102 . Select ** Add** .
215211
216- ## Deploy Azure Bastion
212+ ## Configure a DNAT rule
217213
218- Now deploy Azure Bastion to provide secure access to the virtual machine.
214+ This rule allows you to connect a remote desktop to the Srv-Work virtual machine through the firewall .
219215
220- 1 . On the Azure portal menu, select ** Create a resource** .
221- 1 . In the search box, type ** Bastion** and select it from the results.
222- 1 . Select ** Create** .
223- 1 . On the ** Create a Bastion** page, configure the following settings:
224-
225- | Setting | Value |
226- | ---------| -------|
227- | Subscription | Select your subscription |
228- | Resource group | ** Test-FW-RG** |
229- | Name | ** Test-Bastion** |
230- | Region | Same region as previous resources |
231- | Tier | ** Developer** |
232- | Virtual network | ** Test-FW-VN** |
233- | Subnet | Select ** Manage subnet configuration** |
234-
235- 1 . In the ** Subnets** page, select ** + Subnet** .
236- 1 . Configure the new subnet:
237- - ** Name** : ** AzureBastionSubnet** (this name is required)
238- - ** Subnet address range** : ** 10.0.4.0/26**
239- 1 . Select ** Save** and close the subnets page.
240- 1 . Back on the ** Create a Bastion** page, for ** Public IP address** , select ** Create new** .
241- 1 . For ** Public IP address name** , type ** Bastion-pip** .
242- 1 . Select ** Review + create** .
243- 1 . After validation passes, select ** Create** .
216+ 1 . Select the ** NAT rule collection** tab.
217+ 2 . Select ** Add NAT rule collection** .
218+ 3 . For ** Name** , type ** rdp** .
219+ 4 . For ** Priority** , type ** 200** .
220+ 5 . Under ** Rules** , for ** Name** , type ** rdp-nat** .
221+ 6 . For ** Protocol** , select ** TCP** .
222+ 7 . For ** Source type** , select ** IP address** .
223+ 8 . For ** Source** , type ** \* ** .
224+ 9 . For ** Destination address** , type the firewall public IP address.
225+ 10 . For ** Destination Ports** , type ** 3389** .
226+ 11 . For ** Translated address** , type the Srv-work private IP address.
227+ 12 . For ** Translated port** , type ** 3389** .
228+ 13 . Select ** Add** .
244229
245- The Bastion deployment takes about 10 minutes to complete.
246230
247231### Change the primary and secondary DNS address for the ** Srv-Work** network interface
248232
@@ -260,35 +244,19 @@ For testing purposes, configure the server's primary and secondary DNS addresses
260244
261245Now, test the firewall to confirm that it works as expected.
262246
263- 1 . In the Azure portal, navigate to the ** Srv-Work** virtual machine.
264- 1 . Select ** Connect** , then select ** Connect via Bastion** .
265- 1 . Select ** Use SSH Private Key from Local File** .
266- 1 . For ** Username** , type ** azureuser** .
267- 1 . Select the folder icon and browse to the ** Srv-Work_key.pem** file you downloaded earlier.
268- 1 . Select ** Connect** .
269- 1 . At the bash prompt, run the following commands to test DNS resolution:
270-
271- ``` bash
272- nslookup www.google.com
273- nslookup www.microsoft.com
274- ```
275-
276- Both commands should return answers, showing that your DNS queries are getting through the firewall.
247+ 1 . Connect a remote desktop to the firewall public IP address and sign in to the Srv-Work virtual machine.
248+ 1 . Open Internet Explorer and browse to ` https://www.google.com ` .
249+ 4 . Select ** OK** > ** Close** on the Internet Explorer security alerts.
277250
278- 1 . Run the following commands to test the application rule:
251+ You should see the Google home page.
279252
280- ``` bash
281- curl https://www.google.com
282- curl https://www.microsoft.com
283- ```
253+ 5 . Browse to ` https://www.microsoft.com ` .
284254
285- The ` www.google.com ` request should succeed, and you should see the HTML response.
286-
287- The ` www.microsoft.com ` request should fail, showing that the firewall is blocking the request.
255+ The firewall should block you.
288256
289257So now you verified that the firewall rules are working:
290258
291- * You can connect to the virtual machine using Bastion and SSH .
259+ * You can connect to the virtual machine using RDP .
292260* You can browse to the one allowed FQDN, but not to any others.
293261* You can resolve DNS names using the configured external DNS server.
294262
0 commit comments