Skip to main content
FortiKoala
Staff
Staff
Oct 9, 2018 1:41 PM UTC

Technical Tip: Using Flex CLI for Network Access Policies

  • Apr 16, 2026 1:15 PM UTC
  • 0 replies
  • 1116 views
  • Translate All

Description

 

This article describes the variables that can be used in a Network Access Policy Flex CLI  (%port% %vlan% %ip% %mac%) is dependent upon whether the CLI configuration is set to Port Based or Host Based in the Model Configuration of the switch.   
 

Scope

 

FortiNAC.

Solution

 

To verify:
  1. Log in to the Administration UI and navigate to Network Devices -> Inventory.
  2. 'Right-click' on the model and select Model Configuration.

 

The following table shows what variables can be used for each type (Port Based vs Host Based):
 
CLI Configuration Valid Variable Options
 
Substitution Data              Port Based DO commands         Port based UNDO commands        Host Based DO commands        Host Based UNDO commands
 
%port%                             Yes                                                      Yes                                                          Yes                                                   No
%vlan%                             Yes                                                      Yes                                                          Yes                                                   No
%ip%                                 No                                                       No                                                           Yes                                                   Yes
%mac%                             No                                                       No                                                           Yes                                                   Yes
 
 
Based on the above chart, a Flex CLI that is needed to do the following command would require that the switch's Model Configuration be set for Host Based CLI
because it uses all 4 variables in the DO section (%port% %vlan% %ip% %mac%).

 
config t
ip source binding %macXXXX.XXXX.XXXX% vlan %vlan% %ip%  interface %port%
end
wr mem
 
For more information refer to the CLI Configuration from the Administration guide.
 
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024