O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

Our Python script starts up and scans the command line argument for options that influence its behaviour. We allow the user to specify the parameters associated with username, port number, and target router address. We also grant the user access to a -f switch—to force the update of a particular prefix-list.

Once established, the script scans the JUNOS device looking for any prefix-list objects in the policy-options hierarchy that are named with the SUFFIX denoted at the top of the file. We've chosen an initial default value of .auto for this.

For every matching prefix-list found, the script will call upon bgpq3—specified by name using the runtime constant IRRTOOL, in case the full pathname needs to be provided—in order to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required