Converting Configurations to Code

Let's take a look at how to create a holistic application-like system from independently configured network devices.

We'll cover the following

Extracting information

The goal is to transform the network from a series of interconnected but unrelated and independently configured devices to a holistic application-like system. Start by collecting relevant data from the existing network. Abstract meaningful data from the configurations and then convert it into a model. The network should follow a standard core, distribution, and access layer architecture. A solid IP address plan should already exist, and the network should adhere to some basic standards. If the network is built on these foundations, converting it to code is quite simple.

We should note that if the network is chaotic in nature and lacks basic standards, it may be easier to start from scratch and approach it as a greenfield. Standards and conventions can be enforced using automation. Start by developing models and templates and address the lack of standards on the network as a starting point. Remember garbage-in, garbage-out.

Meaningful data

If the network is relatively standardized, collect the running-configurations from the core, a distribution switch, and an access switch. Try to find devices that represent a standard deployment that can be modeled after and templated from. Extract and separate the important information from the configuration commands. The important information will become variables that go into data models, and the configuration commands will go into templates. Meaningful data can include:

  • Standard global configuration information such as AAA information, QoS policies, SNMP information, Logging information, NTP information, and Archive information.

  • Hostname

  • VLAN information

  • SVI information

  • VRF information

  • Routing (OSPF, EIGRP, static routes) information

  • Default gateway

  • Access control lists

  • Physical and virtual interface standards such as VLAN, IP Address, Voice VLAN, STP toolkit settings, Power over Ethernet (PoE) settings, QoS settings, 802.1x or port security settings, and Trunk or access port settings.

Get hands-on with 1200+ tech skills courses.