Using the Command Line Interface (CLI)

The following topics explain how to use the command line interface (CLI) for Secure Firewall Threat Defense devices and how to interpret the command reference topics. Use the CLI for basic system setup and troubleshooting.


Note


When you deploy a configuration change using the Secure Firewall Management Center or Secure Firewall device manager, do not use the threat defense CLI for long-running commands (such as ping with a huge repeat count or size); these commands could cause a deployment failure.


Logging Into the Command Line Interface (CLI)

To log into the CLI, use an SSH client to make a connection to the management IP address. Log in using the admin username (default password is Admin123) or another CLI user account.

You can also connect to the address on a data interface if you open the interface for SSH connections. SSH access to data interfaces is disabled by default. To enable SSH access, use the device manager (management center or device manager) to allow SSH connections to specific data interfaces. You cannot SSH to the Diagnostic interface.

You can create user accounts that can log into the CLI using the configure user add command. However, these users can log into the CLI only. They cannot log into the device manager web interface. You can use the device manager to configure external authentication.

Console Port Access

In addition to SSH, you can directly connect to the Console port on the device. Use the console cable included with the device to connect your PC to the console using a terminal emulator set for 9600 baud, 8 data bits, no parity, 1 stop bit, no flow control. See the hardware guide for your device for more information about the console cable.

The initial CLI you access on the Console port differs by device type.

  • ASA hardware platforms—The CLI on the Console port is the regular threat defense CLI.

  • Other hardware platforms—The CLI on the Console port is Secure Firewall eXtensible Operating System (FXOS). You can get to the threat defense CLI using the connect command. Use the FXOS CLI for chassis-level configuration and troubleshooting only. For the Firepower 2100, you cannot perform any configuration at the FXOS CLI. Use the threat defense CLI for basic configuration, monitoring, and normal system troubleshooting. See the FXOS documentation for information on FXOS commands for the Firepower 4100 and 9300. See the FXOS troubleshooting guide for information on FXOS commands for other models.

Command Modes

The CLI on a threat defense device has different modes, which are really separate CLIs rather than sub-modes to a single CLI. You can tell which mode you are in by looking at the command prompt.

Use the exit command until you return to the regular Threat Defense CLI.

Regular Threat Defense CLI

Use this CLI for threat defense management configuration and troubleshooting.


>
Diagnostic CLI

Use this CLI for advanced troubleshooting. This CLI includes additional show and other commands, including the session wlan console command needed to enter the CLI for the wireless access point on an ASA 5506W-X. This CLI has two sub-modes; more commands are available in Privileged EXEC Mode.

To enter this mode, use the system support diagnostic-cli command in the threat defense CLI.

  • User EXEC Mode. The prompt reflects the system hostname as defined in the running configuration.

    
    firepower>
    
    
  • Privileged EXEC Mode. Enter the enable command to enter this mode (press enter without entering a password when prompted for a password). Note that you cannot set a password for this mode. Access is protected by the account login to the threat defense CLI only. However, users cannot enter configuration mode within Privileged EXEC mode, so the extra password protection is not necessary.

    
    firepower#
    
    
  • Recovery-config Configuration Mode. (7.7 and later). Enter the configure recovery-config command in privileged EXEC mode. This mode lets you make select configuration changes if you lose the management connection to your device.

    
    firepower(recovery-config)#
    
    
Expert Mode

Use Expert Mode only if a documented procedure tells you it is required, or if the Cisco Technical Assistance Center asks you to use it. The use of expert mode is unsupported under any other circumstances.

To enter this mode, use the expert command in the threat defense CLI.

The prompt is username@hostname if you log in using the admin user. If you use a different user, only the hostname is shown. The hostname is the name configured for the management interface. For example:


admin@firepower:~$


Caution


Do not use the Linux passwd command in Expert Mode to change the admin user password. This command can cause file system corruption. Only use the Regular Threat Defense CLI configure user password admin command (if you are not admin) or configure password command (if you are admin). If you don't know the password and can't log in at all, see the password recovery procedure.


FXOS CLI

With the exception of the ASA hardware models, FXOS is the operating system that controls the overall chassis. Depending on the model, you use FXOS for configuration and troubleshooting. From FXOS, you can enter the threat defense CLI using the connect command.

For all appliance-mode models (models other than the Firepower 4100/9300), you can go from the threat defense CLI to the FXOS CLI using the connect fxos command.

The FXOS command prompt looks like the following in EXEC mode, but the prompt changes when you enter submodes using the scope command. See FXOS documentation for details about FXOS CLI usage.


firepower#

Syntax Formatting

Command syntax descriptions use the following conventions:

Convention

Description

command

Command text indicates commands and keywords that you enter literally as shown.

variable

Variable text indicates arguments for which you supply values.

[x]

Square brackets enclose an optional element (keyword or argument).

