Category: junos-automation

Fetching JUNOS config as xml

If you want to fetch a junos device config remotely first configure netconf on the device via; junos#set system services netconf ssh junos#commit Then connect to the junos device (IP 192.168.1.1) via an ssh client from a linux host and redirect the output to a file which is the xml config of the device indeed:
Read More »

Simple Junos Commit Script

Here is a simple junos commit script that checks if a given interface is assigned to trust zone or not. It is very basic of course but can be extended using junos automation reference documents. /* basic-sanity-check.slax */ version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; import "../import/junos.xsl"; match
Read More »