IOS CLI Commands
Overview
The netapi ios command group provides access to Cisco IOS/IOS-XE devices via SSH (Netmiko).
| Category | Description | Protocol |
|---|---|---|
Show commands, operational data |
SSH |
|
Configuration changes |
SSH |
|
Jinja2 configuration templates |
SSH |
Quick Reference
# Show commands
netapi ios exec "show version"
netapi ios exec "show interfaces status"
netapi ios exec "show access-session"
# Configuration
netapi ios config "interface GigabitEthernet1/0/1" "description Server Port"
# Template-based config
netapi ios apply-template dot1x-port.j2 --vars interface=Gi1/0/1
Environment Setup
# Via dsource
eval "$(dsource d000 dev/network)"
# Or manual
export IOS_HOST=10.193.144.124
export IOS_USER=admin
export IOS_PASS='SwitchPassword!'
Common Show Commands
# 802.1X/MAB status
netapi ios exec "show access-session"
netapi ios exec "show access-session interface Gi4/0/11 detail"
# RADIUS servers
netapi ios exec "show radius servers"
# AAA configuration
netapi ios exec "show aaa servers"
# Interface status
netapi ios exec "show interfaces status"
# MAC address table
netapi ios exec "show mac address-table"