Description
This article describes how to configure a Web Filter profile in NGFW policy-mode, as well as a walkthrough for applying the Web Filter profile to a Security Policy.
Scope
FortiGate, NGFW policy-mode.
Solution
Web Filtering in NGFW policy-mode is somewhat different than the default NGFW profile-mode:
Note: Web Filter profiles were added to NGFW policy-mode as of FortiOS 6.4.2 and later (the feature was unavailable in the GUI for FortiOS 6.2 and earlier). See also: Configure web filter profiles in NGFW policy mode
As a reminder, NGFW policy-mode utilizes three stages of policies, of which Web Filtering functionality is handled within the Security Policy stage:
To create a Web Filter profile on a FortiGate in NGFW policy-mode (GUI method)
To apply a Web Filter profile to a Security Policy (GUI method)
To create a Web Filter profile on a FortiGate in NGFW policy-mode (CLI method)
Note: creating Web Filter profiles via the GUI is the recommended method to start with, as it automatically creates the Web Filter profile entry and maps it with the separate tables used for additional features (urlfilter for Static URL Filtering, content for Content Filtering, etc.)
config webfilter profile
edit 'NGFW_WebFilter'
config web
set bword-table 1
set urlfilter-table 66
end
next
end
config webfilter urlfilter
edit 66
set name 'Auto-webfilter-urlfilter_tj8dluytj'
config entries
edit 1
set url 'test.com'
set action block
next
end
next
end
config webfilter content
edit 1
set name 'Auto-webfilter-content_u1t2ga712'
config entries
edit 'gambling'
set status enable
next
edit 'news'
set status enable
next
edit 'example'
set status enable
next
end
next
end
To apply a Web Filter profile to a Security Policy (CLI method)
config firewall security-policy
edit 1
set name 'Example Security Policy'
set srcintf 'any'
set dstintf 'virtual-wan-link'
set srcaddr 'all'
set dstaddr 'all'
set action accept
set schedule 'always'
set webfilter-profile 'NGFW_WebFilter'
next
end
config firewall policy
edit 1
set name 'Default'
set srcintf 'any'
set dstintf 'any'
set srcaddr 'all'
set dstaddr 'all'
set service 'ALL'
set ssl-ssh-profile 'certificate-inspection'
next
end
config firewall central-snat-map
edit 1
set srcintf 'any'
set dstintf 'wan1'
set orig-addr 'all'
set dst-addr 'all'
next
end
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.