, ,

In my R&S CCIE lab exam this is one thing I used all the time. There are multiple verification commands you need to run all the time & “Alias” will help you to execute those commands without typing the full command.

Even in Wireless CCIE exam, you can use these alias configuration for the commands you have to run many times during the exam. Specially if you want to verify the initial configuration this may help you. Here are few of my favourites, you can work it out yourself any other verification requirement you have.

1. “sh archive config differences nvram:startup-config system:running-config
This will give you the running config & startup config differences, If I configure any given task I would verify using this command to make sure all the commands added/removed is as expected.

Here how you can use “alias config” to run this command in global config mode without exiting from that prompt & without typing the full command syntax. If you want to run this command in “exec” mode, you have to use “alias exec … ” option. If it is an interface configuration you have to use “alias interface ….”

C3750-1(config)#alias ?
  SASL-profile               SASL profile configuration mode
  aaa-attr-list              AAA attribute list config mode
  aaa-user                   AAA user definition
  address-family             Address Family configuration mode
  archive                    Archive the router configuration mode
  arp-nacl                   ARP named ACL configuration mode
  cns-connect-config         CNS Connect Info Mode
  cns-connect-intf-config    CNS Connect Intf Info Mode
  cns-tmpl-connect-config    CNS Template Connect Info Mode
  config-ip-sla-http-rr      IP SLAs HTTP raw request Configuration
  configure                  Global configuration mode
  crypto-ca-cert-chain       Crypto certificate entry mode
  crypto-ca-cert-comm        Certificate query  mode
  crypto-ca-cert-map         Certificate map entry mode
  crypto-ca-profile-enroll   Certificate enrollment profile entry mode
  crypto-ca-root             Certificate authority trusted root entry mode
  crypto-ca-trustpoint       Certificate authority trustpoint entry mode
  crypto-pubkey              Crypto subsystem public key entry mode
  dhcp                       DHCP pool configuration mode
  dhcp-class                 DHCP class configuration mode
  dhcp-pool-class            Per DHCP pool class configuration mode
  dhcp-relay-info            DHCP class relay agent info configuration mode

C3750-1(config)#alias configure ?
  WORD  Alias name

C3750-1(config)#alias configure diff ?
  LINE  New alias

C3750-1(config)#alias configure diff do sh archive config differences nvram:startup-config system:running-config
C3750-1(config)#alias exec diff sh archive config differences nvram:startup-config system:running-config

Now if you issue the “diff” command in config mode it should give the same output as you issue the full “show archive ….” command in exec prompt.

!Contextual Config Diffs:
+mls qos map cos-dscp 0 10 18 26 34 46 48 56
crypto pki certificate chain TP-self-signed-3931764736
 +certificate self-signed 01
  +3082023E 308201A7 A0030201 02020101 300D0609 2A864886 F70D0101 04050030
  +31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
  +69666963 6174652D 33393331 37363437 3336301E 170D3933 30333031 30303030
  +35395A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
  +4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 39333137
  +36343733 3630819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
  +8100DA7B 48D89795 A5E15EF8 742210BB 6BC3FDB6 4046F577 21A9A1C3 C3A2A0CB
  +7472DAFF A678D559 6493D779 178516B3 AC7252AF 7FA527B9 63DF34BB ED8EAA7D
  +3B8A137A ADC24C7C 4678053C C625E504 EFA15FF6 E70238BF 12553BB3 C4558705
  +84DB52B5 FEF3D93E 1F34FED9 724CECB5 80F15D07 E35D4D69 B22B1584 2614137A
  +2B510203 010001A3 66306430 0F060355 1D130101 FF040530 030101FF 30110603
  +551D1104 0A300882 06523239 36302E30 1F060355 1D230418 30168014 B0C052AF
  +7C068EA6 E181B1C2 F0D41C9E 7FA9601D 301D0603 551D0E04 160414B0 C052AF7C
  +068EA6E1 81B1C2F0 D41C9E7F A9601D30 0D06092A 864886F7 0D010104 05000381
  +8100AECC F11A0E9F F4CDE08C 7FC01A3B 27E87EFD 3A9EF10F 2B21C933 8259FD62
  +52500E4C 5FDD6F31 25F94933 78F9CE65 E5393E5C 0F380599 1FA5FA99 DFDA7D71
  +5A645893 BB306C04 D417956A 896BD06C D0EE7C02 BB789A00 4FC97AB6 00AD6227
  +D51B9E77 70CF9737 18DF1007 AAE25227 82564078 47846112 A3439EAC B6A7F6EF 0BDD
