ON THIS PAGE
Juniper Junos Configlet Interface-Level Example on 4.0.2: gigether-options
Juniper Junos Configlet Example on 4.0.2: MTU (section Interface-Level: Delete)
Juniper Junos Configlet Example on 4.0.2 Example: SNMP (multiple sections)
Juniper Junos Configlet Example on 4.0.1 and 4.0.0: NTP (section SYSTEM)
Arista EOS Configlet Example: Interface Speed (section INTERFACE)
Enterprise SONiC Configlet Example: Static Route (section FRR)
Enterprise SONiC Configlet Example: sonic-cli Commands (section SYSTEM)
Configlet Examples (Design)
Juniper Junos Configlet Interface-Level Example on 4.0.2: gigether-options
When you're creating an interface-level configlet during the design phase, you won't
know interface names. It's not until you're working in the blueprint that you'll
have that information. Interface-level configlets for Junos are designed for you to
enter details without including the set interface
command. For
example, to change Junos interface "gigether-options", you can use a interface-level
hierarchical or set configlet.
gigether-options no-auto-negotiation gigether-options fec none
gigether-options { no-auto-negotiation; fec none; }
When you import the configlet into your blueprint, you'll specify interfaces such as
xe-0/0/0
. For a Junos Interface-Level set configlet Apstra
software will prepend the set commands:
set interfaces xe-0/0/0 gigether-options no-auto-negotiation set interfaces xe-0/0/0 gigether-options fec none
For a Junos Interface-Level hierarchical configlet Apstra software will load Junos structured configuration:
interfaces { xe-0/0/0 { gigether-options { no-auto-negotiation; fec none; } } }
Juniper Junos Configlet Example on 4.0.2: MTU (section Interface-Level: Delete)
If you want to use a Junos interface-level configlet to remove an existing
configuration, you can use an interface level delete configlet. Like the interface
level set configlet, when you are creating the configlet during the design phase,
you won't know interface names. It's not until you're working in the blueprint that
you'll have that information. Interface-level delete configlets for Junos are
designed for you to enter details without including the delete
interface
command. For example, to remove the Junos interface "mtu"
configuration.
mtu
When you import the configlet into your blueprint, you'll specify interfaces such as
xe-0/0/0
. For a Junos Interface-Level delete configlet Apstra
software will prepend the delete commands:
delete interfaces xe-0/0/0 mtu
Juniper Junos Configlet Example on 4.0.2 Example: SNMP (multiple sections)
You can create a configlet with a generator at the Top-Level to enable SNMP. To avoid
SNMP alarms on server-facing interfaces, for example, you can create a second
generator at the Interface-Level to set up no-traps
.
Top-Level template text is validated to begin with ‘set’ or ‘delete’. See below for example text.
set snmp community public authorization read-only set snmp description “this is configlet test” set snmp location “Apstra DC” set snmp contact “june at juniper dot net” set snmp trap-group authentication-traps targets 10.0.10.1 set snmp trap-group authentication-traps targets 192.168.15.27 set snmp trap-group authentication-traps categories authentication
Interface-Level template text is not validated because it's not a complete CLI command. See below for example text.
no-traps
When you import the configlet into your blueprint, you'll specify interfaces such as
ex-0/0/0
and Apstra software will prepend the set command as
.
set interface xe-0/0/0 no-traps
Juniper Junos Configlet Example on 4.0.1 and 4.0.0: NTP (section SYSTEM)
Sample text for configuring NTP servers on Junos devices. (On Apstra version 4.0.2 SYSTEM is called Top-Level/Hierarchical.)
system { ntp { boot-server 10.1.4.1; server 10.1.4.2; } }
Cisco NX-OS Configlet Example: Syslog (section SYSTEM)
Sample text for configuring Syslog on NX-OS devices.
logging server 192.168.0.30 logging facility local3 logging trap warning
no logging server 192.168.0.30 no logging facility local3 no logging trap warning
Arista EOS Configlet Example: NTP (section SYSTEM)
Sample text for configuring NTP servers on EOS devices. This configlet uses property sets for the NTP server IP addresses.
ntp server {{NTP_SERVER_1}} ntp server {{NTP_SERVER_2}}
no ntp server {{NTP_SERVER_1}} no ntp server {{NTP_SERVER_2}}
Arista EOS Configlet Example: Interface Speed (section INTERFACE)
Sample text for applying 'speed auto' to an interface. (You specify devices and interfaces when you import the configlet into a blueprint.)
speed auto
no speed auto
Enterprise SONiC Configlet Example: NTP (section SYSTEM)
Sample text for using the config
command to set up an NTP server to
use mgmt VRF on SONiC devices.
sonic-db-cli CONFIG_DB hset 'NTP |global' vrf mgmt config ntp add {{ntp_server}}
config ntp del {{ntp_server}}
Enterprise SONiC Configlet Example: SNMP (section SYSTEM)
Sample text for using the config
command to set up an SNMP snmptrap
to use mgmt VRF on SONiC devices.
config snmptrap modify 2 {{SNMP_SERVER}} -v mgmt -c mypass
config snmptrap del 2
Enterprise SONiC Configlet Example: Syslog (section SYSTEM)
Sample text for using the config
command to set the Syslog server
for SONiC devices.
config syslog add {{syslog_host}}
config syslog del {{syslog_host}}
Enterprise SONiC Configlet Example: Static Route (section FRR)
Sample text for adding a static route
ip route 4.2.2.2/32 {{static_route_next_hop}} ip route 4.2.2.3/32 {{static_route_next_hop}}
Enterprise SONiC Configlet Example: sonic-cli Commands (section SYSTEM)
Sample text for using the sonic-cli
command to set up the
delay-restore
option for SONiC mclag
. You must
use sudo -u admin
at the beginning, and surround terms that
contain spaces with single quotes
in each sonic-cli command, and
< /dev/console
at the end.
sudo -u admin sonic-cli -c config -c 'mclag domain 1' -c 'delay-restore 600' < /dev/console
sudo -u admin sonic-cli -c config -c 'mclag domain 1' -c 'no delay-restore' < /dev/console