User comments to blog posts.
User avatar
Steve
Site Admin
Posts:
10617
Joined:
Mon Dec 06, 2004 6:46 pm
Certs:
CCNA

Switch Macros

Thu Jul 01, 2010 2:17 pm

Comments for Switch Macros.

User avatar
Poison Nuke
Senior Member
Posts:
423
Joined:
Fri Mar 27, 2009 2:16 pm
Certs:
CCNA

Re: Switch Macros

Thu Jul 01, 2010 3:36 pm

thats great :) :bowdown:

I wouldnt have noticed this function before. Very nice. I think this will save some time and prevent some human errors, hopefully :)
kindly regards
Poison Nuke

www.poisonnuke.de

User avatar
inzeos
Post Whore
Posts:
1858
Joined:
Mon Jun 11, 2007 9:43 am

Re: Switch Macros

Thu Jul 01, 2010 4:44 pm

Are switch macros in effect after they are run like an active template or is it a one time thing used to set up parameters?

User avatar
mellowd
CCIE #38070
Posts:
13814
Joined:
Wed Jun 18, 2008 7:49 am
Certs:
CCIE (RS,SP), JNCIE-SP, BC-/SPNE/NP

Re: Switch Macros

Fri Jul 02, 2010 2:14 am

interesting, never used it before.

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Fri Jul 02, 2010 8:11 am

inzeos wrote:Are switch macros in effect after they are run like an active template or is it a one time thing used to set up parameters?


They are part of the config and always usable. That answer your question?
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

User avatar
jdsilva
Post Whore
Posts:
5347
Joined:
Mon Jan 17, 2005 11:01 pm
Certs:
CCNP

Re: Switch Macros

Fri Jul 02, 2010 9:34 am

Interesting... Although not sure where I'd ever use these. If I wanted to apply a config to more than one interface I'd use an interface range. I don't know how often I'd ever need to go back and run the same commands again and again, unless it was a macro of some show commands (that I could record to a text file to view) or a special save to tftp setup to multiple servers.

User avatar
Steve
Site Admin
Posts:
10617
Joined:
Mon Dec 06, 2004 6:46 pm
Certs:
CCNA

Re: Switch Macros

Fri Jul 02, 2010 9:57 am

Might be good for engineering/architecture to hand over to operations. Design macros to configure specific types of switchports and hand that over to your NOC or ops team.

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Fri Jul 02, 2010 10:58 am

for show commands you would probably be better off with an alias

In this case I beleve the following command will make sr equivalent to running-config
alias exec sr show running-config
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

User avatar
jdsilva
Post Whore
Posts:
5347
Joined:
Mon Jan 17, 2005 11:01 pm
Certs:
CCNP

Re: Switch Macros

Fri Jul 02, 2010 11:02 am

Yeh... I'm not really one for aliases either. If you get too lazy with them and forget the real commands when you get on a device without the aliases you have trouble. And with being able to shorten them anyway, "sh run", it's kind of overkill.

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Fri Jul 02, 2010 11:06 am

yeah
but if you could make
ta = switchport trunk allowed vlan add
that might be nice
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

User avatar
jdsilva
Post Whore
Posts:
5347
Joined:
Mon Jan 17, 2005 11:01 pm
Certs:
CCNP

Re: Switch Macros

Fri Jul 02, 2010 11:11 am

sw tr al v a

Granted not as short, but still a good deal less than the full one.

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Fri Jul 02, 2010 11:21 am

you ruining my technical solution to a non-existent problem... stop that!!!
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Wed Dec 14, 2011 2:15 pm

We are gonna have to re-IP alot of stuff here soon and due to the way we are doing it we have to delete the IP from vlan 1 (management) and put it on another vlan (not vlan 1 management). As this will continue to run once the SSH session dies (cause you removed the management IP address) I think we can use macros for that.
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

haccduder
Ultimate Member
Posts:
592
Joined:
Sat Oct 09, 2010 2:13 pm
Certs:
CCNA

Re: Switch Macros

Wed Dec 14, 2011 2:28 pm

what's the significance of putting in "macro global" as opposed to just "macro" when executing?

User avatar
ristau5741
Post Whore
Posts:
10501
Joined:
Tue Aug 21, 2007 2:15 pm
Certs:
Instanity

Re: Switch Macros

Wed Dec 14, 2011 2:30 pm

you can text up the config, put the file on an http server and
issue the command
configure replace http://1.1.1.1/switch1.txt
<where 1.1.1.1 is your http server address and switch1.txt is the new config file>
Tips of the day:
- The human mind is the ultimate creation invention.
- I have so many customers, my customers have customers.
- Sausage time
- POP, stack, and store

User avatar
Vito_Corleone
Moderator
Posts:
9850
Joined:
Mon Apr 07, 2008 10:38 am
Certs:
CCNP RS, CCNP DC, CCDP, CCIP

Re: Switch Macros

Wed Dec 14, 2011 2:56 pm

dlots wrote:We are gonna have to re-IP alot of stuff here soon and due to the way we are doing it we have to delete the IP from vlan 1 (management) and put it on another vlan (not vlan 1 management). As this will continue to run once the SSH session dies (cause you removed the management IP address) I think we can use macros for that.


This is when to use them. Your first example is stupid.
http://blog.alwaysthenetwork.com

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Wed Dec 14, 2011 3:00 pm

Vito_Corleone wrote:This is when to use them. Your first example is stupid.


we have more than 1.2k APs on campus and putting more out almost every day.

automating the port config so anyone can do it IMO was well worth it

And that one had a variable in it showing it could be more versital.
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

User avatar
Vito_Corleone
Moderator
Posts:
9850
Joined:
Mon Apr 07, 2008 10:38 am
Certs:
CCNP RS, CCNP DC, CCDP, CCIP

Re: Switch Macros

Wed Dec 14, 2011 3:07 pm

Still stupid. You should have a script shared between engineers. If you deploy this macro across 100 switches and then decide to change the config, you now have to change the macro on every switch. Stupid.
http://blog.alwaysthenetwork.com

User avatar
dlots
Post Whore
Posts:
3512
Joined:
Mon Jun 15, 2009 9:48 am
Certs:
CC\NP\DP\IP\NP-Security\NA-Voice

Re: Switch Macros

Wed Dec 14, 2011 3:29 pm

yep... see blog post about mass deployments via SNMP :-P

I did try the script before the macro but it didn't take for whatever reason... but they liked the macro.
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com

'

Return to Blog Comments

Who is online

Users browsing this forum: No registered users and 0 guests