cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1174
Views
5
Helpful
5
Replies

netconfig a macro on all switches

lni1
Level 1
Level 1

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 5

Joe Clarke
Cisco Employee
Cisco Employee

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

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

@

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 '!'.

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

@

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

CW still has a lot to learn...

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: