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 being able to use Genie to Parse, Learn and Diff our network, we can also use Genie to configure our network devices in a vendor-agnostic manner, directly via 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 NXOS device types only.

Genie Conf Examples

Let's look at an example, in which we will configure an interface on spine1-vios.

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.

$ pyats shell --testbed-file testbeds/001_external_testbed.yml
...
device_spine1 = testbed.devices["spine1-vios"]
device_spine1.connect(log_stdout=False)
Members Only Content
Join today and get access to:
  • 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
  • Monthly online meetups

100% Satisfaction Guaranteed!
Cancel your membership at any time.


Join Today
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.