How to Use Azure Gateway Load Balancer for Secure and High-Performance Networking

Author

Reads 1K

Network rack
Credit: pexels.com, Network rack

Using an Azure Gateway Load Balancer can be a game-changer for your networking setup, providing a secure and high-performance way to manage traffic.

To get started, you need to create a public IP address, which will serve as the front door to your load balancer. This is where the magic happens, and you can create a public IP address in the Azure portal or using the Azure CLI.

By default, the Azure Gateway Load Balancer is set to use the standard SKU, which is suitable for most use cases. However, if you need more advanced features, you can upgrade to the basic SKU, which provides additional features like increased scalability and higher throughput.

The Azure Gateway Load Balancer also supports multiple protocols, including HTTP, HTTPS, and TCP, making it a versatile solution for a wide range of applications.

Configuration

The Azure Gateway Load Balancer configuration is where you get to define how your traffic is routed. This is where you'll decide which protocol to use for your load balancing, and Azure supports both HTTP and HTTPS.

You can choose between two routing methods: Rule-Based Routing and Path-Based Routing. Rule-Based Routing uses a set of rules to determine which backend pool to send traffic to, while Path-Based Routing uses the URL path to determine routing.

Deploy on VNet

Credit: youtube.com, Azure Hub and Spoke Virtual Network (VNet) with a VPN Gateway

To deploy Azure Gateway Load Balancer on a VNet, you'll need to create a standalone cluster with multiple Network Virtual Appliances (NVAs) behind it.

You can simplify the deployment process by using Terraform scripts from vmisson/terraform-azure-gwlb-palo-alto (github.com).

Update the allow_inbound_mgmt_ips variable in the variables.tf file with your public IP to get started.

After running Terraform, you'll have the necessary infrastructure ready to use in a few minutes.

To inspect and secure traffic, you don't need to route it like you would for a "normal" load balancer, but instead use chaining.

A Standard Public Load balancer or a Standard IP configuration of a virtual machine can be chained to a Gateway Load Balancer, and once chained, no extra configuration is needed to ensure traffic to and from the application endpoint is sent to the Gateway Load Balancer.

Manage IP Overlapping

Managing IP overlapping is a common problem that can be solved using Azure Gateway Load Balancer. This solution allows you to deploy independent application environments with the same IP range without compromising security.

Credit: youtube.com, How to Solve for Overlapping IP Addresses - On the Brightboard

IP address exhaustion is another issue that can be addressed with Azure Gateway Load Balancer. You can provide security in a central firewall cluster while still allowing for independent application environments.

Having multiple AKS clusters can be costly and difficult to manage, but using one Azure Gateway Load Balancer in front of multiple AKS clusters can limit these costs. This solution can also extend to multiple AKS clusters using kubnet.

Associate to ILPIP

To associate a Gateway Load Balancer (GWLB) to ILPIP, navigate to the "vm-consumer-nic" in the preview portal.

You'll need to associate the frontend of the GWLB created in the previous section, which is 10.0.0.4 in this case.

Provider is sharable across Consumers, so you can associate the GWLB to multiple NICs or LBs if needed.

If you have multiple NICs or LBs to associate the GWLB to, repeat the same step for each one.

Just remember to save the changes after associating the GWLB to each NIC or LB.

Configure NVA

Credit: youtube.com, Azure Networking, User Defined Routes, and Network Virtual Appliances

To configure your Network Virtual Appliance (NVA), you'll need to spawn a process that responds to Health Probes from the Load Balancer, specifically 168.63.129.16. This process is crucial as it will allow the Load Balancer to recognize whether the backend servers are alive.

The key is to create a process or daemon that responds to Health Probes, which is a non-standard task for a GWLB setup. You won't be able to use Azure Monitor Metrics to check the status, so an alternative method is necessary.

One way to do this is by checking the socket status within the NVA. This will provide a reliable way to ensure the Load Balancer can communicate with the backend servers.

Here's a step-by-step guide to get you started:

  1. Spawn a process that responds to Health Probes from the Load Balancer (168.63.129.16)
  2. Create two VXLAN interfaces for Internal and External data paths and make sure the kernel forwards packets between the interfaces

Design Factors

Design Factors play a crucial role in load balancing, and it's essential to consider the unique needs of each organization and application.

Global presence is a significant factor, as it can impact the load balancing design, particularly for businesses with a large international customer base.

Credit: youtube.com, System Design Configuration and integration Case Study

Load balancing needs vary between applications, and some applications may require more complex designs than others.

Local presence is also a key consideration, as it can affect the performance and accessibility of applications for users in specific geographic locations.

The web protocol layer is another primary factor that can influence load balancing design, with different protocols requiring different approaches to ensure efficient and reliable traffic distribution.

Backend Pool

A backend pool is essentially a collection of virtual machines that can be added to your Azure gateway load balancer to distribute traffic.

You can add network virtual appliances to the backend pool by deploying them through the Azure Marketplace.

Once deployed, simply go to the backend pools tab of your gateway load balancer to add the virtual machines.

Manage Active-Active Firewall Cluster

Managing an active-active firewall cluster can be a challenge, but Azure Gateway Load Balancer has made it easier.

You only need one Load Balancer to manage both inbound and outbound traffic, eliminating the need to manage flow symmetry.

Credit: youtube.com, Active/Active Cluster and Asymmetric Routing on a PaloAlto Networks Firewall.

Configuring an active-active firewall in Azure can sometimes be complicated, but Azure Gateway Load Balancer has been designed to simplify this process.

With Azure Gateway Load Balancer, you can deploy independent application environments with the same IP range, providing security in a central firewall cluster.

This solution can be extended to multiple AKS clusters using kubnet, limiting the cost and management of multiple firewall clusters.

One Azure Gateway Load Balancer in front of multiple AKS clusters can make it easier to manage and reduce costs.

Subnet Extension

Subnet Extension is a crucial aspect of Backend Pool configuration. It involves creating two virtual interfaces with VXLAN type, corresponding to Internal and External VXLAN Tunnels.

These tunnels allow NVAs to inspect packets transparently, making "bump in the wire" type ingestion possible. This is done by forwarding packets without any routing (L3) considerations on the Consumer side.

To achieve this, you need to create two virtual interfaces with VXLAN type corresponding to Internal/External VXLAN Tunnels. This will enable packets to pass back and forth between the interfaces.

With this setup, you can see overlay packets directly with tcpdump by using the interfaces. This is a great way to inspect and analyze packets in real-time.

Add Virtual Appliances to Backend Pool

Credit: youtube.com, Create 2 Machines, create Load Balancer, Adding Virtual Machines in Backend pool By SNIT Training

To add network virtual appliances to the backend pool of your gateway load balancer, deploy them through the Azure Marketplace. Once deployed, you can add the NVA virtual machines to the backend pool.

You can add the virtual machines by going to the backend pools tab of your gateway load balancer. This is a straightforward process that allows you to easily integrate your NVAs with the load balancer.

To chain a VM's NIC IP configuration to the gateway load balancer, you'll need to have a public IP address assigned to the virtual machine first. This is a crucial step that ensures the chaining process can proceed smoothly.

Here's a step-by-step guide to chaining the NIC configuration:

  1. Go to the Virtual machines section in the Azure portal and select the virtual machine you want to add to the gateway load balancer.
  2. Select the virtual machine, then go to the Networking section in Settings.
  3. In the Networking section, select the name of the network interface attached to the virtual machine.
  4. Go to the IP configurations section in Settings and select the lb-frontend-IP in Gateway Load balancer.
  5. Click Save to complete the process.

Frontend

To set up a frontend for your Azure gateway load balancer, you'll need to chain it to the frontend of a standard load balancer. This involves adding the frontend to the frontend IP of an existing load balancer in your subscription.

Credit: youtube.com, Microsoft Azure Gateway Load Balancer Deep Dive

In the Azure portal, navigate to Load balancer and select your load balancer or its name. Then, go to the load balancer page and select Frontend IP configuration in Settings.

The frontend IP of the load balancer is where you'll focus your attention. Select the frontend IP of the load balancer, in this case, lb-frontend-IP (10.1.0.4).

To complete the setup, select lb-frontend-IP (10.1.0.4) in the pull-down box next to Gateway load balancer and then click Save.

Features and Comparison

