Saturday, August 28, 2010

Configuring ALIAS on Cisco Routers

If you are like me ;), you will hate typing in long commands again and again.... and again..... and again, here we have the solution for it. Instead of typing "show ip interface brief" all the time wouldn't it be nice to just type sib or any short cut you want. We can do it just by configuring an alias.

Let's take a closer look at the alias command. This command is used at Global Configuration mode, enter the alias and identify the level for which you specify the alias. Some example are given as under:

Use alias exec for Privileged Mode (Command you use at the Router#)

Use alias configure for Global Configuration Mode (Command you use at the Router(config)#)

Use alias interface for Interface Configuration Mode (Command you use at the Router(config-if)# prompt)

After specifying the privilege level, enter the alias you want to create and the command you want it to stand for.

"As far as I know, you can configure an alias to do anything that you can do at the command line. Of course, there's a catch: An alias can't move between modes, type in passwords, or do anything interactive for you". Reference: Click Here

Eamples (Alias):

1. Router(config) # alias exec sib show ip interface brief
2. Router(config) # alias exec sr show ip route
3. Router(config) # alias exec r show running
4. Router(config) # alias exec son show ip ospf neighbour

5. Router(config) # alias configure rr router rip
6. Router(config) # alias configure ro router ospf

7. Router(config) # alias interface ns no shutdown

Default Alias:

1. P for ping
2. h for help
3. u and un for undebug

So likewise we can configure different alias and make our life easy.

I Hope this will be informative for you.

Cheers :)

1 comment:

Irum said...

hmm grt work sohail. i m one who always read ur blogs, this is the one thts really informative.

thnx
best of luck
immi