Skip to content

tomaskubina/csnog2022

Repository files navigation

CSNOG 2022

This repository contains slides shared at CSNOG 2022 conference. It also contains several Python3 source code files to demonstrate way how to work with NETCONF and gNMI API by using Python libraries.

Package ncclient was used for NETCONF testing and gNMI was used for gNMI protocol testing.

How to use this repository

  1. Install client libraries:
$ pip3 install -r requirements.txt
  1. Enter folder with NETCONF or gNMI examples and select folder with scripts per OS platform. For example:
$ cd netconf_examples/iosxr
  1. Open script based on RPC call type, change IP & port number and OS type if needed. Also update when needed content of request based on your network topology. For NETCONF connection, modify parameters in connect() function:
with manager.connect(host='192.168.243.21',
                     port=830,
                     username='username',
                     password='password',
                     hostkey_verify=False,
                     device_params={'name': 'iosxr'}) as session:

For gNMI connection, modify parameters in gNMIclient() constructor and host variable:

host = ('192.168.243.21', '50001')

with gNMIclient(target=host, username='username', password='password', insecure=True, debug=0) as session:
  1. Enable NETCONF / gNMI on your device following vendor documentation.
  2. Run script.
$ python3 get_full_config.py
  1. Enjoy data from your device! And test other RPC calls for NETCONF or gNMI.

About

Materials shared during CSNOG 2022

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages