Exploring Command Aliases

You can define command aliases to replace frequently used commands. The command aliases can represent all or part of the command syntax. Command aliases are global and enabled for all user sessions on an NX-OS device and persist across reboots if you save them to the startup configuration. You can define command aliases for commands in any command mode. Command alias translation always takes precedence over any keyword in any configuration mode or submode.

Example 2-14 illustrates command alias configuration and verification.

Example 2-14 Command Alias

Click here to view code image

! Configuring wr as alias for
copy running-config startup-config
 command.
N9K#
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
N9K(config)#
cli alias name wr copy running-config startup-config

N9K(config)#
exit
N9K#
show running-config
 |
include alias
cli alias name wr copy running-config startup-config
! Using alias
wr
 to save running config to starup-config
N9K#
wr
[########################################] 100%
Copy complete, now saving to disk (please wait)…
Copy complete.
N9K#
show startup-config
 |
include alias
cli alias name wr copy running-config startup-config
N9K#

Exploring Device Hardware and Software

You can use the show version command to determine the software version and device model number, as shown in Example 2-15.

Example 2-15 Show Version Command

Click here to view code image

! Under the software section of
show version
 command, you can see that the software
version of NX-OS installed is 9.3(5) version and under the hardware section of the
output, you can see that the device model is C93180YC-FX.

N9K#
show version
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright (C) 2002-2020, Cisco and/or its affiliates.
All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under their own
licenses, such as open source. This software is provided “as is,” and unless
otherwise stated, there is no warranty, express or implied, including but not
limited to warranties of merchantability and fitness for a particular purpose.
Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or
GNU General Public License (GPL) version 3.0 or the GNU
Lesser General Public License (LGPL) Version 2.1 or
Lesser General Public License (LGPL) Version 2.0.
A copy of each such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://opensource.org/licenses/gpl-3.0.html and
http://www.opensource.org/licenses/lgpl-2.1.php and
http://www.gnu.org/licenses/old-licenses/library.txt.

Software
  BIOS: version 05.45
NXOS: version
9.3(5)
  BIOS compile time: 07/05/2021
  NXOS image file is: bootflash:///nxos.9.3.5.bin
  NXOS compile time: 7/20/2020 20:00:00 [07/21/2020 06:30:11]

Hardware
  cisco Nexus9000 C93180YC-FX Chassis
  Intel(R) Xeon(R) CPU D-1528 @ 1.90GHz with 24569356 kB of memory.
  Processor Board ID FDO23510ELW
  Device name: N9K
  bootflash: 115805708 kB
Kernel uptime is 1 day(s), 1 hour(s), 44 minute(s), 43 second(s)
Last reset at 298285 usecs after Mon Nov 8 08:55:23 2021
  Reason: Reset Requested by CLI command reload
  System version: 9.3(5)
  Service:plugin
  Core Plugin, Ethernet Plugin
Active Package(s):
N9K#

The show module command displays all the hardware modules installed in a modular chassis. For fixed models, the show module command displays the preinstalled modules, as illustrated in Example 2-16.

Example 2-16 Show Module Command

Click here to view code image N9K#
show module
Mod Ports              Module-Type                    Model            Status
— —– ————————————- ——————— ———
1    54    48×10/25G/32G + 6×40/100G Ethernet/FC N9K-C93180YC-FX      active *
Mod  Sw                       Hw    Slot
—  ———————– —— —-
1    9.3(5)                  1.2     NA
Mod    MAC-Address(es)                         Serial-Num
—    ————————————– ———-
1    c4-b2-39-93-8f-e0 to c4-b2-39-93-90-3f    FDO23510ELW
Mod    Online Diag Status
—    ——————
1      Pass
* this terminal session
N9K#

,


Leave a Reply

Your email address will not be published. Required fields are marked *