Deploy and configure Azure Firewall
Create a resource group
- Sign in to the Azure portal at https://portal.azure.com.
- On the Azure portal menu, select Resource groups or search for and select Resource groups from any page. Then select Create.
- For Subscription, select your subscription.
- For Resource group name, type Test-FW-RG.
- For Resource group location, select a location. All other resources that you create must be in the same location.
- Select Review + create.
- Select Create.
Create a VNet
- On the Azure portal menu or from the Home page, select Create a resource.
- Select Networking > Virtual network.
- For Subscription, select your subscription.
- For Resource group, select Test-FW-RG.
- For Name, type Test-FW-VN.
- For Region, select the same location that you used previously.
- Select Next: IP addresses.
- For IPv4 Address space, accept the default 10.0.0.0/16.
- Under Subnet name, select default.
- For Subnet name change it to AzureFirewallSubnet. The firewall will be in this subnet, and the subnet name must be AzureFirewallSubnet.
- For Address range, change it to 10.0.1.0/26.
- Select Save.Next, create a subnet for the workload server.
- Select Add subnet.
- For Subnet name, type Workload-SN.
- For Subnet address range, type 10.0.2.0/24.
- Select Add.
- Select Review + create.
- Select Create.
Create a virtual machine
- On the Azure portal menu or from the Home page, select Create a resource.
- Select Windows Server 2019 Datacenter.
- Enter these values for the virtual machine:
Setting Value Resource group Test-FW-RG Virtual machine name Srv-Work Region Same as previous Image Windows Server 2019 Datacenter Administrator user name Type a user name Password Type a password - Under Inbound port rules, Public inbound ports, select None.
- Accept the other defaults and select Next: Disks.
- Accept the disk defaults and select Next: Networking.
- Make sure that Test-FW-VN is selected for the virtual network and the subnet is Workload-SN.
- For Public IP, select None.
- Accept the other defaults and select Next: Management.
- For Boot diagnostics, select Disable to disable boot diagnostics. Accept the other defaults and select Review + create.
- Review the settings on the summary page, and then select Create.
- After the deployment is complete, select Srv-Work and note the private IP address that you’ll need to use later.
Deploy the firewall
- 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:
Setting Value Subscription <your subscription> Resource group Test-FW-RG Name Test-FW01 Region Select the same location that you used previously Firewall tier Standard Firewall management Use Firewall rules (classic) to manage this firewall Choose a virtual network Use existing: Test-FW-VN Public IP address Add new
Name: fw-pip - Accept the other default values, then 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.
Create a default route
When creating a route for outbound and inbound connectivity through the firewall, a default route to 0.0.0.0/0 with the virtual appliance private IP as a next hop is sufficient. This will take care of any outgoing and incoming connections to go through the firewall. As an example, if the firewall is fulfilling a TCP-handshake and responding to an incoming request, then the response is directed to the IP address who sent the traffic. This is by design.
As a result, there is no need create an additional UDR to include the AzureFirewallSubnet IP range. This may result in dropped connections. The original default route is sufficient.
For the Workload-SN subnet, configure the outbound default route to go through the firewall.
- On the Azure portal menu, select Create a resource.
- Under Networking, select Route table.
- For Subscription, select your subscription.
- For Resource group, select Test-FW-RG.
- For Region, select the same location that you used previously.
- For Name, type Firewall-route.
- Select Review + create.
- Select Create.
After deployment completes, select Go to resource.
- On the Firewall-route page, 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 destination, select IP Addresses.
- For Destination IP addresses/CIDR ranges, type 0.0.0.0/0.
- 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 Add.
Configure an application rule
- Open the Test-FW-RG, and select the Test-FW01 firewall.
- On the Test-FW01 page, under Settings, select Rules (classic).
- Select the Application rule collection tab.
- Select Add application rule collection.
- For Name, type App-Coll01.
- For Priority, type 200.
- For Action, select Allow.
- Under Rules, Target FQDNs, for Name, type Allow-Google.
- For Source type, select IP address.
- For Source, type 10.0.2.0/24.
- For Protocol:port, type http, https.
- For Target FQDNS, type
www.google.com
- Select Add.
Configure a network rule
- Select the Network rule collection tab.
- Select Add network rule collection.
- For Name, type Net-Coll01.
- 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.
- For Source, type 10.0.2.0/24.
- For Destination type select IP address.
- For Destination address, type 209.244.0.3,209.244.0.4These are public DNS servers operated by Level3.
- For Destination Ports, type 53.
- Select Add.
Configure a DNAT 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.
- For Source type, select IP address.
- For Source, type *.
- For Destination address, type the firewall public IP address.
- For Destination Ports, type 3389.
- For Translated address, type the Srv-work private IP address.
- For Translated port, type 3389.
- Select Add.
Change the primary and secondary DNS address for the Srv-Work network interface
- On the Azure portal menu, select Resource groups or search for and select Resource groups from any page. Select the Test-FW-RG resource group.
- Select the network interface for the Srv-Work virtual machine.
- Under Settings, select DNS servers.
- Under DNS servers, select Custom.
- Type 209.244.0.3 in the Add DNS server text box, and 209.244.0.4 in the next text box.
- Select Save.
- Restart the Srv-Work virtual machine.
Test the firewall
- Connect a remote desktop to the 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.
Tag:Azure