Security · 4 min read

FortiGate NSE4 Lab: Implicit Deny and Why Your Permit Rule Isn't Working

FortiGate firewalls operate on a fundamental principle: if no explicit permit rule matches traffic, the traffic is denied. This implicit deny stance is a security best practice, but it trips up many NSE4 candidates and network engineers when their carefully crafted permit rules mysteriously fail to allow legitimate traffic. Understanding rule evaluation order, policy direction, and the interaction between explicit rules and implicit deny is essential for both lab success and production troubleshooting.

How Implicit Deny Works on FortiGate

Every FortiGate security policy operates within a default-deny framework. When a packet arrives at the firewall, FortiGate evaluates it against the security policy table from top to bottom. The first rule that matches the source interface, destination interface, source address, destination address, service (port and protocol), and schedule determines the action: accept, deny, or other. If no rule matches, the packet is implicitly denied and logged (if logging is enabled).

This means a permit rule that looks correct on paper may fail for several reasons: the rule sits below a conflicting deny rule, the rule is disabled, the addresses or services do not match the actual traffic, the interfaces are reversed, or the rule is associated with the wrong policy direction (inbound versus outbound on the interface pair).

Common Reasons Your Permit Rule Fails

Troubleshooting Workflow

Start by enabling detailed logging on the suspected rule. In the FortiGate CLI or GUI, set 'Log Allowed Traffic' and 'Log Denied Traffic' to on. Then generate test traffic from the source to the destination and check the FortiGate logs (Logs & Reports > Traffic Logs or CLI: diagnose debug flow trace start). Look for whether the traffic is hitting your rule or being dropped before it reaches the rule.

# Enable detailed logging for a specific policy
config firewall policy
  edit 1
    set logtraffic all
  next
end

# View traffic logs in real-time
diagnose debug flow trace start
# (generate test traffic)
diagnose debug flow trace stop

Verify that the source and destination addresses in the rule match the actual source and destination IPs of the traffic. Check that the service definition includes the correct port and protocol. If the traffic is being denied before reaching your rule, a rule higher in the policy table is matching it first; reorder your rules so that more specific deny rules sit below more specific permit rules, or combine related rules into a single policy with multiple service objects.

Best Practices for NSE4 Labs and Production

Common Port Reference
Free lookup for standard and common ports used in firewall rules and service definitions.
Open →
Practise this on today’s Daily Ops Drill — a free network task every day.
Open the app →
Free tools for this
More from the blog
Voice VLAN Bandwidth Sizing: Codec, Frame Size, and Overhead CalculationRead →CCNA Design Lab: EIGRP vs OSPF for Branch NetworksRead →