Showing posts with label Cisco IOS. Show all posts
Showing posts with label Cisco IOS. Show all posts

Sunday, 10 November 2019

Backup Cisco IOS image to TFTP Server | Copy Image in Flask

Backup Cisco IOS image to TFTP Server | Copy Image in Flask

In this post we will explain how to Backup Cisco IOS image to TFTP Server or how to copy IOS Image in Router Flash. Using TFTP server you can take backup Cisco configurations and save Cisco Image as well.

TFTP SERVERS AS BACKUP LOCATION

As a network grows, the Cisco IOS software configuration images and files can be stored on a central TFTP server. This helps control the amount of IOS images and revisions to those IOS images, as well as the configuration files that must be maintained.
Production internetworks usually cover large areas and contain several routers. For any network, it is advisable to have a backup copy of the Cisco IOS software image in case the system image on the router is damaged or accidentally deleted.
Widely distributed routers need a source or backup location for Cisco IOS software images. The use of a network TFTP server allows uploads and downloads of the image and configuration through the network. The network TFTP server can be another router, a workstation or a host system.

Creating Cisco IOS Image Backup

To maintain network operations with minimal downtime, it is necessary to implement procedures to back up Cisco IOS images.

In following figure, the network administrator wishes to back up the current image file on the router ( c1900-universalk9-mz.SPA.152-4.M3.bin ) on the TFTP server at 172.16. 1,100. You can learn the Cisco IOS name convention here.
To back up the Cisco IOS image on a TFTP server, follow these three steps:

  • Step 1 . Make sure there is access to the network TFTP server. Ping the TFTP server to test connectivity.

R1 # ping 172.16.1.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.100, timeout is 2 
seconds:
!!!!!
Success rate is 100 percent (5/5),
round-trip min / avg / max = 56/56/56 ms

  • Step 2 . Verify that the TFTP server has enough disk space to support the Cisco IOS software image. Use the show flash0: command on the router to determine the size of the Cisco IOS image file. The sample file is 68831808 bytes in length.

R1 # show flash0:
- # - --length-- ----- date / time ------ path
8 68831808 Apr 2 2017 21:29:58 +00: 00 
            c1900-universalk9-mz.SPA.152-4.M3.bin

  • Step 3 . Copy the image to the TFTP server using the copy source-url destination-url command.
R1 # copy flash0: tftp: 
Source filename []? c1900-universalk9-mz.SPA.152-4.M3.bin
Address or name of remote host []? 172.16.1.100
Destination filename [c1900-universalk9-mz.SPA.152-4.M3.bin]?
Writing c1900-universalk9-mz.SPA.152-4.M3.bin ...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
68831808 bytes copied in 363,468 secs (269058 bytes / sec)
After issuing the command using the specified source and destination URLs, the user is requested to enter the name of the source file, the IP address of the remote host and the name of the destination file. Then the transfer starts.

Copying a Cisco IOS Image to TFTP Server

In this example, IPv6 is used for transfer, to show that TFTP can also be used over IPv6 networks.
Image illustrates how to copy an image of Cisco IOS software from a TFTP server. A new image file ( c1900-universalk9-mz.SPA.152-4.M3.bin ) will be copied from the TFTP server in 2001: DB8: CAFE: 100 :: 99 to the router.

Follow these steps to update the software on the Cisco router:

  • Step 1 . Select a Cisco IOS image file that meets the requirements in terms of platform, features and software. Download the file from cisco.com and transfer it to the TFTP server.
  • Step 2 . Verify connectivity to the TFTP server. Ping the TFTP server from the router.

R1 # ping 2001: DB8: COFFEE: 100 :: 99
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001: DB8: CAFE: 100 :: 99,
timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5),
round-trip min / avg / max = 56/56/56 ms


  • Step 3 . Make sure there is enough space in the flash memory on the router that is updated. You can check the amount of available flash memory using the show flash0: command .

R1 # show flash0:
- # - --length-- ----- date / time ------ path
182394880 bytes available (74092544 bytes used)
R1 #

  • Step 4 . Copy the IOS image file from the TFTP server to the router with the copy command .

After issuing this command with the specified destination and source URLs, the user will be asked to enter the IP address of the remote host, the name of the source file and the name of the destination file. File transfer will start.

BOOT SYSTEM COMMAND

To update the copied IOS image once that image is saved in the router's flash memory, configure the latter to load to a new image during boot using the boot system command.
Save the configuration . Reload the router to boot with the new image. Once you start the router, use the show version command to verify that the new image was loaded.
During boot, the bootstrap code analyzes the boot configuration file in the NVRAM to detect boot system commands that specify the name and location of the Cisco IOS software image to load. Several boot system commands can be entered sequentially to provide a boot plan that has fault tolerance.

  • As shown below, the boot system command is a global configuration command that allows the user to specify the source for the Cisco IOS software image to load.

R1 # configure terminal
R1 (config) # boot system 
 flash0: //c1900-universalk9-mz.SPA.152-4.M3.bin
R1 (config) # exit
R1 # copy running-config startup-config
R1 # reload
Among the available syntax options are the following:

  • Specify the flash device as the source of the Cisco IOS image:

Router (config) # boot system flash0: //c1900-universalk9-mz.SPA.152-4.M3.bin
Specify the TFTP server as the source of the Cisco IOS image, with ROMmon as backup.
Router (config) # boot system tftp: //c1900-universalk9-mz.SPA.152-4.M3.bin
If there are no boot system commands in the configuration, by default, the router loads and runs the first valid Cisco IOS image in flash memory.
Finally, as shown in Image, the show version command can be used to verify the software image file.

Cisco IOS Naming Convention T 12.0 to M 15.0

Cisco IOS Naming Convention T 12.0 to M 15.0

This chapter will give you a brief introduction about Cisco IOS Naming Convention. Cisco IOS (initial Internetwork Operating System) is software that is used in most Cisco routers and switches. IOS is a package of routing, switching, security and other internetworking technologies integrated in a single multitasking operating system. The Cisco IOS portfolio supports a wide range of technologies and features. Clients choose an IOS based on a group of protocols and features supported by a particular image. Understanding the Cisco IOS feature set portfolio is useful in selecting the right IOS to meet the needs of an organization. Cisco made significant changes to the IOS software packages and licenses by making the transition from IOS 12.4 to 15.0 .

