cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2242
Views
4
Helpful
6
Replies

Execute a command alias in interface range config mode?

David Williams
Level 1
Level 1

I have run into an issue where I am unable to execute an interface command alias from an interface range config mode.  I was wondering if anyone could offer some additional information on whether I am doing something wrong or if Cisco has failed here.  Judging from the output in example 3 a person could assume that the alias in example 1 would work when executed in interface-range configuration mode.  Except when I try it I get output from example 2.

Does anyone have any thoughts? I have tried this in both a 6500 and a 3560 and it does the same thing in both.

  1. alias interface vladd switchport trunk allowed vlan add


   2.  LABROUTER02(config-if-range)#vladd 2-1000

                                   ^

     % Invalid input detected at '^' marker.

   3.  LABROUTER02(config)#alias ?

  Buffer                             config-owner-buffer
  DRMI-Slot-Config                   DRMI Slot Config Mode
  DRMI-Stby-Config-Mode              DRMI Stby Config Mode
  RMI-Node-Config                    Resource Policy Node Config mode
  RMI-Resource-Group                 Resource Group Config mode

.

.

.

  interface                          Interface configuration mode
interface                          Interface range configuration mode
  interface-dlci                     Frame Relay dlci configuration mode

6 Replies 6

Ganesh Hariharan
VIP Alumni
VIP Alumni

I have run into an issue where I am unable to execute an interface command alias from an interface range config mode.  I was wondering if anyone could offer some additional information on whether I am doing something wrong or if Cisco has failed here.  Judging from the output in example 3 a person could assume that the alias in example 1 would work when executed in interface-range configuration mode.  Except when I try it I get output from example 2.

Does anyone have any thoughts? I have tried this in both a 6500 and a 3560 and it does the same thing in both.

  1. alias interface vladd switchport trunk allowed vlan add


   2.  LABROUTER02(config-if-range)#vladd 2-1000

                                   ^

     % Invalid input detected at '^' marker.

   3.  LABROUTER02(config)#alias ?

  Buffer                             config-owner-buffer
  DRMI-Slot-Config                   DRMI Slot Config Mode
  DRMI-Stby-Config-Mode              DRMI Stby Config Mode
  RMI-Node-Config                    Resource Policy Node Config mode
  RMI-Resource-Group                 Resource Group Config mode

.

.

.

  interface                          Interface configuration mode
interface                          Interface range configuration mode
  interface-dlci                     Frame Relay dlci configuration mode


Hi,

Can you please elaborate the requirement beacuase with alias configuration you can view the command with specific word mapped with alias,Like below is the example for using alias

s - Show Running-Config Interface


Router(config)# alias exec s show running-config interface

From these examples, you can see that the aliases you create don't have to be complete commands. You can specify parameters for a command after entering the alias.

For example, to use the shortcut for the show running-config interface command—s—you can specify the interface for which you want to view configuration information after that command.

Here's an example:

s fa0/0

Hope to Help !!

Ganesh.H

Remember to rate the helpful post

Hi Ganesh,

I understand how the alias works.  In the example I provided, the command vladd would be an alias for switchport trunk allowed vlan add in interface configuration mode.  The alias does work when modifying a single interface.  My problem is that it does not work when modifying a range of interfaces.

The next thing I'm going to try is command macros instead of the alias.  It just frustrates me that this doesn't work because the output from the ? after the alias command implies that it will.

Thanks,

Dave

I think you are talking about Smartport Macros.

Indeed I am!    I just proved that this works in the lab but I do have to specify a variable.  It's not quite as clean but I think it will work.  Thanks!

Bummer..roadblock.  This worked on my 3560, and it looks like it works on 6500 SXH but not my 7600 running SR code.  Oiy....

I'm not sure if this will work with 7600 but Smartport Macros is slowly being deprecated in favour of AutoSmartport Macros.  The former has been delegated to a "hidden" command if you are running IOS 12.2(53)SE and later.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card