Octet

Automation and SDN

0 of 39 nailed

Cisco IOS7

netconf-yang
Enables the NETCONF server on IOS-XE (SSH on TCP 830) with the YANG models of that release.
netconf-yang feature candidate-datastore
Adds a candidate datastore to IOS-XE NETCONF, so edits are validated and committed as one transaction.
restconf
Enables RESTCONF on IOS-XE. It also needs ip http secure-server and a user that AAA authorizes at privilege 15.
show netconf-yang sessions
Lists open NETCONF sessions with session ID, transport, user, source host and any global datastore locks.
show platform software yang-management process
Shows whether the IOS-XE programmability processes (confd, ncsshd for NETCONF, nginx for RESTCONF and others) are running.
show telemetry ietf subscription all
Lists configured and dynamic model-driven telemetry subscriptions with their ID, type and state.
show telemetry ietf subscription 101 receiver
Shows the collector address, port and protocol for subscription 101 and whether the connection is up.

NX-OS1

feature nxapi
Enables NX-API on NX-OS so it accepts CLI and JSON-RPC requests over HTTP or HTTPS.

Arista EOS2

show version | json
Returns command output as structured JSON instead of text. NX-OS supports the same pipe.
management api http-commands
Enters eAPI configuration on Arista EOS. Add no shutdown to enable the JSON-RPC API over HTTPS.

Junos4

set system services netconf ssh
Enables NETCONF over SSH on Junos, listening on port 830 by default.
show configuration interfaces | display xml
Prints the configuration as XML, which shows the exact element path to use in a NETCONF edit.
show interfaces terse | display xml rpc
Prints the NETCONF RPC that returns the same data as the CLI command, ready to use from a script.
commit confirmed 5
Commits the candidate and rolls it back after 5 minutes unless you commit again. The safety net for risky remote changes.

Linux10

ssh -p 830 netops@10.0.0.1 -s netconf
Opens a raw NETCONF session. The server answers with its hello and capability list, which proves NETCONF is up.
Example
Output
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:base:1.1</capability>
...
curl -sk -u netops -H "Accept: application/yang-data+json" https://10.0.0.1/restconf/data/ietf-interfaces:interfaces
Reads every interface through RESTCONF as JSON. curl prompts for the password; -k skips certificate checks (lab only).
pyang -f tree ietf-interfaces.yang
Prints a YANG module as a tree showing config (rw) and state (ro) nodes, list keys and optional nodes.
Example
Output
module: ietf-interfaces
  +--rw interfaces
  |  +--rw interface* [name]
  |     +--rw name                        string
  |     +--rw description?                string
gnmic -a 10.0.0.31:6030 -u netops -p secret --insecure capabilities
Asks a gNMI target for its gNMI version, supported models and encodings. --insecure means plaintext, lab only.
gnmic -a 10.0.0.31:6030 --insecure subscribe --path /interfaces/interface/state/counters
Streams interface counters over gNMI. Add --stream-mode sample --sample-interval 10s, or --stream-mode on-change for state.
git log --oneline -- data/
Short history of every commit that touched the data folder, newest first.
Example
Output
3f2a9c1 CHG1234: add VLAN 30 GUESTS to dc1 leaves
8b7d0e4 CHG1201: rename VLAN 20 to VOICE
git revert 3f2a9c1
Creates a new commit that undoes a merged change without rewriting shared history.
terraform plan -out tfplan
Compares code, state and real infrastructure, shows the changes and saves exactly that plan for terraform apply tfplan.
terraform state list
Lists every resource recorded in the Terraform state file.
Example
Output
aci_tenant.prod
ovs-ofctl dump-flows br0
Lists the OpenFlow entries in an Open vSwitch bridge with priority, match fields, actions and packet counters.

Ansible5

ansible-playbook site.yml --check --diff --limit ASW1
Dry run against one device. Shows what would change and the before and after, without changing anything.
ansible-inventory -i inventory.yml --graph
Shows the groups and hosts as Ansible sees them, including dynamic inventory such as NetBox.
ansible-doc cisco.ios.ios_vlans
Shows a module's options, states, return values and examples offline.
ansible-vault encrypt_string --stdin-name vault_netops_password
Encrypts one value typed on stdin into a block you can paste into a variables file, keeping it out of shell history.
ansible-galaxy collection install cisco.ios arista.eos junipernetworks.junos
Installs vendor collections with their network modules, resource modules and platform plugins.