Cisco IOS XR CLI Basics: Command Modes and Show Commands - 夜莺博客

Cisco IOS XR CLI Basics: Command Modes and Show Commands

Cisco IOS XR runs on ASR 9000, CRS and NCS routers with a distributed architecture, and its CLI differs from classic IOS in important ways: configuration is commit-based, the router runs secure domain routers (SDRs), and the prompt identifies the exact node (RP/0/RSP0/CPU0). This guide covers the IOS XR command modes, how to navigate and commit configuration, and the show commands used for day-to-day operations and troubleshooting.

IOS XR Command Modes

Mode Prompt Purpose
EXEC RP/0/RSP0/CPU0:router# show and clear commands for an SDR
Administration EXEC RP/0/RSP0/CPU0:router(admin)# system-wide resources, SDRs
Global configuration RP/0/RSP0/CPU0:router(config)# configure an SDR
Interface configuration RP/0/RSP0/CPU0:router(config-if)# interface-specific settings

Navigating and Committing Configuration

RP/0/RSP0/CPU0:router# configure
RP/0/RSP0/CPU0:router(config)# hostname R1
RP/0/RSP0/CPU0:router(config)# commit
RP/0/RSP0/CPU0:router(config)# end

Unlike classic IOS, changes in IOS XR take effect only after commit. Uncommitted changes can be discarded with abort, and previous commits can be rolled back by commit ID - see our IOS XR commit and rollback guide for details.

Common Show Commands

RP/0/RSP0/CPU0:router# show version
RP/0/RSP0/CPU0:router# show platform
RP/0/RSP0/CPU0:router# show interfaces
RP/0/RSP0/CPU0:router# show running-config
RP/0/RSP0/CPU0:router# show logging
RP/0/RSP0/CPU0:router# show memory
RP/0/RSP0/CPU0:router# show inventory

show version reports the IOS XR release; show platform lists linecards and their state; show interfaces shows interface counters and drops; show logging displays syslog messages with severity levels.

Configuring Basic Features

RP/0/RSP0/CPU0:router(config)# domain name cisco.com
RP/0/RSP0/CPU0:router(config)# domain name-server 8.8.8.8
RP/0/RSP0/CPU0:router(config)# logging 10.1.1.1
RP/0/RSP0/CPU0:router(config)# logging console emergencies
RP/0/RSP0/CPU0:router(config)# commit

Logging can be sent to console, terminal, buffer or a syslog server, each with its own severity threshold (emergencies through debugging).

Troubleshooting Basics

RP/0/RSP0/CPU0:router# ping 10.1.1.2
RP/0/RSP0/CPU0:router# traceroute 10.1.1.2
RP/0/RSP0/CPU0:router# show tech-support
RP/0/RSP0/CPU0:router# show processes blocked
RP/0/RSP0/CPU0:router# show processes cpu

show tech-support collects a large amount of system information for TAC analysis; show processes blocked/cpu identifies stuck or CPU-hungry processes in the distributed architecture.

Related articles: Cisco IOS XR configuration management and Cisco Nexus NX-OS VLAN and trunk configuration.

原文链接:https://www.cisco.com/en/US/docs/ios_xr_sw/Beta_R3.4/gs34book.pdf