Cisco IOS Software Release Families and Trains

Cisco IOS software evolved from a single platform operating system for routing to a sophisticated operating system that supports a broad array of features and technologies, such as VoIP, NetFlow and IPsec . To better meet the requirements of the different market segments, the software is organized into families of software versions and software streams. A family of software versions consists of several versions of the IOS software that have the following characteristics:

  • They share a code base.
  • They apply to related hardware platforms.
  • They overlap in compatibility coverage (when the life of an OS ends, another OS is introduced and supported).

Examples of Cisco IOS software versions, within a family of software versions, are 12.3, 12.4, 15.0 and 15.1 .
Along with each version of the software, there are new versions of the software created to implement bug fixes and new features. In IOS, these versions are called " trains ."
A Cisco IOS train is used to release versions with a common code base to a specific set of platforms and features. A train can contain several versions , and each version is a snapshot of the train code base at the time of launch. Because different families of software versions can be applied to various platforms or market segments, several trains can be in effect at any time.

Cisco IOS 12.4 Mainline and T Trains

The illustration shows the migration of software version 12.3 to 12.4. Within a family of software versions, there may be one or two closely related active trains.

The relationships between the version of the mainline train 12.4 and the 12.4T train of the Cisco IOS software are shown.
For example, the Cisco 12.4 IOS software family has two trains, 12.4T trains and 12.4 mainline trains.

Cisco IOS 12.4 TRAINS 

The Cisco 12.4 IOS software train is considered the mainline train. The mainline train receives mostly software corrections (errors) in order to improve its quality. The mainline train versions are also called " Maintenance Implementation (MD) versions ."
A mainline train is always associated with a technology train (T train). A T train, such as 12.4T, receives the same software bug fixes as the mainline train. The T train also receives new hardware and software compatibility features. The versions on the 12.4T train of Cisco IOS software are considered Early Deployment (ED) versions .
There may be other trains, depending on the family of the software version. For example, another available train is the service provider (train S) . An S train contains specific features designed to meet the requirements of service providers. All secondary trains on the mainline train (T, S, etc.) usually have an uppercase letter that designates the type of train.
Main Line Train = 12.4
T train: 12.4T 
(12.4 + new hardware and software compatibility features)
Until the family of version 12.4 of Cisco IOS software inclusive, the mainline trains and the T trains were separated.
In other words, from the mainline train, a T train branched out and became an independent code base that received new features and hardware compatibility. Over time, a new mainline train evolved from an established T train, and the cycle began again.
The use of several trains was modified with version 15 of the Cisco IOS software.

Cisco IOS 12.4 Mainline and T Numbering

The Cisco IOS version numbering convention is used to identify the version of the IOS software, including bug fixes and new software features. In the illustration, an example of the numbering scheme for the main line trains and for the T trains is shown:


  • The software version numbering scheme for a mainline train consists of a train number, a maintenance identifier and a collection identifier.

For example, version 12.4 (21a) of Cisco IOS software is a mainline train. The version for a train T consists of a train number, a maintenance identifier, a train identifier and a collection identifier. For example, version 12.4 (20) T1 of Cisco IOS software belongs to train 12.4T of Cisco IOS software.

  • Each maintenance identifier of the Cisco IOS 12.4 main line of software, such as 12.4 (7), includes additional maintenance and software fixes. This change is indicated by the number in parentheses.

Each maintenance release of Cisco 12.4T IOS software, such as 12.4 (20) T, includes these same software fixes, along with additional software features and hardware compatibility.

  • Cisco uses collections of an individual version to integrate corrections of important problems. A collection typically includes corrections for a limited number of software defects, known as warnings. It is indicated with a lowercase letter inside the parenthesis of the mainline trains or with a final number on other trains.

For example, version 12.4 (21) of Cisco IOS software received some warning fixes, and the resulting collection was named 12.4 (21a). Similarly, 12.4 (15) T8 is the eighth collection of 12.4 (15) T

SINGLE VERSION NUMBERS

A unique set of individual version numbers is used for all trains 12.4 of the Cisco IOS software. Maintenance version 12.4 and version 12.4T use a pool of individual version numbers that are shared throughout the family of version 12.4 of that software. Version 12.4 (6) T of the Cisco IOS software was followed by version 12.4 (7) T and version 12.4 (8) T. This allows the administrator to track changes made to the code.

CISCO IOS SYSTEM IMAGE PACKAGES 12.4

Prior to version 15.0 of Cisco IOS software, that software had eight packages for Cisco routers, as shown in the illustration.
The package scheme was introduced with the mainline train 12.3 of the Cisco IOS software, and was subsequently used on other trains. Image packages consist of eight IOS images, three of which are considered higher packages.
The five non-superior packages are as follows:

  1. IP Base : is the basic image of Cisco IOS software.
  2. Voice over IP : converging voice and data, VoIP, VoFR and IP telephony.
  3. Advanced Security : VPN and security features, including Cisco IOS firewall, IDS / IPS, IPsec, 3DES and VPN.
  4. Service provider services (SP) : Add SSH / SSL, ATM, VoATM and MPLS to Voice over IP.
  5. Base for companies : protocols for companies (Appletalk, IPX and IBM Support).

Three other superior packages offer additional combinations of IOS software features that address more complex network requirements.
All features are merged into the Advanced Enterprise Services package. This package integrates support for all routing protocols with Voice, Security and VPN capabilities:

  • Advanced Enterprise Services : complete feature set of Cisco IOS software
  • Enterprise Services : base for business and service provider services
  • Advanced IP Services : advanced security, service provider services and IPv6 support

CISCO 15.0 IOS M AND T TRAINS

After Cisco IOS version 12.4 (24) T, the next version of Cisco IOS software was 15.0.
IOS 15.0 provides several improvements to the operating system, for example:

  • New hardware and feature compatibility
  • Greater consistency of features with other major versions of IOS
  • Version of new features and more predictable collection programs
  • Compatibility policies for proactive individual versions
  • Simplified Version Numbering
  • Clearer migration and software implementation guidelines