Azure Application Gateway offers a range of features that make it a powerful tool for managing network traffic and optimizing content delivery.

One of the key features of Azure Application Gateway is its support for SSL/TLS termination, which allows encryption to be handled at the gateway, making it easier to secure connections to backend servers.

Azure Application Gateway also supports autoscaling, which means it can dynamically scale up or down based on changing traffic patterns, eliminating the need to specify a deployment size or instance count during provisioning.

Credit: youtube.com, Azure Gateway Load Balancer

The gateway also offers zone redundancy, which provides enhanced fault resiliency by allowing it to span multiple Availability Zones.

Here's a comparison of Azure Load Balancer and Application Gateway:

Azure Application Gateway is designed for web apps and APIs, making it a great choice for scenarios that require advanced routing and security features.

Features

Azure Application Gateway offers a range of features that make it a powerful tool for managing network traffic and optimizing content delivery.

SSL/TLS termination is supported, allowing encryption to be handled at the gateway, while traffic typically flows unencrypted to backend servers.

Autoscaling is available for the Standard_v2 version of Application Gateway, dynamically scaling up or down based on changing traffic patterns.

Zone Redundancy provides enhanced fault resiliency, eliminating the need to provision separate gateways in each zone.

A Web Application Firewall (WAF) is integrated into Application Gateway, offering centralized protection against common web application exploits and vulnerabilities.

Credit: youtube.com, 2021 Firewall Review, Feature Comparison and Recommendations

The Application Gateway Ingress Controller (AGIC) enables the use of Application Gateway as the ingress for Azure Kubernetes Service (AKS) clusters.

URL-Based Routing allows the routing of traffic to backend server pools based on the URL paths of incoming requests.

Multiple-Site Hosting supports the configuration of routing based on hostname or domain name for multiple web applications on the same gateway.

Here are some key features of Azure Application Gateway:

Redirection is also supported, allowing incoming requests to be sent from HTTP to HTTPS or to a specific pool of web servers.

Session Affinity keeps a user session on the same server, directing subsequent traffic from the same user session to the corresponding server for processing.

Azure Load Balancer, on the other hand, is active on Layer 4 and can be deployed as an external or internal IP address load balancer.

It exists in two different flavors — basic and standard — with the basic option being a free service and the standard option requiring a monthly consumption cost.

Comparison Between

Computer server in data center room
Credit: pexels.com, Computer server in data center room

Azure Load Balancer and Application Gateway are two popular load balancing services offered by Azure. Azure Load Balancer operates at Layer 4 (TCP/UDP) and supports any TCP/UDP protocol.

Azure Application Gateway, on the other hand, operates at Layer 7 (HTTP/HTTPS) and specifically supports HTTP/HTTPS protocols.

Routing methods differ between the two services, with Azure Load Balancer using IP address and port, and Azure Application Gateway using URL path, host headers, and cookies.

Azure Load Balancer offers basic TCP/HTTP checks for health probes, whereas Azure Application Gateway provides advanced HTTP/HTTPS health checks.

SSL offloading is available in Azure Application Gateway, but not in Azure Load Balancer.

Azure Application Gateway also includes a Web Application Firewall with OWASP rulesets, which is not available in Azure Load Balancer.

Autoscaling is manual in Azure Load Balancer, but automatic based on load in Azure Application Gateway.

Both services offer zone redundancy, but it's only available in the v2 SKU for Azure Application Gateway.

Computer server in data center room
Credit: pexels.com, Computer server in data center room

Here's a comparison of the two services in a table:

The cost of Azure Load Balancer is lower compared to Azure Application Gateway, especially considering its advanced capabilities are not included in the former.

Frequently Asked Questions

What are gateway load balancers?

Gateway load balancers distribute traffic across multiple virtual appliances, scaling them up or down as needed to meet demand. They provide a single gateway for easy management and deployment of third-party virtual appliances.

Thomas Goodwin

Lead Writer

Thomas Goodwin is a seasoned writer with a passion for exploring the intersection of technology and business. With a keen eye for detail and a knack for simplifying complex concepts, he has established himself as a trusted voice in the tech industry. Thomas's writing portfolio spans a range of topics, including Azure Virtual Desktop and Cloud Computing Costs.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.