0% found this document useful (0 votes)
79 views61 pages

08 - Introduction To Cisco IOS XR CLI Basics - Student Learning Guide v5.0 - Word (003) - DP

The document serves as a student guide for understanding the basics of Cisco IOS XR CLI, covering topics such as accessing the router, command modes, configuration operations, and initial setup. It details the command modes hierarchy, including EXEC and configuration modes, and introduces a two-stage configuration method for making changes to the router's settings. Additionally, it emphasizes the importance of proper configuration management and provides guidelines for setting up management interfaces and hostnames.

Uploaded by

Dúber Pérez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views61 pages

08 - Introduction To Cisco IOS XR CLI Basics - Student Learning Guide v5.0 - Word (003) - DP

The document serves as a student guide for understanding the basics of Cisco IOS XR CLI, covering topics such as accessing the router, command modes, configuration operations, and initial setup. It details the command modes hierarchy, including EXEC and configuration modes, and introduces a two-stage configuration method for making changes to the router's settings. Additionally, it emphasizes the importance of proper configuration management and provides guidelines for setting up management interfaces and hostnames.

Uploaded by

Dúber Pérez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 61

[Solomon ID]

Introduction to Cisco IOS XR CLI


Basics
Student Guide Volume number
Version Number

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

Section 1: Introduction to Cisco IOS XR CLI Basics.........................................................................................................................................................................................

Cisco IOS XR Configuration Operations.....................................................................................


Cisco IOS XR Initial Configuration............................................................................................
Reviewing the Configuration.....................................................................................................
Automatic Provisioning.............................................................................................................
[V5.0 Video]..............................................................................................................................
Section summary......................................................................................................................
Progress Check........................................................................................................................
Answer Key...............................................................................................................................

¡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.

Cisco IOS XR Configuration Operations


Access and Login
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.
After a connection is established, enter your assigned username and password, as shown in the graphic.

¡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.

Command Modes Hierarchy


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.

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.

Configuration Modes Hierarchy


Configuration mode is the starting point for system configuration. You can use it also to enter configuration
submodes in order to configure specific elements, such as interfaces or protocols.
• Create router configurations
• Perform router operations

¡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.

• Stage 1: Make configuration changes.


– Create new target configuration by entering config.
• Stage 2: Make changes persistent.

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.

Stage 2: Making Configuration Changes Persistent


When you have exited the configuration mode, the router asks if you want to commit the configuration
changes—that is, make the target configuration the running configuration.
Key Points

¡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

Title Now You Try!

Descriptio Click to access the slides.


n

Poster

File Now You Try!

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

Title Now You Try DragDrop1

Descriptio Click to access the interactivity.


n

Poster

File Click Here!

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).

The XR VM configuration modes allow you to add configuration.

Admin Command Modes


To enter the System Admin EXEC mode, you must use the admin command while in EXEC mode. The
commands that you can enter in Admin EXEC are used to configure logical routers and to execute other
administration plane commands. Note that the admin commands can be run only by entering admin mode
and not by prefixing the command with the admin keyword in EXEC mode. You can run commands in
the System Admin Exec mode to display and monitor the operational state of the router hardware. Then you
can enter the System Admin Config mode by using the config command while in admin EXEC mode. When
you are in the admin config mode, you can run configuration commands on the system admin VM or
operate the hardware on the entire chassis.

Command Mode Description

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.

Making and Reversing Configuration Changes


To negate a configuration, precede the command with no.

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.

• RP = route processor card


• 0 = always the same
• RP0 = either RP0 or RP1
• P1 = router's hostname

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

Routing protocols and routes


• Static
• Default route

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.

Management Ethernet Interfaces RSP5/RP3


The out-of-band IP addresses for router management purposes are assigned to the RSP/RP card. The
RSP/RP provides all shelf electrical I/O connectivity to the active and standby route-processor line cards.

Configuring Management Ethernet Interfaces:


• To configure the Management Ethernet interface, you must enter interface configuration mode and
identify the location of the Management Ethernet interface instance.
• 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 user-configured.

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.

Management Ethernet Interfaces


To configure the Management Ethernet interface, you must enter interface configuration mode and identify
the location of the Management Ethernet interface instance.
:router# configure
:router(config)# interface MgmtEth 0/RP0/CPU0/0
:router(config-if)# ipv4 address 192.168.111.11/24
:router(config-if)# no shutdown
:router(config-if)# commit

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.

Configuring the IP Virtual Address


The IPv4 virtual address is used primarily for out-of-band management over the Management Ethernet. Its
IP address is typically assigned in the same subnet as the Management Ethernet ports on the RPs. The IP
virtual address always maps to the MAC address of the active Ethernet port, with which it shares a common
IP subnet, on the currently active RP. Because it survives RP switchover, it functions as an "always
available" management address without depending on any routing protocol on the Management Ethernet.
:router(config)# ipv4 virtual address 192.168.111.11/24
:router(config)#

IPv4 virtual address


• Host address on management network
– Must be on same subnet as Ethernet management interfaces
• Provides sustainable MAC address in the event of RP failover
• Only for management

IPv4 command
• Assign IP address and mask

Visible only in RIB (not an IP interface)

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

The loopback address is configured as an interface with an assigned IP address.

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.

Configuring Network Interfaces


Interfaces connected to other routers are configured from global configuration mode.
:router(config)# interface GigabitEthernet 0/3/0/2
:router(config-if)# ipv4 address 192.168.111.11/24
:router(config-if)# no shutdown
:router(config-if)#

Interface command
• rack/slot/instance/port
• Assign IP address.
• Activate the interface.

To configure interfaces, follow these steps:


1. Enter interface submode for the specific network interface.
2. Set the IP address.
3. 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.

Virtual Routing and Forwarding


Virtual routing and forwarding is a technology used in IP routing that allows the forwarding of traffic to
various customers by segregating the traffic. With this segregation comes additional security. To implement
this technology, the router maintains distinct routing tables and FIBs.

¡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.

Configuring Telnet Access

Allow Telnet access


To provide Telnet access to a Cisco IOS XR router, you create an instance of a Telnet server. The Telnet
server is configured as either IPv4 or IPv6.
By default, the number of Telnet lines available in the vty "pool" is five (vty-pool default 0 4). To raise the
default pool beyond five, use the vty- pool command. You can use the telnet ipv4 server max –servers
command to enable Telnet functionality. You can limit the number of Telnet sessions to the router by using
the max-servers argument.
You can also configure the router as a Telnet client.
When displaying the running configuration (explained later in this module), you see the Telnet
configuration as part of the default virtual routing and forwarding implementation.
Key Point
• To provide Telnet access to a Cisco IOS XR router, you create an instance of a Telnet server.

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.

Cisco IOS XR supports two versions of SSH:


• SSH version 1 uses Rivest, Shamire, and Adelman (RSA) keys.
• SSH version 2 uses the Digital Signature Algorithm (DSA).

There are two modes you can configure:


• SSH Server: The SSH server feature enables an SSH client to make a secure, encrypted connection to
router. This connection provides functionality that is similar to that of an inbound Telnet connection.
• SSH Client: The SSH client feature is an application running over the SSH protocol to provide device
authentication and encryption. The SSH client enables router to make a secure, encrypted connection to
another router or to any other device running the SSH server. This connection provides functionality
that is similar to that of an outbound Telnet connection except that the connection is encrypted.

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)#

Target changes must pass semantics.


• Pass: All changes are committed.
• Fail: No changes are committed.

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.

show configuration Command


The show configuration command has several keywords that provide additional information.
The show configuration command parameters are shown in the table.

¡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.

Type no to exit or end without committing changes.


Type yes for changes to take effect.
Enter or Cancel continues existing session with current configuration.
The end command finishes the configuration session immediately. If there are uncommitted changes when
you exit configuration mode, you are prompted to either commit them or reject them.
In each case, Cancel is the default response to the question of committing the changes. Canceling continues
the existing configuration session and keeps the current target configuration in memory.
If you want to commit the changes to the running configuration, you must respond by typing yes.

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.

Discard Target Configuration

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.

Discard Target Configuration—Abort


The abort command is similar to the clear command, because the abort command cancels the changes you
have made. However, this command discards all uncommitted changes and returns you directly to EXEC
mode. No warning is given before the configuration changes are canceled.
• Ends the configuration session immediately
• No warning before deletion of target changes

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.

Displaying the Active Configuration


The running configuration is the active configuration that is used to operate the router—that is, the
committed configuration that defines the router operations.

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.

Displaying the Target Configuration


The target configuration is the configuration with all the uncommitted changes made in the current
configuration session.
The show config command, which you enter from configuration mode, displays items configured in the
current configuration session. These changes have been entered but not yet committed.

¡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.

Filtering show Command Output


Output from the show commands can generate a large amount of data. To display only a subset of
information, enter the pipe character (|), followed by a keyword (such as begin, include, exclude, or file)
and a regular expression.
• Display only a subset of show command output
• Regular expression case-sensitive

¡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.

Filtering show Command Output (Cont.)


Cisco IOS XR Software differs than Cisco IOS in that the section keyword is not available. However, you
can view a section of the running configuration by using the show running-config
section command.
RP/0/RP0/CPU0:R1#show running-config router ospf
router ospf lab
router-id 1.1.1.1
area 0
interface GigabitEthernet0/0/0/0
!
interface GigabitEthernet0/0/0/1
passive enable
!
!
area 1
interface Loopback0
passive enable
!
!
!
RP/0/RP0/CPU0:R1#show running-config ssh
ssh server v2

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

Intf Intf LineP Encap MTU BW


Name State State Type (byte) (Kbps)
--------------------------------------------------------------------------------
Lo0 up up Loopback 1500 0
Nu0 up up Null 1500 0
Mg0/RP0/CPU0/0 up up ARPA 1514 1000000
Gi0/0/0/0 up up ARPA 1514 1000000
Gi0/0/0/1 admin-down admin-down ARPA 1514 1000000
Gi0/0/0/2 admin-down admin-down ARPA 1514 1000000
Gi0/0/0/3 admin-down admin-down ARPA 1514 1000000
Gi0/0/0/4 admin-down admin-down ARPA 1514 1000000

RP/0/RP0/CPU0:R1#

Displaying Interfaces (Cont.)


You can display individual interfaces by including the specific interface type and number, as shown in the
slide. The information about individual interfaces includes hardware type, Internet address, maximum
transmission unit (MTU), bandwidth, encapsulation type, and a variety of statistics.

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

Wed Sep 26 07:41:01.121 UTC

Interface IP-Address Status Protocol Vrf-Name


Loopback0 192.168.1.68 Up Up default
Loopback77 77.77.77.77 Up Up default
tunnel-te1 192.168.1.68 Down Down default
MgmtEthB0/CB0/CPU0/0 172.18.120.244 Up Up default
HundredGigE0/1/0/0 20.20.20.2 Up Up default
HundredGigE0/1/0/1 16.16.16.1 Down Down default
HundredGigE0/1/0/2 unassigned Shutdown Down default
HundredGigE0/1/0/3 unassigned Shutdown Down default

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.

Displaying IP Interfaces (Cont.)


To display specific information about individual interfaces, use a show interface command that includes
the protocol address family (IPv4 or IPv6) and the specific interface instance.
RP/0/RP0/CPU0:R1#show ipv4 interface mgmtEth 0/RP0/CPU0/0
Thu Feb 7 20:55:05.979 UTC
MgmtEth0/RP0/CPU0/0 is Up, ipv4 protocol is Up
Vrf is default (vrfid 0x60000000)
Internet address is 172.16.1.1/24
MTU is 1514 (1500 is available to IP)
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound common access list is not set, access list is not set
Proxy ARP is disabled
ICMP redirects are never sent
ICMP unreachables are always sent
ICMP mask replies are never sent
Table Id is 0xe0000000
RP/0/RP0/CPU0:R1#

Displaying SSH Session