As shown in the illustration, Cisco IOS 15.0 uses a different version model of traditional 12.4 independent T and mainline trains.

Instead of being divided into independent trains, the T 15 and mainline trains of the Cisco 15 IOS software will have extended maintenance version (EM version) and standard maintenance version (T version) . With the new IOS version model, the mainline versions of the Cisco 15 IOS are called " M trains ."
Starting with 15.0, new versions in the form of a T train are available approximately two to three times per year. EM versions are available approximately every 16 to 20 months . The T versions allow you to receive the Cisco feature more quickly, before the next EM version is available.
An EM version incorporates the feature and hardware compatibility of all previous T versions. This makes the latest versions of EM contain the total functionality of the train at the time of launch.

CISCO IOS TRAIN NUMBERING 15

The version numbering convention for IOS 15 allows you to identify the specific IOS version, including bug fixes and new software features, similar to families of previous IOS versions. The illustration shows examples of this convention for the EM version and the T version.

EXTENDED MAINTENANCE VERSION

The EM version is ideal for long-term maintenance , and allows customers to meet the requirements, implement the version and maintain it for an extended period. The mainline train incorporates features provided in previous versions and further improvements to incremental features and hardware compatibility.
The first maintenance collection (for bug fixes only, without new features or new hardware compatibility) of version 15.0 (1) M bears the number 15.0 (1) M1. Subsequent maintenance versions are defined by an increase in the maintenance collection number (e.g., M2, M3, etc.).

STANDARD MAINTENANCE VERSION

The T version is used for short deployment versions ideal for the latest features and hardware compatibility before the next version of EM is available. Version T provides regular error correction maintenance collections and critical error support for errors affecting the network, such as Product Security Incident Reporting Equipment (PSIRT) problems.
The first version of new features 15 T planned carries the version number 15.1 (1) T. The first maintenance collection (for bug fixes only, without new features or new hardware compatibility) of version 15.1 (1) T will bear the number 15.1 (1) T1. Later versions are defined by an increase in the maintenance collection number (e.g., T2, T3, etc.).

 IOS 15 SYSTEM IMAGE PACKAGES

The Cisco second generation integrated service router series (ISR G2) 1900, 2900 and 3900 support services on demand through the use of software licenses.
The Services on demand process allows customers to achieve operational savings through ease of ordering and software management. When an order for a new Cisco G2 ISR platform is placed, the router ships with a unique and universal image of Cisco IOS software, and a license is used to enable specific feature set packages, as shown in Image:

There are two types of universal images supported in ISR G2:

  • Universal images with the designation “universalk9” in the name of the image : this universal image offers all the features of Cisco IOS software, including secure content cryptography features, such as IPsec VPN, SSL VPN and secure unified communications.
  • Universal images with the designation “universalk9_npe” in the name of the image : secure compliance with the encryption capabilities provided by Cisco Software Activation meets the requirements for exporting encryption capabilities.

Some countries have import requirements that require that the platform does not support any secure cryptography functionality, such as content cryptography.
With the ISR G2 devices, the selection of the IOS image was facilitated, because all the features within the universal image are included. The features are activated by licenses (product activation key - PAK). Each device ships with universal image.
Figure shows the suggested migration for the next generation ISRs from IOS 12 (IOS reform packages) to IOS 15 (simplified packages).

IOS IMAGE FILE NAMES

The Cisco IOS image file is based on a special naming convention. The name of the Cisco IOS image file contains several parts, each with a specific meaning. It is important to understand this naming convention when updating and selecting a Cisco IOS software.
As shown in Image 8, the show flash command shows files stored in flash memory, including system image files.

IMAGE NAME FOR IOS 12.4

In Image, an example of an image name of the IOS 12.4 software is shown.


  • Image name (c2800nm) : Identifies the platform on which the image is executed. In this example, the platform is a Cisco 2800 router with a network module.
  • advipservicesk9 : Specify the feature set. In this example, advipservicesk9 refers to the Advanced IP Services feature set, which includes the service provider and advanced security packages along with IPv6.
  • mz : indicates where the image is executed and if the file is compressed. In this example, "mz" indicates that the file runs from RAM and is compressed.
  • 124-6.T : indicates the format of the file name for image 12.4 (6) T. This is the train number, the maintenance version number and the train identifier.
  • bin : the file extension. This extension indicates that this is an executable binary file.

IMAGE NAME FOR IOS 15

In following Image, the different parts of an IOS 15 system image file in an ISR G2 device are illustrated:


  • Image name (c1900) : Identifies the platform on which the image is executed. In this example, the platform is a Cisco 1900 router.
  • universalk9 : specifies the designation of the image. The two designations for an ISR G2 are universalk9 and universalk9_npe. Universalk9_npe does not contain secure encryption and is intended for countries with encryption restrictions. Features are controlled by licenses and can be divided into four technology packages: IP Base, Security, Unified Communications and Data.
  • mz : indicates where the image is executed and if the file is compressed. In this example, "mz" indicates that the file runs from RAM and is compressed.
  • SPA : indicates that the file is digitally signed by Cisco.
  • 152-4.M3 : Specifies the format of the file name for image 15.2 (4) M3. This is the IOS version, which includes the numbers of the main version, the secondary version, the maintenance version and the maintenance collection. The M indicates that it is an extended maintenance version.
  • bin : the file extension. This extension indicates that this is an executable binary file.

MEMORY LOCATION AND COMPRESSION FORMAT

The most common designation for memory location and compression format is mz . The first letter indicates the location where the image is executed on the router. The locations may include the following:

  • f : flash
  • m : RAM
  • r : ROM
  • l : relocatable

The compression format can be z for zip or x for mzip. File compression is a method that Cisco uses to compress some images executed from RAM that is effective in reducing image size. It decompresses itself, so that when the image is loaded into RAM to run, the first action is decompression.

MEMORY REQUIREMENTS

