Firewall Overview

A firewall is an optional layer of security for your subnets. After you associate one or more subnets with a firewall, you can control traffic in and out of the subnets.

Figure 1 shows how a firewall works.

Figure 1 Security groups and firewalls

Similar to security groups, firewalls control access to subnets and add an additional layer of defense to your subnets. Security groups only have the "allow" rules, but firewalls have both "allow" and "deny" rules. You can use firewalls together with security groups to implement comprehensive and fine-grained access control.

Differences Between Security Groups and Firewalls summarizes the basic differences between security groups and firewalls.

Firewall Basics

Default Firewall Rules

By default, each firewall has preset rules that allow the following packets:

Rule Priorities

Application Scenarios

Configuration Procedure

Figure 2 shows the procedure for configuring a firewall.

Figure 2 firewall configuration procedure
  1. Create a firewall by following the steps described in Creating a Firewall.
  2. Add firewall rules by following the steps described in Adding a Firewall Rule.
  3. Associate subnets with the firewall by following the steps described in Associating Subnets with a Firewall. After subnets are associated with the firewall, the subnets will be protected by the configured firewall rules.