Submit a ticketCall us

AnnouncementsTHWACKcamp 2018 is here

2018 is the seventh year for THWACKcamp™, and once again we’ll be live October 17 – 18 with packed session tracks covering everything from network monitoring and management, to change control, application management, storage, cloud and DevOps, security, automation, virtualization, mapping, logging, and more.

Register for online sessions.

Home > Success Center > Network Configuration Manager (NCM) > NCM - Knowledgebase Articles > Download Multi Context Configs for Cisco ASA or Cisco FWSM

Download Multi Context Configs for Cisco ASA or Cisco FWSM

Table of contents

Updated September 20th, 2016

Overview

This procedure only applies to network devices that have multiple context with individual running configurations, and the IP address is not able to be added to NCM as a separate node.

Environment

All versions of NCM prior to NCM 7.4.x  For NCM 7.4 and after Click Here

Steps


  1. In Settings>NCM Settings>Configs , add a new Config Type for each context (for example Context1, Context2).

  1. Specify in your device template, how to switch to each context (see example below).
  2.  ${ConfigType} macro in the Reset Command.
  3. specify the RegEx value in the Reset command. Depending on your prompt settings, the value should be '#', '>', ']', etc.
  4. Avoid using ${ConfigType} macro in the DownloadConfig command. Make sure the command is the right one, e.g. "show configuration", "show running-config" and so forth.
  5. In the Command line defining the Context \ Config Type, defining the command, the Context name is case sensitive
  6. The actual command may be different on different platforms. In this example, it is for a FWSM or an ASA with Multiple Contexts
  7. Because we have to flip logic in NCM to allow the changing of prompts, only able to receive either the running config or the startup config can be gathered for any context, to include the admin.

 

Device Template Example:

<Command Name="RESET" Value="${ConfigType}" RegEx="#" />

<Command Name="Context1" Value="command to switch to Context1"  />

<Command Name="Context2" Value="command to switch to Context2 "/>

<Command Name="DownloadConfig" Value="show configuration"/>

*** Note***

In the example above, the Words Context1 and Context2 need to be replaced with the actual Context  name as defined when creating the customized config type created in NCM.

Best practice would be the Config Type would be the actual Context name on the devices. 

 

Explanation:

When NCM downloads a configuration, the first command issued is the ‘Reset’ command defined in the device template.

The ${ConfigType} macros will be replaced by the appropriate switch context command, based on the config type selected for the dowload.

The context will be dynamically switched before the download command is executed.

When the context is changed, so is the prompt. In order to recognize the prompt, a regular expression (RegEx) must be used to ignore the variable part of the prompt.

 

Example:

Let’s assume the command mode prompt after login is : ASA#

  • After switching to Context1, the command mode prompt becomes ASA-Context1#.
  • After switching to Context2, the command mode prompt becomes ASA-Context2#.

The RegEx to use in the reset command should match the common portion of the prompt in both contexts. In this example this could be RegEx="#".

 

Last modified

Tags

Classifications

Public