On most Cisco routers, even on integrated service routers, the IOS is stored in CompactFlash memory as a compressed image and loaded into the DRAM during startup.
The Cisco IOS software version 15.0 images available for Cisco 1900 and 2900 ISRs require 256 MB of flash memory and 512 MB of RAM. The ISR 3900 requires 256 MB of flash memory and 1 GB of RAM. This does not include additional management tools, such as Cisco Configuration Professional (Cisco CP). For complete details, see the product data sheet for the specific router.

Tuesday, 22 October 2019

How to Take Backup of Cisco Configuration and IOS

How to Take Backup of Cisco Configuration and IOS

The main task in Cisco Device maintenance is take the backup of its software. This tutorial is about How to Take Backup of Cisco Configuration and IOS. Device maintenance includes making sure that a backup copy of the Cisco IOS configuration files and images is in a secure location in case the device memory is corrupted or deleted, either for malicious reasons or involuntary Maintenance also includes keeping the IOS image up to date.
For taking backup of Cisco device you must have an understanding of its file system and different types of storage. Following are the file systems and different memory storage:

  1. Router file systems
  2. Switch File Systems
  3. Creating backup copies and restoring using text files
  4. Creating backup copies and restoring TFTP
  5. Using USB ports on a Cisco router
  6. Backup and restore creation via USB
  7. Password Recovery
  8. Cisco IOS system files
  9. IOS image management
    • TFTP servers as backup location
    • Backup IOS images on a TFTP server
    • Copy an IOS image to a device
    • The boot system command

Router file systems

The Cisco IOS file system (IFS) allows the administrator to browse through different directories, list the files in one of them and create subdirectories in flash memory or on a disk. The directories available depend on the device.

Image 1 shows the result of the show file systems command  , which lists all the file systems available on a Cisco 1941 router. This command provides useful information, such as the amount of available and free memory, the type of file system and permissions. . Permissions include read only (ro), write only (wo) and read and write (rw), which are shown in the Flags column of the command result.
While several file systems are listed, we will focus on the TFTP, flash and NVRAM file systems.

THE FLASH FILE SYSTEM

Image 2 shows the output of the dir  (directory) command  . Since flash is the default file system, the dir  command  lists the flash content. Several files are located in flash memory, but the one of most interest specifically is the last one on the list is the name of the current Cisco IOS image file that runs in RAM.

THE NVRAM FILE SYSTEM

To view the contents of NVRAM memory, you must change the current default file system with the cd  (change directory) command  , as shown in Image 3. The pwd  (current working directory) command  verifies that we are viewing the directory NVRAM Finally, the dir command   includes the content of NVRAM in a list. While several configuration files are listed, the one of particular interest is the startup configuration file.

Switch File Systems

With the Cisco 2960 switch flash file system, you can copy the configuration files and archive (upload and download) software images.
The command to view file systems on a Catalyst switch is the same as the one used on Cisco routers:  show file systems , as shown in the illustration.

Creating backup copies and restoring using text files

Configuration files can be saved or archived in a text file using Tera Term.
As shown in the figure, the steps are:

  • Step 1:  On the File menu, click  Log .
  • Step 2 . Choose the location to save the file. Tera Term will start capturing text.
  • Step 3.  Once the capture begins, execute the show running-config  or  show startup-config command   on the privileged EXEC entry request. The text that appears in the terminal window will go to the chosen file.
  • Step 4 . When the capture is complete, select  Close  in the Log window of TeraTerm.
  • Step 5 . Look at the file to verify that it is not damaged.

RESTORING TEXT SETTINGS

A configuration can be copied from a file to a device. When copied from a text file and pasted into a terminal window, the IOS executes each line of the configuration text as if it were a command. This means that the file will need editing to ensure that the encrypted passwords are in the form of text and that IOS messages and non-command text, such as “–More–“, are deleted. This process is analyzed in laboratory practice.
In turn, in the CLI, the device must be set to the global configuration mode to receive the commands from the text file that are pasted into the terminal window.
When Tera Term is used, the steps are as follows:

  • Step 1:  On the File menu, click  Send  to send the file.
  • Step 2 . Locate the file you should copy on the device and click  Open .
  • Step 3.  Tera Term will paste the file into the device.

The text in the file will be applied as commands in the CLI and will become the configuration running on the device. This is a convenient method to manually configure a router.

Creating backup copies and restoring TFTP

Copies of the configuration files should be stored as backup files in case of a problem. The configuration files can be stored on a trivial file transfer protocol (TFTP) server or on a USB drive. A configuration file should also be included in the network documentation.
To save the running configuration or startup configuration on a TFTP server, use the copy running-config tftp  or  copy startup-config tftp command  , as shown below:
R1 # copy running-config tftp
Remote host []? 192.168.10.254
Name of the configuration file to write [R1-config]? R1-Jan-2017
Write file R1-Jan-2017 to 192.168.10.254? [confirm]
Writing R1-Jan-2017 !!!!!! [OKAY]
Follow these steps to back up the running configuration on a TFTP server:

  • Step 1:  Enter the copy running-config tftp command  .
  • Step 2 . Enter the IP address of the host where the configuration file will be stored.
  • Step 3.  Enter the name to be assigned to the configuration file.
  • Step 4 . Press Enter to confirm each choice.

RESTORE CONFIGURATIONS VIA TFTP

To restore the running configuration or startup configuration from a TFTP server, use the copy tftp running-config  or  copy tftp startup-config command  . Follow these steps to restore the running configuration from a TFTP server:

  • Step 1:  Enter the copy tftp running-config command  .
  • Step 2 . Enter the IP address of the host where the configuration file is stored.
  • Step 3.  Enter the name to be assigned to the configuration file.
  • Step 4 . Press  Enter  to confirm each choice.

Using USB ports on a Cisco router

The USB flash feature provides optional secondary storage capacity and an additional boot device. Images, settings and other files can be copied to Cisco USB flash memory and from it with the same reliability with which files are stored and retrieved with a Compact Flash card. In addition, modular integrated service routers can boot with any image of Cisco IOS software stored in USB flash memory. Ideally, the USB flash memory can contain multiple copies of the Cisco IOS configurations and several router configurations.

