Description
By configuring port enforcement checks in application control, blocking applications running on non-standard TCP/IP ports is possible.
This article describes this feature.
Scope
FortiGate.
Solution
Most networking applications run on specific ports. For example, SSH runs on port 22, and Facebook runs on ports 80 and 443.
If the default network service is enabled in the Application Control profile, a port enforcement check is done at the application profile level, and any detected application signatures running on a non-standard TCP/IP port are blocked. This means that each application allowed by the app control sensor is only run on its default port.
To set a port enforcement, check from the CLI:
config application list
edit "default_port"
set enforce-default-app-port {enable | disable}
config entries
edit 1
set application 15896
set action pass
next
end
next
end
For example, when applying the above application control profile, FTP traffic with the standard port (port 21) is allowed, while the non-standard port (port 2121) is blocked.
To set the port enforcement, check from the GUI:
It is also essential to understand the distinction between this feature and the 'Network protocol enforcement feature' (NPE). The NPE feature does not block the application running on a non-default port, such as SSH running on port 222. The NPE feature is used to just enforce or bind the services, such as SSH, to the known port, such as 22.
To illustrate this, configure the port '22' with FTP instead of SSH as shown below.
With this configuration in place, while attempting to do SSH on port 22, the action should be blocked as shown below.
For more information about Network protocol enforcement, refer to Network protocol enforcement - FortiGate 7.6.3 administration guide.
For policy based mode, refer to Add option to set application default port as a service port - FortiGate 7.2.0 new features.
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.