Hello
I’m lazy so I like to come up with solutions that save time. Today I configured a macro and an alias that will allow me to apply a whole bunch of commands with one word only:
macro name lazy
default int range eth0/0-1
default int range eth1/0-1
default int range eth2/0-1
int range eth0/0-1
switchport trunk encapsulation dot1q
switchport mode trunk
int range eth1/0-1
switchport trunk encap dot1q
switchport mode trunk
int range eth2/0-1
switchport trunk encap dot1q
switchport mode trunk
int range eth0/0-1
duplex full
int range eth1/0-1
duplex full
int range eth2/0-1
duplex full
int range eth1/0-1
shut
int range eth2/0-1
shut
int rang eth0/0-1
shut
int range eth0/0-1
spanning-tree link-type point-to-point
int range eth1/0-1
spanning-tree link-type point-to-point
int range eth2/0-1
spanning-tree link-type point-to-point
do wr
@
And then, because I’m superlazy and I don’t like using the command macro global apply lazy…
alias configure startgns macro global apply lazy
Now, i just go to config mode and write:
startgns
This applies all the commands in the lazy macro.
That’s really lazy, innit?
@update Feb 5, 2018
using variables in macros:
Switch(config)# macro name test
switchport access vlan $VLANID
switchport port-security maximum $MAX
#macro keywords $VLANID $MAX
Now you can use the question mark to get help about variables used in a given macro
IOU1(config-if)#macro apply test ?
WORD Keyword to replace with a value e.g. $VLANID, $MAX
IOU1(config-if)#macro apply test