Use the dir command to view the contents of the USB flash drive, as shown in the figure.

Router # dir usbflash0:
Directory of usbflash0: /
1 -rw- 30125020 Dec 22 2032 05:31:32 +00: 00
c3825-entservicesk9-mz.123-14.T
63158272 bytes total (33033216 bytes free)

Backup and restore creation via USB

When making backup copies on a USB port, it is recommended to issue the show file systems command   to verify that the USB drive is present and confirm the name, as shown in Image 7.

Then use the copy run usbflash0: / command   to copy the configuration file to the USB flash drive. Be sure to use the name of the flash drive as indicated in the file system. The bar is optional, but indicates the root directory of the USB flash drive.
The IOS will request the file name. If the file already exists on the USB flash drive, the router will request the overwrite confirmation, as seen below:
R1 # copy running-config usbflash0:
Destination filename [running-config]? R1-Config
5024 bytes copied in 0.736 secs (6826 bytes / sec)
R1 # copy running-config usbflash0:
Destination filename [running-config]? R1-Config
% Warning: There is a file already existing with this name
Do you want to over write? [confirm]
5024 bytes copied in 1,796 secs (2797 bytes / sec)
Use the dir command   to view the file on the USB drive, and the more command   to view the content, as shown in Image 8.

RESTORE SETTINGS USING A USB FLASH DRIVE

To copy the file again, it will be necessary to edit the R1-Config file of the USB drive with a text editor. If we assume that the file name is  R1-Config , use the copy usbflash0: / R1-Config  boot-configuration command   to restore a running configuration.

Password Recovery

Device passwords are used to prevent unauthorized access. Encrypted passwords, such as passwords generated by enable secret, must be replaced after recovery. According to the device, the detailed procedure for password recovery varies; However, all password recovery procedures follow the same principle:

  • Step 1 : Enter ROMMON mode.
  • Step 2 . Change the configuration log to 0x2142 to ignore the startup configuration file.
  • Step 3.  Make the necessary changes to the original startup configuration file.
  • Step 4 : Save the new configuration.

For password recovery, access to the device console through a terminal or terminal emulator software on a PC is required. The terminal configurations to access the device are:

  • 9600 baud rates
  • No parity
  • 8 bits of data
  • 1 stop bit
  • No flow control

With access to the console, the user can access the ROMMON mode by an interruption sequence during the boot process or by removing the external flash memory when the device is turned off.

Cisco ROMMON Mode

Cisco ROMMON Mode supports some basic commands, such as  confreg . The confreg 0x2142 command   allows the user to define the configuration register at 0x2142. With the configuration register at 0x2142, the device will ignore the startup configuration file during startup. The startup configuration file is where forgotten passwords are stored. After setting the configuration log to 0x2142, type  reset  in the input request to restart the device. Enter the interrupt sequence while the device is restarting and decompressing the IOS. Below is the terminal output of a 1941 router in ROMMON mode after using an interrupt sequence during the boot process.

Readonly ROMMON initialized
 
monitor: command "boot" aborted due to user interrupt
rommon 1> confreg 0x2142
rommon 2> reset
 
System Bootstrap, Version 15.0 (1st) M9, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 2010 by cisco Systems, Inc.
<the result was omitted>
When the device has finished recharging, copy the boot configuration to the running configuration:
# Copy startup-config running-config router
Destination filename [running-config]?
 
1450 bytes copied in 0.156 secs (9295 bytes / sec)
Router # conf t
Enter configuration commands, one per line. End with CNTL / Z.
Router (config) # enable secret cisco 
Router (config) # config-register 0x2102 
Router (config) # end 
Router # copy running-config startup-config
Destination filename [startup-config]?
Building configuration ...
[OKAY]
# Reload router

Since you are in privileged EXEC mode, you can now configure all necessary passwords. Once the new passwords are configured, change the configuration register back to 0x2102 with the config-register 0x2102 command   in global configuration mode. Save running-config in startup-config and reload the device.
The device now uses the newly configured authentication passwords. Remember to use the show commands   to verify that all settings are still valid. For example, verify that the appropriate interfaces are not turned off after recovering the password.

Cisco IOS system files

The Cisco second generation integrated service router series (ISR G2) 1900, 2900 and 3900 support services on demand through the use of software licenses. The Services on demand process allows customers to achieve operational savings through ease of ordering and software management. When an order for a new Cisco G2 ISR platform is placed, the router ships with a unique and universal image of Cisco IOS software, and a license is used to enable specific feature set packages.
There are two types of universal images supported in ISR G2:

  • Universal images with the designation "universalk9" in the name of the image  - This universal image offers all the features of Cisco IOS software, including strong payload cryptography features such as IPsec VPN, SSL VPN and Secure Unified Communications.
  • Universal images with the designation “universalk9_npe” in the name of the image  - The strong imposition of encryption capabilities provided by Cisco Software Activation satisfies the requirements for the export of encryption functionalities. However, some countries have import requirements that require that the platform does not support any secure cryptography functionality, such as content cryptography. To satisfy the import requirements of these countries, the universal image npe does not support any encryption of secure content.

IOS IMAGE FILE NAMES

When selecting or updating a router with Cisco IOS, it is important to choose the appropriate IOS image with the correct feature set and version. The Cisco IOS image file is based on a special naming convention and contains several parts, each with a specific meaning.

As shown below, the show flash command   shows files stored in flash memory, including system image files.

R1 # show flash0:
- # - --length-- ----- date / time ------ path

8 68831808 Apr 2 2013 21:29:58 +00: 00 c1900- 
universalk9-mz.SPA.152-4.M3.bin

182394880 bytes available (74092544 bytes used)


  • Image name (c1900):  Identifies the platform on which the image is executed. In this example, the platform is a Cisco 1900 router.
  • universalk9:  specifies the designation of the image. The two designations for an ISR G2 are universalk9 and universalk9_npe. Universalk9_npe does not contain secure encryption and is intended for countries with encryption restrictions. Features are controlled by licenses and can be divided into four technology packages. These are IP Base, Security, Unified Communications and Data.
  • mz:  Indicates where the image is executed and if the file is compressed. In this example, mz indicates that the file is running from RAM and that it is compressed.
  • SPA:  indicates that the file is digitally signed by Cisco.
  • 152-4.M3:  Specifies the format of the file name for image 15.2 (4) M3. This is the IOS version, which includes the numbers of the main version, the secondary version, the maintenance version and the maintenance collection. The M indicates that it is an extended maintenance version.
  • bin:  The file extension. This extension indicates that this file is a binary executable file.

