In this recipe, we’ll explore the PyEZ framework and the facilities it provides for manipulating the configuration on JUNOS devices. We’ll create an PyEZ application, pyez-edit-prefix-list.py, that can manipulate a named prefix-list on a JUNOS device. The prefix-list list might be part of an advanced routing protocol policy configuration which we won’t attempt to configure, but we’ll provide the ability to add and remove prefixes from the prefix-list, using a command line interface like this:
Command line argument |
Description |
-h |
Offers brief help text |
-t router |
IP address of JUNOS router to target |
-a prefix/len |
Prefix to add to the list |
-d prefix/len |
Prefix to delete from the list |
-l prefix-list |
Name of the prefix-list |
-p port |
Connects to NETCONF-over-SSH using a specified... |