The show ssh command displays all incoming and outgoing Secure Shell (SSH) Version 1 (SSHv1) and
SSH Version 2 (SSHv2) connections.
RP/0/RP0/CPU0:R1#show ssh
Thu Feb 7 21:09:34.503 UTC
SSH version : Cisco-2.0

id chan pty location state userid host


ver authentication connection type
--------------------------------------------------------------------------------------
-----------------------------------------
Incoming sessions

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#

Displaying the Routing Table

¡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

Reload and boot info


----------------------
RP reloaded Mon Dec 7 06:22:03 2006: 3 days, 2 hours, 22 minutes ago
Active node booted Mon Dec 7 06:22:03 2006: 3 days, 2 hours, 22 minutes ago
Standby node boot Tue Dec 8 20:05:57 2006: 1 day, 12 hours, 38 minutes ago
Standby node last went not ready Thu Dec 10 08:10:36 2006: 33 minutes ago
Standby node last went ready Thu Dec 10 08:10:36 2006: 33 minutes ago
There have been 0 switch-overs since reload

• Display the current redundancy state

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.

• Switch over to standby RP (EXEC mode)

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

Automatic Provisioning (Cont.)

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.

Automatic Provisioning (Cont.)


If the file starts with "#!/bin/bash," "#!/bin/sh," or "#!/user/bin/python," automatic provisioning will
interpret it is as a script. Any other sequences in the header of the file will force automatic provisioning to
discard the content of the file and stop its execution.
Script Example

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.

xrcmd xrcmd "show running"

xrapply cat >/tmp/config <<EOF

¡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

xrapply_with_reason cat >/tmp/config <<EOF


!! XR config example
hostname saturn
EOF
xrapply_with_reason "this is an important name
change" /tmp/config

xrapply_string xrapply_string "hostname mars\n interface


TenGigE0/0/0/0\n ipv4 address 172.30.0.144/24\n"

xrcmd – Runs an XR exec command.


xrapply – Applies the block of configuration specified in a file.
xrapply_with_reason – Applies the block of configuration specified in a file and specifies a reason for
commit history tracking.
xrapply_string – Applies a block of configuration specified in a string. Use "\n" to delimit line of
configuration statement.
Xrapply_string_with_reason – Applies a block of configuration specified in a string and specifies a reason
for commit history tracking.
Key Points
• ztp_helper.sh is a shell script that can be sourced by the user script.
• It provides simple utilities for accessing some XR functionalities.

ZTP CLI Commands


ztp initiate invokes a new ZTP DHCP session and allows the execution of a script even if the system has
already been configured. This command is useful for testing ZTP without forcing a reload. This command is
particularly useful for testing scripts or if some manual operations are required before provisioning the box.
With ZTP initiate, you can specify any data interfaces on the system to be used for the whole ZTP process.
ztp terminate terminates any ZTP session in progress.
ztp breakout performs a 4x10 breakout detection on all 40-Gb interfaces; by default, if no link is detected on
any of the four 10Gig interfaces, the port will remain in 40-Gb mode. The subcommand nosignal-stay-in-
breakout-mode will force the port in breakout mode, even if there is no link signal detected, but will place
the interfaces in shutdown mode. The subcommand nosignal-stay-in-state-noshut will leave the port in
breakout mode but will place the four 10-Gb interface in no shutdown mode. The command ztp breakout
might not be supported on the ASR 9000 routers.
ztp clean removes all ZTP files saved on a disk.

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/.

Simple ZTP Example


The script shown in the graphic will unshut all the interfaces of the system and configure a load interval of
30 seconds on all of them.

¡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.

Boot with iPXE (Cont.)


After the router receives the DHCP response, the router will use the location identified in the response and
request the image file from the appropriate service. The server will then forward the requested image file to
the router. In this example, an HTTP server is being used to provide the image files.

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.

iPXE and ZTP DHCP Server Configuration (Cont.)


The graphic shows an example of a configuration. DHCP option 77 is used to identify iPXE clients, and the
URI is sent to DHCP clients by using option 67.

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

You might also like