ciscoconfparse Logo
1.9

Contents:

  • Introduction
  • History and Python Apologetic
  • CiscoConfParse Installation and Python Basics
  • CiscoConfParse Tutorial
    • CiscoConfParse Fundamentals: Using Parent / Child Relationships
    • Getting Config Values with CiscoConfParse
    • Example Usage: A Contrived Configuration Audit
    • Example Usage: Build configuration diffs
  • CiscoConfParse Legacy Syntax
  • syntax and factory intro
  • syntax
  • syntax=’ios’
  • syntax=’nxos’
  • syntax=’iosxr’
  • syntax=’asa’
  • factory
  • API
ciscoconfparse
  • CiscoConfParse Tutorial
  • View page source

CiscoConfParse Tutorial

This tutorial will cover the features that most CiscoConfParse users care about. We make a couple of assumptions throughout this tutorial…

  • You already know Python

  • You (naturally) have a basic understanding of Cisco IOS

Contents:

  • CiscoConfParse Fundamentals: Using Parent / Child Relationships
    • IOS Parent-child relationships
    • IOSCfgLine objects
      • Example: Retrieving text from an IOSCfgLine object
    • Baseline configuration for these examples
    • Example Usage: Finding interface names that match a substring
    • Example Usage: Finding parents with a specific child
      • Method 1: for-loop to iterate over objects and search children
      • Method 2: list-comprehension to iterate over objects and search children
      • Method 3: find_parent_objects()
    • Example Usage: Finding parents without a specific child
  • Getting Config Values with CiscoConfParse
    • re_match_typed(): Get a value from an object
    • re_match_iter_typed(): Iterate over all children and get a value
    • Getting multiple values from an interface with re_match_typed()
  • Example Usage: A Contrived Configuration Audit
  • Example Usage: Build configuration diffs
    • Baseline Configurations
      • bucksnort_before.conf
      • bucksnort_after.conf
    • Diff Script
    • Rollback Script
Previous Next

© Copyright 2007-2024, David Michael Pennington <mike /at\ pennington [dot] net>. Last updated on Feb 13, 2024.

Built with Sphinx using a theme provided by Read the Docs.