Example: Generating a Transient Change
Using a commit script, make a transient configuration change that sets PPP encapsulation on all SONET/SDH interfaces with the IPv4 protocol family enabled:
<?xml version="1.0" standalone="yes"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:junos="http://xml.juniper.net/junos/*/junos"xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm"xmlns:jcs="http://xml.juniper.net/junos/commit-scripts/1.0"><xsl:import href="../import/junos.xsl"/><xsl:template match="configuration"><xsl:for-each select="interfaces/interface[starts-with(name, 'so-') and unit/family/inet]"><xsl:call-template name="jcs:emit-change"><xsl:with-param name="tag" select="'transient-change'"/><xsl:with-param name="content"><encapsulation>ppp</encapsulation></xsl:with-param></xsl:call-template></xsl:for-each></xsl:template></xsl:stylesheet>Verifying the Commit Script Output
To display a detailed trace of commit script processing, issue the
commit check | display detailcommand:user@host#commit check | display detail2005-06-14 12:07:30 PDT: reading commit script configuration2005-06-14 12:07:30 PDT: testing commit script configuration2005-06-14 12:07:30 PDT: opening commit script '/var/db/scripts/commit/transient.xsl'2005-06-14 12:07:30 PDT: reading commit script 'transient.xsl'2005-06-14 12:07:30 PDT: running commit script 'transient.xsl'2005-06-14 12:07:30 PDT: processing commit script 'transient.xsl'2005-06-14 12:07:30 PDT: no errors from transient.xsl2005-06-14 12:07:30 PDT: saving commit script changes2005-06-14 12:07:30 PDT: summary: changes 0, transients 2 (allowed), syslog 02005-06-14 12:07:30 PDT: no commit script changes2005-06-14 12:07:30 PDT: exporting juniper.conf2005-06-14 12:07:30 PDT: loading transient changes2005-06-14 12:07:30 PDT: loading commit script changes(transient)2005-06-14 12:07:30 PDT: finished loading commit script changes2005-06-14 12:07:30 PDT: expanding groups2005-06-14 12:07:30 PDT: finished expanding groups2005-06-14 12:07:30 PDT: setup foreign files2005-06-14 12:07:30 PDT: propagating foreign files2005-06-14 12:07:31 PDT: complete foreign files2005-06-14 12:07:31 PDT: daemons checking new configurationconfiguration check succeedsTo display the configuration with the transient change, issue the
show interfaces | display commit-scriptsconfiguration mode command. If there are one or more SONET/SDH interfaces with the IPv4 protocol family enabled, the output is similar to this:user@host#show interfaces | display commit-scripts... #Other configured interface types...so-1/2/3 {mtu 576;encapsulation ppp; /* Added by transient change. */unit 0 {family inet {address 10.0.0.3/32;}}}so-1/2/4 {encapsulation ppp; /* Added by transient change. */unit 0 {family inet {address 10.0.0.4/32;}}}so-2/3/4 {encapsulation cisco-hdlc; #Not affected by this script, because IPv4 protocol#family is not configured on this interface.unit 0 {family mpls;}}...# Other configured interface types...