LOCATION AND FORMAT

The most common designation for memory location and compression format is mz. The first letter indicates the location where the image is executed on the router. The locations may include the following:

  • F:  flash
  • m:  RAM
  • r:  ROM
  • l:  Relocatable

The compression format can be z for zip ox for mzip. File compression is a method that Cisco uses to compress some images executed from RAM that is effective in reducing image size. It decompresses itself, so that when the image is loaded into RAM to run, the first action is decompression.

Cisco IOS image management

TFTP servers as backup location

As a network grows, the Cisco IOS software configuration images and files can be stored on a central TFTP server. This helps control the amount of IOS images and revisions to those IOS images, as well as the configuration files that must be maintained.
Production internetworks usually cover large areas and contain several routers. For a network, it is advisable to keep a backup copy of the Cisco IOS software image in case the system image on the router is corrupted or accidentally deleted.

Widely distributed routers need a source or backup location for Cisco IOS software images. Using a network TFTP server allows you to upload and download images and settings over the network. The TFTP server on the network can be another router, a workstation or a host system.

Backup IOS images on a TFTP server

To maintain network operations with minimal downtime, it is necessary to implement procedures to back up Cisco IOS images. This allows the network administrator to quickly copy an image to a router in case the image is damaged or deleted.

In Image 12, the network administrator wishes to back up the current image file on the router (c1900-universalk9-mz.SPA.152-4.M3.bin) on the TFTP server at 172.16.1.100.
To back up the Cisco IOS image on a TFTP server, follow these three steps:

  • Step 1 : Ensure that there is access to the network TFTP server. Ping the TFTP server to test connectivity, as shown:

R1 # ping 172.16.1.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.100, timeout is 2 
seconds: !!!!!
Success rate is 100 percent (5/5),
bround-trip min / avg / max = 56/56/56 ms

  • Step 2 : Verify that the TFTP server has enough disk space to support the Cisco IOS software image. Use the show flash0: command on the router to determine the size of the Cisco IOS image file. The sample file is 68831808 bytes in length.

R1 # show flash0:
- # - --length-- ----- date / time ------ path
8 68831808 Apr 2 2013 21:29:58 +00: 00 
 c1900-universalk9-mz.SPA.152-4.M3.bin

  • Step 3 : Copy the image to the TFTP server with the copy url-source url-destination command:

R1 # copy flash0: tftp:
Source filename []? c1900-universalk9-mz.SPA.152-4.M3.bin
Address or name of remote host []? 172.16.1.100
Destination filename [c1900-universalk9-mz.SPA.152-4.M3.bin]?
Writing c1900-universalk9-mz.SPA.152-4.M3.bin ...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
68831808 bytes copied in 363,468 secs (269058 bytes / sec)
After issuing the command using the specified source and destination URLs, the user is requested to enter the name of the source file, the IP address of the remote host and the name of the destination file. Then the transfer starts.

Copy an IOS image to a device

Cisco systematically releases new versions of Cisco IOS software to resolve warnings and provide new features. In this example, IPv6 is used for transfer, to show that TFTP can also be used over IPv6 networks.

Image 13 illustrates how to copy an image of Cisco IOS software from a TFTP server. A new image file (c1900-universalk9-mz.SPA.152-4.M3.bin) will be copied from the TFTP server in 2001: DB8: CAFE: 100 :: 99 to the router.
Follow these steps to update the software on the Cisco router:

  • Step 1:  Select a Cisco IOS image file that meets the requirements in terms of platform, features and software. Download the file from cisco.com and transfer it to the TFTP server.
  • Step 2:  Verify connectivity to the TFTP server. Ping the TFTP server from the router:

R1 # ping 2001: DB8: COFFEE: 100 :: 99
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001: DB8: CAFE: 100 :: 99,
timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), 
round-trip min / avg / max = 56/56/56 ms

  • Step 3:  Make sure there is enough space in the flash memory on the router that is updated. You can check the amount of available flash memory using the show flash0: command  . Compare the available space in flash memory with the size of the new image file. In the example, the available space in flash memory is 182,394,880 bytes.

R1 # show flash0:
- # - --length-- ----- date / time ------ path
 182394880 bytes available (74092544 bytes used)

  • Step 4:  Copy the IOS image file from the TFTP server to the router with the copy command  . After issuing this command with the specified destination and source URLs, the user will be asked to enter the IP address of the remote host, the name of the source file and the name of the destination file. File transfer will start.

R1 # copy tftp: flash0:
Address or name of remote host []? 2001: DB8: CAFE: 100 :: 99
Source filename []? c1900-universalk9-mz.SPA.152-4.M3.bin
Destination filename []? 
c1900-universalk9-mz.SPA.152-4.M3.bin
Accessing tftp: // 2001: DB8: CAFE: 100 :: 99 / c1900-universalk9-
mz.SPA.152-4.M3.bin ...
Loading c1900-universalk9-mz.SPA.152-4.M3.bin
from 2001: DB8: CAFE: 100 :: 99 (via
GigabitEthernet0 / 0): !!!!!!!!!!!!!!!!!!!!

[OK - 68831808 bytes]
68831808 bytes copied in 368.128 secs (265652 bytes / sec)

The boot system command

To update the copied IOS image after saving the image in the router's flash memory, configure the router to load the new image during startup; To do this, use the boot system command  . Save the configuration. Reload the router to boot with the new image. Once the router is started, use the show version command   to confirm that the new image has been loaded.
R1 # configure terminal
R1 (config) # boot system 
 flash0: //c1900-universalk9-mz.SPA.152-4.M3.bin
R1 (config) # exit
R1 # copy running-config startup-config
R1 # reload
R1 # show version
Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), 
Version 15.2 (4) M3 , RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2013 by Cisco Systems, Inc.
Compiled Tue 26-Feb-13 02:11 by prod_rel_team

ROM: System Bootstrap, Version 15.0 (1st) M15, RELEASE SOFTWARE
(fc1)

R1 uptime is 1 hour, 2 minutes
System returned to ROM by power-on
System image file is "flash0:
c1900-universalk9-mz.SPA.152-4.M3.bin "
During boot, the bootstrap code analyzes the boot configuration file in the NVRAM to detect boot system commands   that specify the name and location of the Cisco IOS software image to load. Several boot system commands can be entered   sequentially to provide a boot plan that has fault tolerance.

If there are no boot system commands   in the configuration, by default, the router loads and runs the first valid Cisco IOS image in flash memory.

Monday, 21 October 2019

Cisco Discovery Protocol CDP vs LLDP

Cisco Discovery Protocol CDP vs LLDP

Cisco Discovery Protocol CDP is a Cisco proprietary protocol for network detection at the data link layer. You can share information such as device names and IOS versions with other physically connected Cisco devices. LLDP is a neutral protocol in the data link layer for network detection. Network devices advertise information, such as identities and functionalities to their neighbors.

Device Detection with CDP

Cisco Discovery Protocol (CDP) is a proprietary Cisco Layer 2 protocol that is used to collect information about Cisco devices that share the same data link. The CDP is independent of media and protocol and runs on all Cisco devices, such as routers, switches and access servers.
The device sends periodic CDP announcements to the connected devices, as shown in Image 1. These messages share information about the type of device being discovered, the name of the devices, and the number and type of interfaces.

Because most network devices connect to other devices, the CDP can help make design decisions, solve problems, and make changes to the equipment. The CDP can be used as a network analysis tool to learn about neighboring devices. This information collected from the CDP can help create a logical topology of a network when documentation or details are missing.

CDP CONFIGURATION

For Cisco devices, CDP is enabled by default. For security reasons, it may be convenient to disable the CDP on a network device globally, or by interface. With the CDP, an attacker can collect valuable information about the network design, such as IP addresses, IOS versions, and device types.
To verify the status of CDP and display information about CDP, enter the show cdp command  , as follows:
Router # show cdp
Global CDP information:
 Sending CDP packets every 60 seconds
 Sending a holdtime value of 180 seconds
 Sending CDPv2 advertisements is enabled
To enable CDP globally for all supported interfaces on the device, enter cdp run in global configuration mode. CDP can be disabled for all device interfaces with the no
cdp run command , in global configuration mode.
To disable CDP on a specific interface, such as the one that comes in contact with an ISP, enter  no cdp enable  in the interface configuration mode. The CDP is still enabled on the device; however, no more messages will be sent to the interface. To re-enable CDP on the specific interface, enter  cdp enable , as shown:
Switch (config) # interface gigabitethernet 0/1 
Switch (config-if) # cdp enable
Below is a globally disabled CDP using the no cdp run  command  and re-enabled with the cdp run command  .
Router (config) # no cdp run
Router (config) # exit
Router # show cdp
% CDP is not enabled
Router # conf t
Router (config) # cdp run

CDP VERIFICATION

To verify the status of CDP and display a list of its adjacent components, use the show cdp neighbors command  , in EXEC mode with privileges. The show cdp neighbors command   shows important information about adjacent CDP components. Currently, this device has no adjacent component because it is not physically connected to any other device:
Router # show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
                  D - Remote, C - CVTA, M - Two-port Mac Relay
 
Device ID Local Intrfce Holdtme Capability Platform Port ID
Use the show cdp interface command   to display the interfaces that are enabled in CDP on the device. The status of each interface is also shown. The following result shows that five interfaces are enabled for CDP on the router with only one active connection to another device.

Router # show cdp interface
Embedded-Service-Engine0 / 0 is administratively down, line protocol is down
 ARPA encapsulation
 Sending CDP packets every 60 seconds
 Holdtime is 180 seconds
GigabitEthernet0 / 0 is administratively down, line protocol is down
 ARPA encapsulation
 Sending CDP packets every 60 seconds
 Holdtime is 180 seconds
GigabitEthernet0 / 1 is up, line protocol is up
 ARPA encapsulation
 Sending CDP packets every 60 seconds
 Holdtime is 180 seconds
Serial0 / 0/0 is administratively down, line protocol is down
 Encapsulation HDLC
 Sending CDP packets every 60 seconds
 Holdtime is 180 seconds
Serial0 / 0/1 is administratively down, line protocol is down
 Encapsulation HDLC
 Sending CDP packets every 60 seconds
 Holdtime is 180 seconds

DEVICE DETECTION WITH CDP

With the CDP enabled on the network, the show cdp neighbors command   can be used to determine the design of the network.

For example, consider the lack of documentation in the topology of Image 2. There is no information available related to the rest of the network.
1 # show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
 S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
 D - Remote, C - CVTA, M - Two-port Mac Relay
The show cdp neighbors command   provides useful information about each adjacent CDP device, such as the following data:

  • Device identifiers  - The host name of the adjacent device (S1).
  • Port Identifier  - The name of the local and remote ports (Gig 0/1 and Fas 0/5, respectively).
  • Function list  - Indicates whether the device is a router or a switch (S for switch; I for IGMP is beyond the scope of this course).
  • Platform  - The device hardware platform (WS-C2960 for the Cisco 2960 switch).

VIEW DETAILED INFORMATION ABOUT CDP

If more information is needed, the detailed show cdp neighbors command   can also provide information, such as the IOS version and IPv4 addresses of adjacent components, as follows:
R1 # show cdp neighbors detail
-------------------------
Device ID: S1
Entry address (s):
 IP address: 192.168.1.2
Platform: cisco WS-C2960-24TT-L, Capabilities: Switch IGMP
Interface: GigabitEthernet0 / 1, Port ID (outgoing port): FastEthernet0 / 5
Holdtime: 136 sec
 
Version:
Cisco IOS Software, C2960 Software (C2960-LANBASEK9-M), Version 15.0 (2) SE7 ,
RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Thu 23-Oct-14 14:49 by prod_rel_team
 
