Deploy and configure Azure Firewall
This tutorial will guide you through the process to deploy and configure Azure Firewall. Controlling outbound network access is a critical component of a comprehensive network security strategy. You could, for example, want to restrict access to certain websites. You could also wish to restrict access to outgoing IP addresses and ports.
Set up the network
To begin, build a resource group to hold the resources required for the firewall deployment. Create a VNet, subnets, and a test server after that.
Creating a resource group
All of the tutorial’s resources are housed in the resource group.
- Sign in to the Azure portal.
- On the Azure portal menu, select Resource groups or search for and select Resource groups from any page. Then select Add.
- For Resource group name, enter Test-FW-RG.
- Also, For Subscription, select your subscription.
- For Resource group location, select a location. All other resources that you create must be in the same location.
- Select Create.
Deploy the firewall
Install the firewall within the VNet.
- On the Azure portal menu or from the Home page, select Create a resource.
- Type firewall in the search box and press Enter.
- Select Firewall and then select Create.
- On the Create a Firewall page, use the following table to configure the firewall:TABLE 2SettingValueSubscription<your subscription>Resource groupTest-FW-RGNameTest-FW01LocationSelect the same location that you used previouslyChoose a virtual networkUse existing: Test-FW-VNPublic IP addressAdd new
Name: fw-pip - Select Review + create.
- Review the summary, and then select Create to create the firewall.This will take a few minutes to deploy.
- After deployment completes, go to the Test-FW-RG resource group, and select the Test-FW01 firewall.
- Note the firewall private and public IP addresses. You’ll use these addresses later.
Creating a default route
Configure the outbound default route for the Workload-SN subnet to go via the firewall.
- On the Azure portal menu, select All services or search for and select All services from any page.
- Under Networking, select Route tables.
- Select Add.
- For Name, type Firewall-route.
- Then, For Subscription, select your subscription.
- For Resource group, select Test-FW-RG.
- Also, For Location, select the same location that you used previously.
- Select Create.
- Select Refresh, and then select the Firewall-route route table.
- Also, Select Subnets and then select Associate.
- Select Virtual network > Test-FW-VN.
- For Subnet, select Workload-SN. Make sure that you select only the Workload-SN subnet for this route, otherwise your firewall won’t work correctly.
- Select OK.
- Select Routes and then select Add.
- For Route name, type fw-dg.
- For Address prefix, type 0.0.0.0/0.
- Also, For Next hop type, select Virtual appliance.Azure Firewall is actually a managed service, but virtual appliance works in this situation.
- For Next hop address, type the private IP address for the firewall that you noted previously.
- Select OK.
Configuring an application rule
This is the application rule that enables access to www.google.com from outside the network.
- Open the Test-FW-RG, and select the Test-FW01 firewall.
- On the Test-FW01 page, under Settings, select Rules.
- Select the Application rule collection tab.
- Select Add application rule collection.
- For Name, type App-Coll01.
- Subsequently, For Priority, type 200.
- For Action, select Allow.
- Under Rules, Target FQDNs, for Name, type Allow-Google.
- Also, For Source type, select IP address.
- For Source, type 10.0.2.0/24.
- Furthermore, For Protocol:port, type http, https.
- For Target FQDNS, type
www.google.com
- Select Add.
Configure a network rule
This is the network rule that permits two IP addresses to access port 53 outward (DNS).
- Select the Network rule collection tab.
- Select Add network rule collection.
- For Name, type Net-Coll01.
- Also, For Priority, type 200.
- For Action, select Allow.
- Under Rules, IP addresses, for Name, type Allow-DNS.
- For Protocol, select UDP.
- For Source type, select IP address.
- Also, For Source, type 10.0.2.0/24.
- For Destination type select IP address.
- Also, For Destination address, type 209.244.0.3,209.244.0.4These are public DNS servers operated by CenturyLink.
- For Destination Ports, type 53.
- Select Add.
Configure a DNAT rule
Through the firewall, you may connect a remote desktop to the Srv-Work virtual machine using this rule.
- Select the NAT rule collection tab.
- Select Add NAT rule collection.
- For Name, type rdp.
- For Priority, type 200.
- Under Rules, for Name, type rdp-nat.
- For Protocol, select TCP.
- Also, For Source type, select IP address.
- For Source, type *.
- Furthermore, For Destination address, type the firewall public IP address.
- For Destination Ports, type 3389.
- Also, For Translated address, type the Srv-work private IP address.
- For Translated port, type 3389.
- Select Add.
Test the firewall
Now test the firewall to make sure it’s working properly.
- Connect a remote desktop to firewall public IP address and sign in to the Srv-Work virtual machine.
- Open Internet Explorer and browse to
https://www.google.com
. - Select OK > Close on the Internet Explorer security alerts.You should see the Google home page.
- Browse to
https://www.microsoft.com
.You should be blocked by the firewall.
So now you’ve verified that the firewall rules are working:
- You can browse to the one allowed FQDN, but not to any others.
- You can resolve DNS names using the configured external DNS server.
Clean up resources
Keep your firewall resources for the next instruction, or destroy the Test-FW-RG resource group to remove any firewall-related resources if they are no longer needed.
Reference documentation – Tutorial: Deploy and configure Azure Firewall using the Azure portal