A firewall policy is a set of rules that determine how FortiGate handles traffic between source and destination. Policies are matched sequentially from top to bottom.
Match Source and Destination Addresses:
LAN, WAN) or custom groups (e.g., Marketing Team).Example (CLI):
config firewall policy
edit 1
set srcintf "lan"
set dstintf "wan1"
set srcaddr "all"
set dstaddr "all"
end
Allow or Deny Traffic:
Apply Security Features:
Schedules:
Example (GUI):
Service Protocols:
Example (CLI):
set service "HTTPS"
Log Recording:
Example (CLI):
set logtraffic all
Using Interface IP:
Example (CLI):
set nat enable
Address Pools for Dynamic Translation:
Use an address pool to allocate IPs dynamically for outgoing traffic.
Example:
config firewall ippool
edit "mypool"
set startip 192.0.2.1
set endip 192.0.2.10
end
Assign the pool to a policy:
set ippool enable
set poolname "mypool"
Mapping External Access to Internal Servers:
Virtual IP (VIP):
Example (CLI):
config firewall vip
edit "WebServer"
set extip 203.0.113.2
set mappedip 192.168.1.10
set portforward enable
set extport 80
set mappedport 80
end
Add the VIP to a policy:
config firewall policy
edit 2
set srcintf "wan1"
set dstintf "lan"
set srcaddr "all"
set dstaddr "WebServer"
set action accept
end
Directly Configure User Accounts:
Local accounts are stored directly on the FortiGate.
GUI: User & Device > User Definition > Create New.
CLI Example:
config user local
edit "john"
set password "securepassword"
end
LDAP Server:
Used for centralized authentication (e.g., Active Directory).
Configure the LDAP server in FortiGate:
config user ldap
edit "AD_Server"
set server "192.168.1.100"
set cnid "sAMAccountName"
set dn "dc=example,dc=com"
set type regular
end
Assign it to a policy or group for user authentication.
RADIUS Server:
RADIUS supports complex network authentication and accounting.
Example:
config user radius
edit "RADIUS_Server"
set server "192.168.1.101"
set secret "radius_secret"
end
TACACS+ Server:
Secure authentication for device management.
Example:
config user tacacs+
edit "TACACS_Server"
set server "192.168.1.102"
set key "tacacs_secret"
end
Integrate with Active Directory:
Example (CLI):
config user fsso
edit "FSSO_Server"
set server "192.168.1.103"
set password "fsso_password"
end
Monitor User Status:
This detailed explanation covers the essential steps to configure firewall policies and authentication mechanisms. By mastering these, you'll be able to control network traffic securely and manage user authentication effectively.
FortiGate evaluates firewall policies in a top-down, sequential order. When a new session is initiated, FortiGate scans the list of firewall policies from the top to the bottom, and applies the first policy that matches all conditions (source, destination, service, schedule, etc.).
If no policy matches, FortiGate applies an implicit deny rule, which silently drops the traffic without generating a log entry unless explicitly configured.
Key Concept:
FortiGate evaluates policies from top to bottom. If no policy matches, traffic is denied by default.
Implications for configuration:
Understanding the difference between Policy ID and Sequence Number is important, especially in CLI management and troubleshooting.
Reflects the actual position of the policy in the policy list.
Determines the matching order (top to bottom evaluation).
Can be changed using:
GUI drag-and-drop
CLI command:
move <policy-id> before|after <other-policy-id>
Example: Even if Policy ID 25 comes after Policy ID 100, it may be higher in the evaluation order if its sequence is above in the list.
FortiGate supports multiple inspection modes and policy types, which influence how traffic is handled and scanned.
CLI Example to set inspection mode:
config firewall policy
edit 10
set inspection-mode proxy
end
Exam Note:
FortiGate allows you to create identity-based firewall policies that enforce user authentication before granting access.
config firewall policy
edit 20
set identity-based enable
config identity-based-policy
edit 1
set groups "Employees"
set service "HTTP" "HTTPS"
set action accept
next
end
end
| Topic | Key Purpose | Exam Relevance |
|---|---|---|
| Policy Matching & Implicit Deny | Controls how policies are evaluated and what happens by default | High – always testable |
| Policy ID vs. Sequence Number | Differentiates policy identification vs. matching order | Medium – especially in CLI |
| Proxy vs. Flow-based Policies | Affects inspection depth and performance trade-off | Medium – often conceptual |
| Identity-based Policies | Requires user authentication before granting access | High – common in real use |
Why might traffic be blocked even when a firewall policy appears to allow it?
Another policy higher in the policy list is matching the traffic first.
FortiGate evaluates firewall policies from top to bottom. The first policy that matches the traffic determines the action. If a deny rule or a more specific rule exists above the intended allow rule, the traffic will never reach the lower rule. Administrators frequently overlook rule ordering when troubleshooting connectivity problems. Reordering policies so that the correct rule is evaluated earlier usually resolves the issue.
Demand Score: 93
Exam Relevance Score: 95
What happens if network traffic does not match any firewall policy on a FortiGate?
The traffic is denied by the implicit deny rule.
FortiGate automatically includes a hidden implicit deny policy at the end of the firewall policy list. This rule blocks all traffic that does not match any configured policy. Because the rule is not visible in the GUI, administrators sometimes believe the firewall is malfunctioning when traffic is denied. In reality, the traffic simply failed to match any existing policy conditions such as source interface, destination address, or service.
Demand Score: 89
Exam Relevance Score: 94
Why might internal users be unable to access the internet even though a firewall policy allows the traffic?
NAT may not be enabled in the firewall policy.
When internal private IP addresses access the internet, their addresses must usually be translated to a public IP address. In FortiGate, this translation occurs when NAT is enabled on the firewall policy. If NAT is disabled, packets leave the firewall with private IP addresses that are not routable on the internet, causing the connection to fail. Many deployment troubleshooting cases occur because administrators forget to enable NAT in the policy.
Demand Score: 86
Exam Relevance Score: 90
Why might a firewall policy that includes user authentication not prompt users to log in?
User identity traffic may not be matching the authentication policy.
For authentication to trigger, the traffic must match the specific firewall policy configured with identity-based rules. If the traffic matches another policy earlier in the policy list, authentication will never occur. Additionally, authentication requires correct configuration of user groups and authentication methods such as LDAP or local users. Troubleshooting usually involves verifying policy order and checking user group configuration.
Demand Score: 80
Exam Relevance Score: 88
What is the purpose of identity-based firewall policies in FortiGate?
They allow firewall access decisions to be based on authenticated user identity instead of only IP addresses.
Traditional firewall policies rely on IP addresses, which can change or be shared between users. Identity-based policies integrate user authentication systems such as LDAP, Active Directory, or Fortinet authentication services. Once a user is authenticated, the firewall can apply policies that permit or deny traffic based on the user’s identity or group membership. This approach improves security and enables more granular access control.
Demand Score: 78
Exam Relevance Score: 87
Why is it recommended to place more specific firewall policies above general ones?
Because FortiGate processes policies sequentially from top to bottom.
Specific policies define detailed conditions such as particular users, services, or destination addresses. If a general policy appears above them, it may match traffic first and prevent the specific policy from ever being evaluated. Organizing policies from most specific to most general ensures that detailed rules take precedence. This ordering principle is frequently emphasized in troubleshooting discussions.
Demand Score: 82
Exam Relevance Score: 92