Subcommands
Subcommands are available from within the scope of some commands. When you enter a subcommand level, the command prompt changes to indicate the name of the current command scope. For example, after entering:
config system fortiguard
the command prompt becomes:
(fortiguard)#
Applicable subcommands are available until you exit the command, or descend an additional level into another subcommand. Subcommand scope is indicated by indentation.
For example, the edit subcommand is only available in commands that affects tables, and the next subcommand is available only in the edit subcommand:
config system interface
edit port1
set status up
next
end
The available subcommands vary by command. From a command prompt under the config command, subcommands that affect tables and fields could be available.
next
The next command is used to maintain a hierarchy and flow to CLI commands. It is at the same indentation level as the preceding edit command, to mark where a table entry finishes.
The following example shows the next command used in the subcommand entries:
config application list
edit default
config entries
edit 1
set action pass
next
After configuring table entry <1> then entering next, the <1> table entry is saved and the console returns to the entries prompt:
(entries) #
You can now create more table entries as needed, or enter end to save the table and return to the default table element prompt.
end
The end command is used to maintain a hierarchy and flow to CLI commands.
The following example shows the same command and subcommand as the next command example, except end has been entered instead of next after the subcommand:
config application list
edit default
config entries
edit 1
set action pass
end
Entering end will save the <1> table entry and the table, and exit the entries subcommand entirely. The console returns to the default table element prompt:
(default) #
Table subcommands
|
edit <table_row> |
Create or edit a table value. In objects such as security policies, For example, to create a new firewall policy, enter the following commands: config firewall policy
edit 0
...
next
end
To edit an existing policy, enter the following commands: config firewall policy
edit 27
...
next
end
The |
|
delete <table_row> |
Delete a table value. For example, to delete firewall policy 27, enter the following commands: config firewall policy
delete 27
end
|
|
purge |
Clear all table values. The |
|
move |
Move an ordered table value. In the firewall policy table, this is equivalent to dragging a policy into a new position. It does not change the policy's ID number. For example, to move policy 27 to policy 30, enter the following commands: config firewall policy
move 27 to 30
end
The |
|
clone <table_row> to <table_row> |
Make a clone of a table entry. For example, to create firewall policy 30 as a clone of policy 27, enter the following commands: config firewall policy
clone 27 to 30
end
The |
|
rename <table_row> to <table_row> |
Rename a table entry. For example to rename an administrator from Fry to Leela, enter the following commands: config system admin
rename Fry to Leela
end
The |
|
get |
List the current table entries. For example, to view the existing firewall policy table entries, enter the following commands: config firewall policy
get
|
|
show |
Show the configuration. Only table entries that are not set to default values are shown. |
|
end |
Save the configuration and exit the current |
|
|
Purging the |
Field subcommands
|
set <field> <value> |
Modify the value of a field. For example, the command |
|
unset |
Set the field to its default value. |
|
clear |
Clear all the options from a multi-option table value. |
|
get |
List the configuration of the current table entry, including default and customized values. |
|
show |
Show the configuration. Only values that are not set to default values are shown. |
|
next |
Save changes to the table entry and exit the |
|
abort |
Exit the command without saving. |
|
end |
Save the configuration and exit the current |