08 - Introduction To Cisco IOS XR CLI Basics - Student Learning Guide v5.0 - Word (003) - DP
08 - Introduction To Cisco IOS XR CLI Basics - Student Learning Guide v5.0 - Word (003) - DP
Part Number
Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Table of Contents
Overview
FrontMatter-Chapter-Topic-Title-XY
Module Title
Lesson Title
Lesson-Topic[1]-Title-XY
Topic-Title-InLineKeyboard-XY
Lesson-Topic-Title-XY
Topic Title
Glossary
Glossary Title
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) i
ii Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Section 1: Introduction to Cisco IOS XR CLI
Basics
Introduction
In this section, you will explore how to access and log in to a Cisco IOS XR router and navigate the various
command modes within Cisco IOS XR Software. Further, you will make basic configurations on a Cisco
IOS XR router, use various commands to review the configurations, and use automatic provisioning to
provide a Cisco IOS XR router with an initial configuration.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 1
Cisco IOS XR router access:
• Direct connection to console port
• Terminal server connected to the console port
• Telnet or SSH (v1 or v2)
Login:
• Root-system user defined at initial installation
• Assigned username and password
During the initial startup of a router, the root-system username and password are set. This root-system user
has the authority to create additional users.
Key Points
• To operate or configure a router that is running Cisco IOS XR Software, you must first connect with the
router by using a terminal or PC.
• Connections are made either directly through a physical connection (console port) or remotely through a
modem or an Ethernet connection.
2 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
• EXEC mode—Logging in to a router that is running Cisco IOS XR Software automatically places you
in EXEC mode. This mode enables a set of commands that you can use to view the operational state of
the router, install software on a secure domain router (SDR), and examine the state of an operating
system. Privileges also include a set of EXEC mode commands for connecting to remote devices,
changing terminal line settings on a temporary basis, and performing basic tests.
• Configuration mode—Configuration mode is the starting point for system configuration. Commands
that you enter in this mode affect the system as a whole, rather than just one protocol or interface. You
can also use configuration mode to enter configuration submodes for configuring specific elements,
such as interfaces or protocols.
Administration mode is currently used to configure secure domain routers (SDRs) and to install Cisco IOS
XR Software. Some commands are not available in EXEC mode.
• Administration EXEC—Enter the administration EXEC mode from EXEC mode. Administration
EXEC mode is used primarily to display system wide parameters, install software, and manage and
monitor system resources. These operations are available only to users with the required root-system
level access. When nonowner SDRs have been configured, EXEC mode provides visibility into only the
owner SDR. You can install packages either on a per-SDR basis or across the entire platform, and set
the configuration register.
• Administration configuration—Enter administration configuration mode from administration EXEC
mode. This mode's primary application is to configure nonowner SDRs, control individual card slots
(for example, you can turn power to a slot on and off), and configure the administration plane over the
control Ethernet for multichassis systems. These operations are available only to those users who have
root-system privileges.
• SDR configuration—Enter SDR configuration to specify a nonowner SDR to be provisioned, and enter
nonowner SDR configuration mode. Here you can configure the nonowner SDR's resources, such as
line cards.
Key Points
• The CLI for Cisco IOS XR Software is divided into separate command modes.
• Each mode provides access to a subset of commands that you can use to configure, monitor, and
manage the router.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 3
• Configuration submodes—From the configuration mode, you can enter other, more specific command
modes. These modes are available based on your assigned access privileges and include protocol-
specific, platform-specific, and feature-specific configuration modes.
• Configuration submode—You can use the configuration submode to configure cyclical redundancy
check (CRC) and transmit delay.
• Router configuration submode—You can use router configuration submode to select and configure a
routing protocol, such as BGP, OSPF, or IS-IS.
• Router submode configuration—You can access router configuration submodes from the router
configuration mode.
• Username, user group, and task group configuration submodes-From these submodes, you can
configure users, and nondefault user and task groups, in order to set access privileges.
Key Points
• Configuration mode is the starting point for system configuration.
4 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Two-Stage Configuration
Cisco IOS XR Software introduces a two-stage configuration method.
In the first stage, you make, change, add to, or subtract from the running configuration of the router,
creating a target configuration. The running configuration is not affected. The configuration is entered, the
syntax is checked for correctness, and then the configuration is stored, discarded, or applied.
In the second stage, you commit the target configuration and make it part of the running configuration.
Cisco IOS XR Software also has XML application program interfaces (APIs), which compose an interface
that can be used to configure the router. You can write applications to obtain billing, error, traffic, and
policing information through the XML interface.
Stage 1: Making Configuration Changes
Here are the steps in Stage 1:
1. Enter the CLI configuration mode, using either the config command or the config exclusive command.
The exclusive keyword option prevents other logged-in users from making configuration changes
during the configuration operation. All configuration commands entered at this stage have no effect on
the router operation. Commands that are entered do not take effect upon the entry of a carriage return
(<CR>).
2. The CLI parser, which runs every time that configuration commands are entered, checks for valid
syntax.
3. The configuration command is written to the target configuration.
4. Verify that the entered configuration is correct, or that the configuration can be discarded, before you
enter the second stage.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 5
• Cisco IOS XR Software introduces a two-stage configuration method.
• In the second stage, you commit the target configuration.
True False
Metadata Table
Metadata Value
Poster
Launch IOSXR100_2-0_truefalse_3/IOSXR100_2-0_truefalse_3.html
Path
Presentati Popup
on Type
Height 300
Width 450
Drag N Drop
Metadata Table
6 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Metadata Value
Poster
Launch IOSXR100_2-0_dragdrop_1/IOSXR100_2-0_dragdrop_1.html
Path
Presentati Popup
on Type
Height 300
Width 450
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 7
Configuration File System
The configuration file system (CFS) is a set of files and directories that are used to store the router
configuration state.
Caution: The files and directories in the CFS are internal to the router, and you should never modify or
remove them. Doing so might result in the loss of the configuration and could affect service.
The CFS is stored on the boot media on the RP (usually disk0), with the use of the directory structure:
• disk0:/config
An exact copy of the CFS is also maintained on the standby RP. The copy helps preserve the router
configuration state during and after a redundancy switchover.
Saving Configuration Changes
Every time that a configuration change is committed, a new binary file is created that saves the new router
configuration. The router automatically boots with the last configuration committed. Maintaining the
configuration information in binary format contributes to faster bootup times.
Key Point
• The configuration file system (CFS) is a set of files and directories that are used to store the router
configuration state.
8 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Command Modes
On Cisco IOS XR 64-Bit Software, the CLI commands are executed on the XR VM and the System Admin
VM. The graphic lists the command modes and descriptions for the XR VMs. In general, the EXEC
commands let you connect to remote devices, change terminal settings on a temporary basis, perform basic
tests, and list system information. Most CLI commands in EXEC mode do not change system operation.
The most common EXEC commands are show commands (used to display router configuration or
operational data) and clear commands (used to clear or reset system counters).
System Admin EXEC mode Run commands on the System Admin VM to display and monitor the
operational state of the router.
(System Admin VM execution mode)
Example:
RP/0/RP0:hostname#admin
sysadmin-vm:0_RP0#
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 9
Command Mode Description
System Admin Config mode Run configuration commands on the System Admin VM to manage and
operate the hardware modules of the entire chassis.
(System Admin VM configuration
mode) Example:
RP/0/RP0:hostname#admin
sysadmin-vm:0_RP0#config
sysadmin-vm:0_RP0(config)#
Key Point
• To enter the System Admin EXEC mode, you must use the admin command while in EXEC mode.
Command Examples
The graphic shows some sample illustrations of the prompt syntax and some commands that are used for
entering various modes. Note that the prompt changes as you enter each area of configuration, but the
specifics of the protocol or interface on which you are working are not as clear from the prompt.
10 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
CLI Prompt Syntax
When logging in to a Cisco IOS XR router, you are accessing the active route processor (RP) card.
The prompt at which CLI commands are run is shown in the graphic and is described as follows:
• The first position, or type, indicates the type of card (RP) to which you are connected.
• The second position, or rack, indicates a shelf number; a single-shelf system is always 0, and a
multisystem is numbered from 0 to 71.
• The next position, or slot, represents the slot in which the active RP is located.
• The next position, or module, is the entity on the card that actually runs the user commands. For the RP,
this is CPU0.
• The last position is the name assigned to this router, typically defined during initial configuration with
the hostname command.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 11
0Cisco IOS XR Initial Configuration
Configuration Considerations
Management interfaces
• RP Ethernet
• Virtual IP address
Hostname Interfaces
• Loopback
• Network
Telnet server
SSH server
When initially installing a router that runs Cisco IOS XR Software, there are some important configuration
items to consider:
• Management IP interfaces on RP cards and IPv4 virtual address
• Hostname for easy router recognition and potential inclusion in a domain name server
• Interfaces that the router will serve, such as loopback and network links
• Routing protocols and routes, such as static and default routes
• Telnet server for access
Key Point
• Some initial configuration items to consider include configuring the management interfaces, hostname,
loopback and network interfaces, routing, and SSH server.
Configuring a Hostname
The hostname identifies a router on the network. Although devices can be uniquely identified by their Layer
2 and Layer 3 addresses, such as an IP address, it is often simpler to remember network devices by a
hostname. This name is used in the CLI prompt, in your lab configuration filenames, and in general, to
identify the router on the network.
:router(config)# hostname P1
:router(config)#
12 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Create a hostname.
To configure the hostname, enter the hostname command in global configuration mode, followed by the
name of the router.
Key Point
• To configure the hostname, enter the hostname command in global configuration mode.
Key Point
• The out-of-band IP addresses for router management purposes are assigned to the RSP/RP card.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 13
Network Interface Numbering
A Cisco IOS XR router identifies an interface address by its rack number, line card slot number, instance
number, and port number, in the format rack/slot /instance/port. The rack parameter is reserved for
multirack systems. Instance numbers are reserved for cards that have subslots. The ports on the line card are
numbered 0, 1, 2, and so on.
R/S/I/P Forward interface in Rack/Slot/Instance/Port format
• Line card installed in line card slot 3
• Port 2 of that line card would be identified as:
For example, the rack/slot /instance/port address of the fourth port of a line card installed in line card slot 1
is 0/1/0/3. Even if the line card contains only one port, you must use the rack/slot /instance/port notation.
Each network interface uses a numbering format that identifies its physical location within the chassis.
The format is rack/slot/instance/port:
• rack—Specifies the rack number, which is always 0 in a single-chassis system.
• slot—Specifies the slot number in the chassis in which the line card is inserted.
• instance—Specifies the secondary slot location, which is always 0 for integrated line cards.
• port—Specifies the interface number on the line card.
Key Point
• A Cisco IOS XR router identifies an interface address by its rack number, line card slot number,
instance number, and port number, in the format rack/slot /instance/port.
14 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
• Interface mode
• Set the IP version
– IPv4 or IPv6 address
– Mask
• Activate the interface
Indirectly, you use the Management Ethernet interface to access the RP card and any other card within the
router. The RPs are present in pairs as active and standby redundant cards, in case of an RP switchover. The
active and standby RPs can be configured by the user. The interface on the standby card is visible and active
if configured with an IPv4 address, even while the card is in standby mode.
Key Point
• To configure the Management Ethernet interface, you must enter interface configuration mode and
identify the location of the Management Ethernet interface instance.
IPv4 command
• Assign IP address and mask
Note The show ipv4 interface command does not display the IPv4 virtual address. The address does appear
in the routing information base (RIB) and in the Address Resolution Protocol (ARP) table.
Key Point
• The IPv4 virtual address is used primarily for out-of-band management over the Management Ethernet.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 15
Configuring Loopback Interfaces
IPv4 addresses for in-band management purposes are typically assigned to a loopback interface. A loopback
interface provides an "always available" address so long as there is any path through the data network to the
router.
:router(config)# interface loopback0
:router(config-if)# ipv4 address 10.1.1.1/32
:router(config-if)# commit
Interface command
• Assign IP address
• Visible as interface
Note The show ipv4 interface command displays loopback addresses. The loopback address appears in the
RIB. However, the loopback address does not appear in the ARP table, because it is not associated with
any physical interface.
Key Point
• A loopback interface provides an "always available" address so long as there is any path through the
data network to the router.
Interface command
• rack/slot/instance/port
• Assign IP address.
• Activate the interface.
16 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Configuring Static and Default Routes
The configuration for static routes is a routing protocol configuration. The address family must be
designated as either IPv4 or IPv6, and as unicast or multicast. The route is configured with the destination
prefix, prefix mask, and next-hop address. An outgoing interface can be used instead of the next-hop
address.
:router(config)# router
:router(config-static)# address-family ipv4 unicast
:router(config-static-afi)# 0.0.0.0/0 172.21.116.1
:router(config-static-afi)#
• Protocol configuration
• Choose address family
– IPv4 or IPv6
– Unicast or multicast
• Destination prefix and mask
• Next-hop address or outgoing interface
Key Points
• The address family must be designated as either IPv4 or IPv6, and as unicast or multicast.
• The route is configured with the destination prefix, prefix mask, and next-hop address.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 17
The concept of virtual routing and forwarding is used with the advent of the VPN, which requires the
security of segregated networks for route and data protection.
In Cisco IOS XR Software, if VRF is not specified in a configuration or show command, the information
configured or displayed is specific to the default vrf.
Cisco uses "VPN routing and forwarding" as its definition of the acronym VRF.
Cisco IOS XR Software is delivered with a default VRF definition.
Key Point
• In Cisco IOS XR Software, if VRF is not specified in a configuration or show command, the
information configured or displayed is specific to the default vrf.
18 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Configuring SSH Access
Secure Shell (SSH) is a useful protocol or application for establishing secure sessions with the router. A
router configured with SSH server allows a secure connection to the router similar to Telnet. The Telnet
application has limited security. SSH provides stronger encryption and deploys public-key cryptography for
added confidentiality.
Note To enable SSH on Cisco IOS XR Software, you must install the k9sec package.
Key Point
• The SSH server feature enables an SSH client to make a secure, encrypted connection to the router.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 19
Interface Preconfiguration
Preconfiguration is the process of configuring interfaces before they are present in the system.
Preconfigured interfaces are not verified or applied until the actual interface with the matching location (that
is, rack, slot, and module) is inserted into the router. When the anticipated modular services card is inserted
and the interfaces are created, the previously created configuration information is verified and, if successful,
is immediately applied to the running configuration of the router.
Preconfigurations reduce downtime when you add new cards to the system. With preconfiguration, the new
modular services card can be instantly configured and actively running during modular services card
bootup. Another advantage of performing a preconfiguration is that, during a card replacement when the
modular services card is removed, you can still see the previous configuration and make modifications.
Interfaces that are not yet present in the system can be preconfigured with the interface preconfigure
command in global configuration mode. The interface preconfigure command places the router in
interface configuration mode. You will be able to add any possible interface commands. The verifiers that
are registered for the preconfigured interfaces verify the configuration.
Caution: Do not enter the no shutdown command for new preconfigured interfaces, because the no form of
this command removes the existing configuration.
Users are expected to provide names during preconfiguration that will match the name of the interface that
will be created. If the interface names do not match, the preconfiguration cannot be applied when the
interface is created. The interface names must begin with the interface type that is supported by the router
and for which drivers have been installed. However, the slot, port, subinterface number, and channel
interface number information cannot be validated.
Key Points
• Preconfiguration is the process of configuring interfaces before they are present in the system.
• Preconfigured interfaces are not verified or applied until the actual interface with the matching location
(that is, rack, slot, and module) is inserted into the router.
20 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Committing the Configuration
To commit the configuration changes while keeping the configuration session active, you must use the
commit command. This command is an all-or-nothing acceptance of the configuration changes to the
running configuration, sometimes called an atomic commit.
:router(config)# commit
:router(config)#
During the commit operation, the active configuration is automatically locked by the router for the duration
of the commit process, even if you have not already locked it.
Key Points
• To commit the configuration changes while keeping the configuration session active, you must use the
commit command.
• This command is an all-or-nothing acceptance of the configuration changes to the running
configuration.
Failed Configurations
The default method of committing changes is atomic, which signifies an all-or-nothing type of
configuration, where a semantic error in one part of a configuration prevents any of the configuration
commands from being committed.
Default commit is "atomic."
• "All or nothing"
• One semantic error prevents committing all other commands.
Failed configurations:
• Commands that fail to pass semantic verification.
• Target configuration is left intact.
• Nothing is promoted to active configuration.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 21
The configuration commands that fail to pass semantic verification during the commit process are known as
failed configurations. When a configuration commit fails, the target configuration is left intact and nothing
is promoted to an active configuration. An error message is generated to indicate that a problem has
occurred.
You can view the failed configuration commands by entering the show configuration failed command.
Key Points
• The configuration commands that fail to pass semantic verification during the commit process are
known as failed configurations.
• You can view the failed configuration commands by entering the show configuration failed command.
22 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
commit best-effort Command
Another type of commit that can be used is called best effort. This type of commit implements the parts of
the configuration that are semantically correct and does not implement the part of the configuration that is
incorrect. An error message is generated in this case also, and you can view the failed part of the
configuration by using the show configuration failed command.
• The commit best-effort fails.
• Some configuration fails, but the correct configuration is implemented.
• Failed configurations are discarded.
You can see configuration changes at various stages—as part of the running configuration, as a failed
configuration, or as a removed configuration when a software package is removed. You can see when
changes were committed and what those committed changes actually were. You can also manage
configuration sessions.
Key Point
• The best-effort type of commit implements the parts of the configuration that are semantically correct
and does not implement the part of the configuration that is incorrect.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 23
Exiting and Ending Configuration Mode
The exit command ends each level (or submode) of the configuration session. If there are uncommitted
changes when you exit configuration mode, you are prompted to either commit them or reject them.
24 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Key Point
• The exit and end commands can be used to return to EXEC mode.
There are two common methods of discarding the target configuration while configuring a Cisco IOS XR
router:
• clear
• abort
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 25
Discard Target Configuration—Clear
The clear command allows you to discard all uncommitted changes made to a router configuration. This
discard eliminates all changes that were made since entering configuration mode.
RP/RSP0/CPU0:router#configure
RP/RSP0/CPU0:router (config) #interface GigabitEthernet0/0/0/3
RP/RSP0/CPU0:router (config) #abort
RP/RSP0/CPU0:router#
26 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Saving the Target Configuration to Disk
While you are in configuration mode, you may want to save the configuration that you are presently
working on without committing it. To do this, use the save configuration command, followed by the
pathname and filename. You can now exit configuration mode without saving your changes, or clear this
configuration and start another one.
Note The show configuration merge command shows what the configuration would look like if the new
change were to be committed at a certain moment.
Key Point
• To save configurations that you are presently working on without committing, you can use the save
configuration command.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 27
Loading the Target Configuration from Disk
If you previously have saved a configuration, you can return to this configuration by loading it into the
configuration mode. You can make any additions or corrections to the configuration and then implement it
by using the normal commit process. A loaded configuration merges with any commands that are already
entered in the existing target configuration. To load a configuration, use the load command, followed by the
pathname and filename.
Key Point
• If you previously have saved a configuration, you can return to this configuration by loading it into the
configuration mode.
28 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Useful Shortcuts
Cisco IOS XR Software supports tab completion. As long as you type enough of a command that the parser
won't mistake it for another command, when you press the tab key, the remainder of the command will be
entered for you. You can use the up and down arrow keys to view previously entered commands. Also, you
can use the history command to display previously entered commands in list format. If you are within
many subconfiguration modes and do not want to use the exit command many times, you can use the root
command to go back to the global configuration prompt. In global configuration mode, you can execute any
EXEC level command by placing the do keyword in front of the Exec level command.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 29
0Reviewing the Configuration
Objective
Review configurations on a Cisco IOS XR router.
The show running-config command displays the details of the active, or currently running, configuration.
30 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Displaying the Active Configuration (Cont.)
These and other parameters are available to minimize the amount of information that you display,
particularly with a large router configuration.
You can see specific parts of the current configuration by using additional parameters, such as the
following:
• interface—Displays the interfaces
• router protocol—Displays the routing protocol specified
• username—Displays the configured users
Use the address-family command to enter various address family configuration modes while configuring
static routing sessions. From address family configuration mode, you can configure static routes by using
the router static command.
Key Points
• The running configuration is the active configuration that is used to operate the router.
• You can see specific parts of the current configuration by using additional parameters.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 31
Note To display configuration changes or the target configuration, you must enter the command while still in
configuration mode.
Key Points
• The target configuration is the configuration with all the uncommitted changes made in the current
configuration session.
• The show config command displays items configured in the current configuration session.
32 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Previewing Rollback Configuration Changes
The show configuration rollback changes command allows you to preview the configuration changes that
take place if you roll back the configuration to a specific commit ID. For example, if you want to roll back
the configuration to a specific point, all configuration changes made after that point must be undone.
This rollback process is often accomplished by executing the no version of commands that must be undone.
To display the prospective rollback configuration changes from the current configuration to a specific
commit ID, go to EXEC or administration EXEC mode and enter the show configuration rollback changes
to commit ID command. In the following example, the command help displays the available commit IDs,
and then the rollback changes are displayed.
To display the prospective rollback configuration changes from the current configuration to a specified
number of previous sessions, go to EXEC or administration EXEC mode and enter the show configuration
rollback changes last commit-range command: RP/0/0/CPU0:router# show configuration rollback
changes last 2.
Key Point
• The show configuration rollback changes command allows you to preview the configuration changes
that take place if you roll back the configuration to a specific commit ID.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 33
The table shows the filtering options for the show command.
Key Point
• You can display a subset of a show command by filtering using regular expressions.
34 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Displaying Interfaces
The show interface command presents the statistics for interfaces that are configured on the router, in slot
order and by interface type and instance number. The brief keyword, as shown in the slide, presents a
summary of one line for each interface configured. The physical interface display is in the form
rack/slot/instance/port.
RP/0/RP0/CPU0:R1#show interface brief
Thu Feb 7 20:51:15.273 UTC
RP/0/RP0/CPU0:R1#
Key Point
• The show interface command presents the statistics for interfaces.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 35
Displaying IP Interfaces
RP/0/RSP0/CPU0:R1#show ipv4 interface brief
The show ipv4 interface command presents a list of all interfaces, their IPv4 addresses (if configured), and
the status of both the interface and the protocol.
36 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
2 1 vty0 0/RP0/CPU0 SESSION_OPEN root 172.16.1.50
v2 key-intr Command-Line-Interface
Outgoing sessions
RP/0/RP0/CPU0:R1#
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 37
The show route command displays the routes currently in the routing information base (RIB) table.
Displaying RP Redundancy
The status of RP redundancy of the router is displayed when you use the show redundancy command. The
display shows which RP is the active RP and which is the standby RP. The display further shows the status
of the standby RP, along with the most recent reload and boot information.
router# show redundancy
Redundancy information for node 0/RP0/CPU0:
==========================================
Node 0/RP0/CPU0 is in ACTIVE role
Partner node (0/RP1/CPU0) is in STANDBY role
Standby node in 0/RP1/CPU0 is ready
Standby node in 0/RP1/CPU0 is NSR-ready
Note To display the total elapsed time for the switchover, you can look in the log by using the show log
command or the show redundancy command.
Key Point
• The status of RP redundancy of the router is displayed when you use the show redundancy command.
Redundancy Switchover
If the standby RP must become the active RP, you can make the switch by entering the redundancy
switchover command and confirming the switchover.
router# redundancy switchover
Updating Commit Database. Please wait...[OK]
Proceed with switchover 0/RP0/CPU0 -> 0/RP1/CPU0?[confirm]
Initiating switch-over.
38 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
0Automatic Provisioning
iPXE Fundamentals
iPXE is a preboot execution environment that is embedded in the router and works at the BIOS level. Some
features supported by iPXE include the capability to boot from HTTP and HTTPS, to control the boot
process via a script, and to perform image validation when the image is downloaded over an insecure
communication. iPXE can act as a boot loader and gives you a great deal of flexibility in choosing the
image that the system will boot, based on the system platform identifier (PID), the serial number, or the
management MAC address.
• iPXE is a preboot execution environment.
• Boot from a web server via HTTP or HTTPS.
• Control the boot process with scripts.
• iPXE is supported on the management interfaces.
• Supports both IPv4 and IPv6.
• Performs image validation.
iPXE is recommended in case the system does not have a valid image on the Flash file system or if the user
wants to re-image the system. If you want to upgrade the system and preserve all configurations, it is
recommended that you apply packages or SMUs.
Key Point
• Some features supported by iPXE include the capability to boot from HTTP and HTTPS.
Automatic Provisioning
Automatic provisioning is always invoked during bootup but stops its execution as soon as it detects a valid
admin username and password in the boot startup configuration. In order to operate, automatic provisioning
requires IP connectivity. The first thing that the automatic provisioning process does is to create a dynamic
host configuration protocol (DHCP) client process, send a DHCP request out the management port, and wait
for a valid response. If the DHCP response contains an option 67 (filename that is to be downloaded from
the server), the client will access the server over the protocol indicated in the DHCP response and download
the file referenced by the DHCP response.
Cisco IOS XR 64-Bit Software comes with a zero-touch provisioning (ZTP) process.
• Executed at the end of the control plane boot sequence
• Executed inside a shell environment (such as bash)
• Can execute scripts or apply static configuration
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 39
Cisco IOS XR 64-Bit Software supports an automatic provisioning mechanism to facilitate large-scale
deployment. The automatic provisioning process is activated at the end of the Cisco IOS XR Software
container boot process (process level 999) and can provide two functions:
• Apply a static configuration
• Execute a script
40 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Automatic provisioning will analyze the first line of the file that it has received. If the file starts with "!! IOS
XR," it will interpret the rest of the file as a static configuration.
Key Points
• Automatic provisioning is always invoked during bootup but stops its execution as soon as it detects a
valid admin username and password in the boot startup configuration.
• Automatic provisioning will analyze the first line of the file that it has received. If the file starts with "!!
IOS XR," it will interpret the rest of the file as a static configuration.
• If the file starts with "#!/bin/bash," "#!/bin/sh," or "#!/user/bin/python," automatic provisioning will
interpret it is as a script.
ZTP Utilities
ZTP includes a set of CLI commands and a set of shell utilities that can be sourced within the user script.
ztp_helper.sh is a shell script that can be sourced by the user script. It provides simple utilities for accessing
some XR functionalities. These utilities are:
ztp_helper.sh is a shell script that can be sourced by the user script.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 41
xrcmd xrcmd "show running"
!! XR config example
hostname pluto
EOF
xrapply /tmp/config
42 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Key Points
• ztp initiate invokes a new ZTP DHCP session and allows the execution of a script even if the system
has already been configured.
• ztp terminate terminates any ZTP session in progress.
• ztp breakout performs a 4x10 breakout detection on all 40-Gb interfaces.
• ztp clean removes all ZTP files saved on a disk.
ZTP Logging
ZTP logs its operation on the flash file system in the directory /disk0:/ztp/. ZTP logs all the transactions
with the DHCP server and all the state transitions. Prior executions of ZTP are also logged in
/disk0:/ztp/old_logs/.
• ZTP logs its operation on the flash file system in the directory /disk0:/ztp/.
• ZTP logs all the transactions with the DHCP server and all the state transitions.
• Prior executions of ZTP are also logged in /disk0:/ztp/old_logs/.
Key Point
• ZTP logs its operation on the flash file system in the directory /disk0:/ztp/.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 43
Boot with iPXE
If iPXE is the selected boot method, a DHCP request will be sent out of the management interface, and if a
DHCP server is reachable and is appropriately configured, the DHCP server will send a DHCP response
message. Within the DHCP response message, a filename (option 67) will be provided, identifying the
protocol and location of the image ISO.
44 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Boot with iPXE (Cont.)
After the image is installed, the Cisco IOS XR Software will boot and the autoprovisioning process will be
invoked. Another DHCP request message will be sent out, and the DHCP server will provide a DHCP
response message that includes the location of the server with the configuration and script files.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 45
Boot with iPXE (Cont.)
If the DHCP response contains an option 67 (option 59 for IPv6), ZTP will download the file by using the
uniform resource identifier (URI) provided by option 67 (or option 59 for IPv6). If the file received is not a
text file, or if the file is larger than 100 MB, ZTP will erase the file and terminate its execution. Otherwise,
it will analyze the first line of the text file received. If the first line of the file starts with "!! IOS XR," it will
consider it as a configuration file and pass it to the command line interpreter for syntax verification and
commit it. If the first line starts with "#!/bin/bash," "#!/bin/sh," or "#!/usr/bin/python," ZTP will assume that
this is a script and will start the execution. If the text file cannot be interpreted as a shell script or a
configuration file, ZTP will erase the file and terminate its execution.
46 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Boot with iPXE (Cont.)
The script can use all the Linux tools that are available in the Control Plane LXC and perform additional
HTTP GETs by using wget or curl, for example, to install a package or to download and apply configuration
blocks.
Finally, the autoprovisioning process is terminated and the DHCP address is released. The DHCP address is
configured on the management interface inside the shell of control plane container, and not in the Cisco IOS
XR Software configuration itself. Because the script is executed within the control plane shell, it has access
to all the standard tools provided by the Linux environment of the container.
Key Point
• If iPXE is the selected boot method, DHCP will provide the router with the location of the installation
file. The router will then request, install, and boot the image and go through the automatic provisioning
process.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 47
Boot Sequence with No iPXE
If iPXE functionality is not enabled, the control plane LXC or VM is booted and autoprovisioning is
invoked.
48 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Autoprovision Execution
The graphic provides more details of the autoprovision execution. At the beginning of its execution, ZTP
will scan the configuration for the presence of a username. If no username is configured, ZTP will create a
DHCP request on the management interface and wait for a response. If the DHCP response contains an
option 67 (option 59 for IPv6), ZTP will download the file using the URI provided by option 67 (or option
59 for IPv6). If the file received is not a text file or the file is larger than 100 MB, ZTP will erase the file
and terminate its execution. Otherwise it will analyze the first line of the text file received. If the first line of
the file starts with "!! IOS XR," it will consider it as a configuration file and pass it to the command line
interpreter for syntax verification and commit it. If the first line starts with "#!/bin/bash," "#!/bin/sh," or
"#!/usr/bin/python," ZTP will assume that that this is a script and start the execution, as shown in the figure.
If the text file cannot be interpreted as a shell script or a configuration file, ZTP will erase the file and
terminate its execution. The script can use all the Linux tools available in the Control Plane LXC and
perform an additional HTTP GET, using wget or curl, for example, to install the package and/or download
and apply configuration blocks.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 49
iPXE and ZTP DHCP Server Configuration
The graphic shows a sample of a dhcpd.conf file, which illustrates how to configure a DHCP server for
iPXE and ZTP. With this configuration, the system boots using the ncs5500-mini-x.iso during installation,
and then downloads and executes the ncs5500-ztp.script when the control plane LXC is up. Either the ZTP
script file or the .cfg file can be provided during autoprovisioning.
50 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
Key Point
• The graphic shows a sample of a dhcpd.conf file, which illustrates how to configure a DHCP server for
iPXE and ZTP.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 51
0[V5.0 Video]
[Short video description]
52 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
0Section summary
Management IP addresses, hostname, interface IP addresses, routes, and Telnet or SSH server configuration
are important initial configuration items to consider. You can commit configuration changes to the running
configuration by using the commit command and can end or exit configuration mode by using the end and
exit commands.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 53
0Progress Check
1. 0What is the second stage of the Cisco IOS XR software two-stage configuration method? (Choose
one.) (Source: Cisco IOS XR Configuration Operations)
a. Create a target configuration.
b. Make, change, add to, or subtract from the running configuration.
c. Write applications.
d. Commit the target configuration.
2. 0What command can be used to display commands that failed in a commit? (Source: Cisco IOS XR
Initial Configuration)
a. show running-config failed
b. show configuration failed
c. show commit failed
d. show failed commit
3. 0Which command displays the entire running configuration? (Choose one.) (Source: Reviewing the
Configuration)
a. show running-config
b. show config merge
c. show run router static
d. show config
4. 0Which command displays the target configuration? (Source: Reviewing the Configuration)
a. show running-config
b. show config merge
c. show run router static
d. show config
5. 0Which statement is true for the abort command? (Source: Cisco IOS XR Initial Configuration)
a. The abort command is an undo for committed changes.
b. The abort command discards all committed changes made to a router configuration since the
previous commit.
c. The abort command discards all uncommitted changes made to a router configuration and
returns to EXEC mode.
d. The abort command returns the router configuration to the default one.
6. 0Which of the following are command modes within the Cisco IOS XR environment? (Choose
three.)(Source: Cisco IOS XR Configuration Operations)
a. Control Mode
b. EXEC Mode
c. Monitoring Mode
d. Operations Mode
e. Administrative Mode
f. Management Mode
g. Configuration Mode
54 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
7. 0What command is used to display the redundancy status of the Route Processors (RP)? (Source:
Reviewing the Configuration)
a. Display redundancy
b. show rp redundancy status
c. rp redundancy
d. show redundancy
8. 0Which of the following are part of the network interface numbering? (Choose four.)(Source: Cisco
IOS XR Initial Configuration)
a. Rack
b. Port
c. Virtual Port
d. Shelf
e. Subslot
f. Subinterface
g. Virtual Address
h. Slot
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 55
0Answer Key
Progress Check
1. D
2. B
3. A
4. D
5. C
6. B, E, G
7. D
8. A, B, E, H
56 Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) ¡Error! No hay texto con el estilo especificado en el documento.
¡Error! No hay texto con el estilo especificado en el documento. Introduction to Cisco IOS XR CLI Basics ([Solomon ID]) 57