[ x | y]

Square brackets enclosing keywords or arguments separated by a vertical bar indicate an optional choice.

{x | y}

Braces enclosing keywords or arguments separated by a vertical bar indicate a required choice.

[x {y | z}]

Nested sets of square brackets or braces indicate optional or required choices within optional or required elements. Braces and a vertical bar within square brackets indicate a required choice within an optional element.

Entering Commands

When you log into the CLI through the console port or an SSH session, you are presented with the following command prompt:


>

You type the command at the prompt and press Enter to execute the command. Additional features include:

  • Scrolling through command history—You can use the up and down arrow keys to scroll through the commands that you have already entered. You can reenter or edit and reenter the commands in the history.

  • Completing commands—To complete a command or keyword after entering a partial string, press the space or Tab key. The partial string must match a single command or keyword only for it to be completed.

  • Abbreviating commands—In the regular CLI, you cannot abbreviate commands. You must enter the full command string. However, in the diagnostic CLI, you can abbreviate most commands down to the fewest unique characters for a command; for example, you can enter show ver instead of show version .

  • Stopping command output—If a command produces a lot of output, you can get out of it by pressing the q key.

  • Stopping long-running commands—If a command is not returning output fast enough, and you want to try a different command, press Ctrl+C.

Filtering Show Command Output

You can filter the output of show commands by piping the output to filtering commands. Piping output works with all show commands but is most useful when dealing with commands that produce a lot of text.

To use the filtering capabilities, use the following format. In this case, the vertical bar | after the show command is the pipe character and is part of the command, not part of the syntax description. The filtering options come after the | character.

show command | {grep | include | exclude | begin} regular expression

Filtering Commands

You can use these filtering commands:

  • grep —Display only those lines that match the pattern.

  • include —Display only those lines that match the pattern.

  • exclude —Exclude all lines that match the pattern, show all other lines.

  • begin —Find the first line that includes the pattern, and display that line and all subsequent lines.

regular_expression

A regular expression, typically a simple text string. Do not enclose the expression in single or double-quotes, these will be seen as part of the expression. Also, trailing spaces will be included in the expression.

The following example shows how to change the output of the show access-list command to show only those rules that apply to the inside1_2 interface.


> show access-list | include inside1_2
access-list NGFW_ONBOX_ACL line 3 advanced trust ip ifc inside1_2 any ifc inside1_3 any rule-id 268435458 
event-log both (hitcnt=0) 0x2c7f5801 
access-list NGFW_ONBOX_ACL line 4 advanced trust ip ifc inside1_2 any ifc inside1_4 any rule-id 268435458 
event-log both (hitcnt=0) 0xf170c15b 
access-list NGFW_ONBOX_ACL line 5 advanced trust ip ifc inside1_2 any ifc inside1_5 any rule-id 268435458 
event-log both (hitcnt=0) 0xce627c77 
access-list NGFW_ONBOX_ACL line 6 advanced trust ip ifc inside1_2 any ifc inside1_6 any rule-id 268435458 
event-log both (hitcnt=0) 0xe37dcdd2 
access-list NGFW_ONBOX_ACL line 7 advanced trust ip ifc inside1_2 any ifc inside1_7 any rule-id 268435458 
event-log both (hitcnt=0) 0x65347856 
access-list NGFW_ONBOX_ACL line 8 advanced trust ip ifc inside1_2 any ifc inside1_8 any rule-id 268435458 
event-log both (hitcnt=0) 0x6d622775 
access-list NGFW_ONBOX_ACL line 9 advanced trust ip ifc inside1_3 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0xc1579ed7 
access-list NGFW_ONBOX_ACL line 15 advanced trust ip ifc inside1_4 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0x1d1a8032 
access-list NGFW_ONBOX_ACL line 21 advanced trust ip ifc inside1_5 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0xf508bbd8 
access-list NGFW_ONBOX_ACL line 27 advanced trust ip ifc inside1_6 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0xa6be4e58 
access-list NGFW_ONBOX_ACL line 33 advanced trust ip ifc inside1_7 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0x699725ea 
access-list NGFW_ONBOX_ACL line 39 advanced trust ip ifc inside1_8 any ifc inside1_2 any rule-id 268435458 
event-log both (hitcnt=0) 0xd2014e58 
access-list NGFW_ONBOX_ACL line 47 advanced trust ip ifc inside1_2 any ifc outside any rule-id 268435457 
event-log both (hitcnt=0) 0xea5bdd6e 

Command Help

Help information is available from the command line by entering the following commands:
  • ? to see a list of all commands.

  • command_name ? to see the options for a command. For example, show ? .

  • string? to show the commands or keywords that match the string. For example, n? shows all commands that start with the letter n.

  • help command_name to see the syntax and limited usage information for a command. Enter help ? to see which commands have help pages.