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 to do it...

We're going to create a new SLAX op script called config-interfaces.slax, upload it to our JUNOS device, and then test it to see how it automates the workflow involved when configuring lots of repetitive services. In order to support the SLAX tool, we're going to augment the configuration of the physical interfaces on our JUNOS router to add information such as the adjacent provider and the available VLAN ranges that can be used.

First of all, create the SLAX op script by making a new text file in your preferred text editor and applying the source code, as described here:

  1. First of all, include the usual Juniper op script boilerplater which defines namespaces and versions.
       version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ...

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