cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
60358
Views
18
Helpful
2
Comments
Travis Williams
Community Member

Graham Mundell, Telecom New Zealand, Weymouth, Auckland, New Zealand.

You can create macros to run a series of commands on a Cisco switch. This can be handy if you're logged in to a remote device and want to change the configuration, but doing so will mean you lose management access part-way through. You can define a macro and run it; even though you lose management access part way through, the macro will continue to run.

To configure the macro:

  • Enter configuration mode
  • Use the command macro name
  • Enter the commands you want the macro to run
  • Finish with @

The example below shows how to change the management VLAN from 1 to 100. Removing the IP address from the current management VLAN will disconnect your telnet session, but the macro will still execute the rest of the commands.

config t
macro name Change-vlan
interface Vlan1
   no ip address
   shutdown
interface vlan100
   ip address 172.29.159.6 255.255.255.252
   no shutdown @

To run the macro:

macro global apply Change-vlan

The above tip is specific to Catalyst IOS that runs on very specific switches (like the 2950) and is not a standard in the majority of the remaining IOS versions available. Please refer to the configuration guide below for more information: http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_22ea/SCG/swmacro.html

To receive the latest information on Cisco online tools, certifications, support documentation, insights from Cisco experts and peers, and upcoming events, check out the Cisco Technical Services Newsletter today.

Comments
Pronoy Dasgupta
Cisco Employee
Cisco Employee

The command for applying a macro globally on the 2950 switch (macro global apply) is present from the IOS version 12.1(20)EA2 image. Here is a reference document for the same:

http://www.cisco.com/en/US/docs/switches/lan/catalyst2950/software/release/12.1_20_ea2/command/reference/cli1.html#wp3392174

Thanks

Pronoy

Seoulhawk
Level 1
Level 1
Hello, Need help with setting up a widget and a macro. Sorry don't really know what I am doing, but here it goes. I have a SX80 that moves to three different sites and needs different IPs and gatekeeper information programed in. I would like to setup a macro that allows the user to just select the site he is setting the system up at and it auto configures. One site uses DHCP, the other two are static and all three have different gatekeepers. Can someone help me with this? Thanks! Douglas
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: