Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

netconfig a macro on all switches

Dear,

When pushing a macro using netconfig I encounter a weird problem, the lines that begin with # are ignored, how can I push these lines anyway ?? Perhaps with an escape character ??

Many thanks

Lieven Stubbe

5 REPLIES
Cisco Employee

Re: netconfig a macro on all switches

Please provide an example of what you are trying to push.

New Member

Re: netconfig a macro on all switches

I am trying to push a macro, the lines beginning with an # are ignored.

macro name ci

# macro keywords $int

# interface macro ci (= Clear Interface) :

# clears all the configuration from an interface and shuts it down

default interface $int

interface $int

shutdown

@

Cisco Employee

Re: netconfig a macro on all switches

This is a conflict between RME's comment character, and a comment character in IOS. Fortunately, you can use '!' instead of '#' for your macro comments, and the application of the macro will ignore those lines. Netconfig will not ignore lines that that with '!'.

New Member

Re: netconfig a macro on all switches

The "#macro keywords $int" is not really comment, very weird use of # !!

when you do an : "macro apply ci ?" the interpreter adds "e.g. $int" in the following line :

Keyword to replace with a value e.g. $int

When replacing # by ! it is comment and notting is done, is there a workaround ??

macro name ci

# macro keywords $int

# interface macro ci (= Clear Interface) :

# clears all the configuration from an interface

@

New Member

Re: netconfig a macro on all switches

I uses ciscocmd instead and a script to push the whole thing into our switches.

CW still has a lot to learn...

302
Views
5
Helpful
5
Replies
CreatePlease login to create content