advertisement version: 2
Protocol Hello: OUI = 0x00000C, Protocol ID = 0x0112; payload len = 27,
value = 00000000FFFFFFFF010221FF000000000000002291210380FF0000
VTP Management Domain: ''
Native VLAN: 1
Duplex: full
Management address (s):
 IP address: 192.168.1.2
 
Total cdp entries displayed: 1

S2 DETECTION

By accessing S1 either remotely via SSH or physically through the console port, a network administrator can determine which other devices are connected to S1, as indicated in the show cdp command output  neighbors.

S1 # show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
 S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
 D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID Local Intrfce Holdtme Capability Platform Port ID
S2 Fas 0/4 158 SI WS-C2960-   Fas 0/4 
R1 Fas 0/5 136 RBSI CISCO1941   Gig 0/1

TOPOLOGY COMPLETION

Another switch, S2, is revealed in the result. The network administrator then has access to S2 and displays the adjacent CDP components, as indicated in Image 5. The only device connected to S2 is S1. Therefore, there are no more devices to discover in the topology. The network administrator can now update the documentation to reflect the detected devices.

S2 # show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
 S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone,
 D - Remote, C - CVTA, M - Two-port Mac Relay

Device ID Local Intrfce Holdtme Capability Platform Port ID
S1 Fas 0/4 173 SI WS-C2960-   Fas 0/4

DEVICE DETECTION WITH LLDP

Cisco devices also support the Link Layer Detection Protocol (LLDP), which is a neutral protocol for adjacent component detection similar to CDP. The LLDP works with network devices, such as routers, switches, and wireless LAN access points. This protocol informs your identity and capabilities to other devices and receives information from a physically connected Layer 2 device.

 LLDP CONFIGURATION

On some devices, LLDP may be enabled by default. To enable LLDP globally on a Cisco network device, enter the lldp run command   in global configuration mode. To disable LLDP, enter the no lldp run command   in global configuration mode.
Like the CDP, the LLDP can be configured on specific interfaces. However, LLDP must be individually configured to transmit and receive LLDP packets, as indicated:

Switch # conf t
Enter configuration commands, one per line. End with CNTL / Z.
Switch (config) # lldp run
Switch (config) # interface gigabitethernet 0/1
Switch (config-if) # lldp transmit 
Switch (config-if) # lldp receive
Switch # show lldp

Global LLDP Information:
 Status: ACTIVE
 LLDP advertisements are sent every 30 seconds
 LLDP hold time advertised is 120 seconds
 LLDP interface reinitialisation delay is 2 seconds

LLDP VERIFICATION

To verify that LLDP has already been enabled on the device, enter the show lldp command in privileged EXEC mode.
Show the status of LLDP on R1.
R1 # show lldp
 % LLDP is not enabled
 R1 #
Enter global configuration mode to configure the following:

  • Activate LLDP globally on R1.
  • Disable LLDP on the S0 / 0/0 interface.
  • Use the end command to exit global configuration mode.

R1 # configure terminal
 R1 (config) # lldp run
 R1 (config) # interface s0 / 0/0
 R1 (config-if) # no lldp run
 R1 (config-if) # end
 R1 #
Display the list of neighbors with LLDP on S1.
S1 # show lldp neighbors
 Capability codes:
 (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
 (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other

Device ID Local Intf Hold-time Capability Port ID
 R1 Fa0 / 5 99 R Gi0 / 1

Show more details of the list of neighbors with LLDP on R1.
S1 # show lldp neighbors detail

------------------------------------------------
 Chassis id: c471.fe45.73a0
 Port id: Gi0 / 1
 Port Description: GigabitEthernet0 / 1
 System Name: R1

System Description:
 Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.4 (3) M2, 
RELEASE SOFTWARE (fc2)
 Technical Support: http://www.cisco.com/techsupport
 Copyright (c) 1986-2015 by Cisco Systems, Inc.
 Compiled Fri 06-Feb-15 17:01 by prod_rel_team

Time remaining: 106 seconds
 System Capabilities: B, R
 Enabled Capabilities: R
 Management Addresses - not advertised
 Auto Negotiation - not supported
 Physical media capabilities - not advertised
 Media Attachment Unit type - not advertised
 Vlan ID: - not advertised

Total entries displayed: 1

DEVICE DETECTION WITH LLDP

With LLDP enabled, components adjacent to the device can be detected using the show lldp neighbors command  . For example, consider the lack of documentation in the topology of Image 7. The network administrator only knows that S1 is connected to two devices. If you use the show lldp neighbors command  , the network administrator detects that S1 has a router and a switch as adjacent components.

S1 # show lldp neighbors
Capability codes:
 (R) Router, (B) Bridge, (T) Telephone, (C) DOCSIS Cable Device
 (W) WLAN Access Point, (P) Repeater, (S) Station, (O) Other
 
Device ID Local Intf Hold-time Capability Port ID
R1 Fa0 / 5 99 R Gi0 / 1
S2 Fa0 / 4 120 B Fa0 / 4

Total entries displayed: 2
From the results of  show lldp neighbors , a topology of switch S1 can be constructed as illustrated in Image 8. When more details are needed on adjacent components, the show lldp neighbors detail command   can provide information such as the IOS version , the IP address and functionality of adjacent devices.


S1 # show lldp neighbors detail
------------------------------------------------
Chassis id: fc99.4775.c3e0
Port id: Gi0 / 1
Port Description: GigabitEthernet0 / 1
System Name: R1
 
System Description:
Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.4 (3) M2, 
 RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Fri 06-Feb-15 17:01 by prod_rel_team
 
Time remaining: 101 seconds
System Capabilities: B, R
Enabled Capabilities: R
Management Addresses: 
IP: 192.168.1.1
Auto Negotiation - not supported
Physical media capabilities - not advertised
Media Attachment Unit type - not advertised
Vlan ID: - not advertised
 
------------------------------------------------
Chassis id: 0cd9.96d2.3f80
Port id: Fa0 / 4
Port Description: FastEthernet0 / 4
System Name: S2
<the result was omitted>