Important Links:
- Starting Point - Cisco DevNet Portal: http://developer.cisco.com
- Get access to Cisco hardware for free - Cisco Sandboxes: http://devnetsandbox.cisco.com
- johann Network Monitoring Tool only with Device APIs: https://github.com/flopach/johann-network-device-monitoring
- Explore YANG models with Cisco YANG Suite: https://github.com/CiscoDevNet/yangsuite/
Open text editor, save as hello-world-py
:
print("hello world!")
Run in terminal: python hello-world.py
You don't have Python installed? Use it online: https://www.programiz.com/python-programming/online-compiler/ (it's not possible to install additional packages via pip)
Talk with a REST API via Python. Check the script simple-requests.py
.
Download Cisco Postman collections to use offline or use them online (Postman account required for online use).
- Use Postman or other API tools to get network device data.
DNA Center 2.2 (always on sandbox):
- https://sandboxdnac.cisco.com
- username: devnetuser
- password: Cisco123!
Steps:
- Authenticate with username + password to get a token
- Use the token for every API call: Insert it in the header with
x-auth-token
hosts file
#Example Ansible hosts File
#ansible_user -> IOS username
#[floor1] -> name of the group
[all:vars]
ansible_user=developer
ansible_network_os=ios
ansible_connection=network_cli
[floor1]
10.10.20.81
10.10.20.82
10.10.20.83
playbook-change-vlan-int.yaml
---
- name: configure Vlan interface
hosts: all
gather_facts: no
tasks:
- ios_config:
lines:
- description configured via ios_config module
- ip address 192.168.100.1 255.255.255.0
before: interface Vlan10
Run the playbook on the hosts:
ansible-playbook playbook-change-vlan-int.yaml
Toolsets:
- Use the Python scripts:
restconf-getting-started.py
restconf-get-all-interfaces.py
restconf-create-loopback.py
(does not work with always-on sandbox, needs to be reserved)
IOS XE (always on sandbox):
- CSR1000v Host: sandbox-iosxe-latest-1.cisco.com
- SSH Port: 22
- NETCONF Port: 830
- gRPC Telemetry Port: 57500
- RESTCONF Port: 443 (HTTPS)
- Username: developer
- Password: C1sco12345
- Use Postman or the Python script
netconf-getting-started.py
to get information directly from the device.
IOS XE (always on sandbox):
- CSR1000v Host: sandbox-iosxe-latest-1.cisco.com
- SSH Port: 22
- NETCONF Port: 830
- gRPC Telemetry Port: 57500
- RESTCONF Port: 443 (HTTPS)
- Username: developer
- Password: C1sco12345