In this lesson, we will cover:

  • What is Genie Conf?
  • Using Genie Conf to configure an interface.
  • Validating the generated Genie Conf configuration commands.
  • Pushing configuration from Genie Conf.
  • Rolling back configuration via Genie Conf.

The scripts and code for this lesson can be found within the pyATS repo under the directory: 003_genie/conf/.

What is Genie Conf?

In addition to using Genie to Parse, Learn and Diff our network, we can also use Genie to configure our network devices in a vendor-agnostic manner. This is done directly with Python using a set of common methods. The available conf methods and the conf structure are all located within the Genie models; these are the models we previously discussed that also contain the structures used by Ops aka Genie Learn.

Note: The Op/Conf models support the IOS-XR, IOS-XE and NX-OS device types only.

Genie Conf Examples

Let's look at an example, in which we will configure an interface on `leaf1-ios`.

The documentation for this model can be located here: https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/_models/interface.pdf

First, let's jump into our Genie shell like so and connect to our device.

$ export $(cat .env) 
$ pyats shell --testbed-file testbeds/testbed.yml
...
device_leaf1 = testbed.devices["leaf1-ios"]
device_leaf1.connect(log_stdout=False)
Ready to Master Network Automation? Start Your Journey Today!
Our membership provides:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Live monthly tech sessions
  • Access to tech session library

Join Now ➜
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.