interface GigabitEthernet0/8
 +priority-queue out
 +mls qos trust cos
+alias configure diff do sh archive config differences nvram:startup-config system:running-config
-mls qos map cos-dscp 0 8 16 24 32 46 48 56
crypto pki certificate chain TP-self-signed-3931764736
 -certificate self-signed 01 nvram:IOS-Self-Sig#3636.cer

2. If you want to verify IP address configuration with subnet mask you could use this “sh run | in (interface|ip add) “. If you want to alias config for this it will look like this.

DSW1(config)#alias exec ipadd sh run | in (interface|ip add)
DSW1(config)#alias configure ipadd do sh run | in (interface|ip add)

interface GigabitEthernet1/0/1
interface GigabitEthernet1/0/2
interface GigabitEthernet1/0/3
interface GigabitEthernet1/0/4
interface GigabitEthernet1/0/5
interface GigabitEthernet1/0/6
interface GigabitEthernet1/0/7
interface GigabitEthernet1/0/8
interface GigabitEthernet1/0/9
interface GigabitEthernet1/0/10
interface GigabitEthernet1/0/11
interface GigabitEthernet1/0/12
interface GigabitEthernet1/0/13
interface GigabitEthernet1/0/14
interface GigabitEthernet1/0/15
interface GigabitEthernet1/0/16
interface GigabitEthernet1/0/17
interface GigabitEthernet1/0/18
interface GigabitEthernet1/0/19
interface GigabitEthernet1/0/20
interface GigabitEthernet1/0/21
interface GigabitEthernet1/0/22
interface GigabitEthernet1/0/23
interface GigabitEthernet1/0/24
interface GigabitEthernet1/0/25
interface GigabitEthernet1/0/26
interface GigabitEthernet1/0/27
interface GigabitEthernet1/0/28
interface Vlan1
 no ip address
interface Vlan10
 ip address
interface Vlan20
 ip address
interface Vlan100
 ip address
interface Vlan200
 ip address
alias configure ipadd do sh run | in (interface|ip add)
alias exec ipadd sh run | in (interface|ip add)

3. If you want to verify QoS trust status & any QoS related config in each individual interface you can use “show run | in (interface|mls|queue|srr)“. You can use a alias for this if you need to use these regularly.

DSW1(config)#alias configure qos do sh run | in (inter|mls|srr|queue)
DSW1(config)#alias exec qos sh run | in (inter|mls|srr|queue)        
vlan internal allocation policy ascending
interface GigabitEthernet1/0/1
 mls qos trust cos
interface GigabitEthernet1/0/2
 mls qos trust dscp
interface GigabitEthernet1/0/3
 mls qos trust dscp
interface GigabitEthernet1/0/4
 mls qos trust dscp
interface GigabitEthernet1/0/5
 mls qos trust dscp
interface GigabitEthernet1/0/6
 mls qos trust dscp
interface GigabitEthernet1/0/7
 mls qos trust dscp
interface GigabitEthernet1/0/8
 mls qos trust dscp
interface GigabitEthernet1/0/9
 mls qos trust dscp
interface GigabitEthernet1/0/10
 mls qos trust dscp
interface GigabitEthernet1/0/11
 mls qos trust dscp
interface GigabitEthernet1/0/12
 srr-queue bandwidth share 1 30 35 5
 priority-queue out 
 mls qos trust device cisco-phone
 mls qos trust cos

Finally your alias config looks like this. If you intend to use alias during your lab exam better to configure those on IOS devices (mainly switches, autonomous AP)

DSW1(config)#do sh run | in alias
alias configure ipadd do sh run | in (interface|ip add)
alias configure qos do sh run | in (inter|mls|srr|queue)
alias configure diff do sh archive config differences nvram:startup-config system:running-config
alias exec ipadd sh run | in (interface|ip add)
alias exec qos sh run | in (inter|mls|srr|queue)
alias exec diff sh archive config differences nvram:startup-config system:running-config

Once you finish using these it is better to remove it from your network devices. You can use “no alias exec” & “no alias configure” to remove those.

Related Posts

1. “show archive config differences” is your Friend