Cisco Configuration Tip - Command Macro To Change IP Address

Network Engineer at a Bar
Remotely changing an IP address on a Cisco router or switch, or moving an IP from one interface to another can be a challenge.

Cisco allows you to use macros although I have not really worked with them. rekrowteN has a great blog post about using macros to move an IP address from one VLAN interface to another.

In a previous Configuration Tip I discussed using the reload in/at commands to prevent getting locked out of a router or switch.

In this scenario we need to move the IP Address assigned to interface VLAN 1 to VLAN 10.


For this tip start by entering reload in 15.


Next we create the macro
conf t
macro name mgmtchange
interface vlan 1
no ip address
shutdown
interface vlan 10
ip address 172.16.1.1 255.255.255.0
no shutdown
@
The "@" signifys  at the end of the macro. To apply the macro enter:
conf t
macro global apply mgmtchange
Once the change is made and you can reconnect don't forget reload cancel.


Configuring Command Macros


Have you used macro's? What Macro scripts do you use?

Popular Posts

Cisco Prime Infrastructure 2.1 - Upgrade VMware Tools

Cisco ASA Static NAT Multiple Global IPs to Single Real IP

Cisco Configuration Tip - 3rd Party SFP Modules

Configuration Tricks - Catalyst 4900M with CVR-X2-SFP and 1Gb SFP