cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1546
Views
0
Helpful
12
Replies

update configration with RME

raindrop18
Level 1
Level 1

I have this scenario and i am looking for which LMS apps help me to do the job.

interface FastEthernet0/15

description *** test1 ***

switchport trunk allowed vlan 200,201,202

switchport mode trunk

and I want to change the switchport configration to

"switchport trunk allowed vlan 300,301,302,303,304,305"  and I want remove the old one.

Note - I have dozens of switch with this same configuration but the port is not the same. some switch on port 4 other 5 other 6 so on. I am thinking the compliance job, but not sure. net config can be work but since the port is not consistent I don't think it's work( I could be wrong) any suggestion highly appreciated. Thanks, Paul

3 Accepted Solutions

Accepted Solutions

Hi,

I just tested this template on my lab and it appears to work as per your requirements:

Name: Checktrunks
IsPrereq: Yes
Sub-mode: interface [#FastEthernet.*#]
Body:

+ switchport mode trunk
+ description [#test-.*#]
Name: SetAllowedVlans
IsPrereq: No
Parent:
Checktrunks
Prereq: Checktrunks
Body:

-
switchport trunk allowed vlan 200,201,202
+ switchport trunk allowed vlan 300,301,302,303,304,305

Let me know if this works.

Andres.

View solution in original post

Hi,

I am glad to hear the template is working.

Baseline templates on Cisco Works use Regular expressions.

Here are some good links with documentation:

http://www.cisco.com/en/US/prod/collateral/netmgtsw/ps6504/ps6528/ps2073/prod_white_paper0900aecd8068cc98.pdf

http://www.regular-expressions.info/reference.html

http://en.wikipedia.org/wiki/Regular_expression

Also here are some examples to match the other descriptions:

(*** test-1) ---> description [#.*test-1#]

(*** test-1***) ---> description [#.*test-1.*#]

The . means any character and the * means the previous character 0 or more times. So basically .* will match anything.

Andres.

View solution in original post

Hi,

There migth be a better option, however, this is the best I could think of and it worked on my lab.

This regular expression will match the following: description anything test-x anything

Name: DefaultPreReq     SubMode: Yes      isPrerequisite: Yes
Ordered : No     Prerequisite-Commandset : none     Parent: none
  interface   [#FastEthernet.*#]
  +   switchport   mode   trunk
  +   description  [#.*#]  [#.*test-.*#]  [#.*#]

Name: Commands     SubMode: Yes      isPrerequisite: No
Ordered : No     Prerequisite-Commandset : DefaultPreReq     Parent: none
  interface   [#FastEthernet.*#]  (Using   the   submode   of   conditional   commands   above)
  -   switchport   trunk   allowed   vlan   300,301,302,303,304,305,102
  +   switchport   trunk   allowed   vlan   300,102

Let me know if this helps.

Andres.

View solution in original post

12 Replies 12

andporra
Cisco Employee
Cisco Employee

Hi,

The best tool to do that type of change is the 'Compliance Mgmt'.

You need to create a template that will look like this:

_ This will set as prerequisite that the FastEthernet port is a trunk.

Name: Checktrunks
IsPrereq: Yes
Sub-mode: interface [#FastEthernet.*#]
Body:

+ switchport mode trunk

_ If the port pass the previous prerequisite then the following command will be checked.

Name: SetAllowedVlans
IsPrereq: No
Parent:
Checktrunks
Prereq: Checktrunks
Body:

+ switchport trunk allowed vlan 300,301,302,303,304,305

Let me know if this helps.

Andres


If this post answers your question, please click the "Correct Answer" button

Thanks Andre,I think i was not clear on my question. the solution can I identify all ports with " switchport mode trunk" this is full fill my objective on half. but as I said I have many ports with trunk enabled. I am looking for one of the port with description "test-1" because I don't want to change the other trunk port vlans. the sticky problem is how compliance managment able to identify the port with desccription "test" is this too much expectation from RME .

Thanks again!!!

Hi,

In that case you only need to add that condition to the pre requisite:

Name: Checktrunks
IsPrereq: Yes
Sub-mode: interface [#FastEthernet.*#]
Body:

+ description test-1
+ switchport mode trunk

Let me know if that helps.

Andres

Andres, hopefully you will be patient with me, here is something important I have to
tell you. the description is variable. like. test-1,test-2,test-3 up to 100. so the problem i have is can I use wild card on the cli section? or partial command

just to avoid any specfic number after test.

ex -

+  **description test*

+  switchport trunk allowed 300,301,302,303

Thanks much again.

Hi,

Let me see if I understood correctly.

You want to configure 'switchport trunk allowed 300,301,302,303' on trunk ports that have a description test-x.

Please confirm.

Andres.

yes, side note -actually replace the current "switch truck port allowed 200 201 203" to the newer one. you are right the description is test -X thanks gain for your time.

Hi,

I just tested this template on my lab and it appears to work as per your requirements:

Name: Checktrunks
IsPrereq: Yes
Sub-mode: interface [#FastEthernet.*#]
Body:

+ switchport mode trunk
+ description [#test-.*#]
Name: SetAllowedVlans
IsPrereq: No
Parent:
Checktrunks
Prereq: Checktrunks
Body:

-
switchport trunk allowed vlan 200,201,202
+ switchport trunk allowed vlan 300,301,302,303,304,305

Let me know if this works.

Andres.

thanks you so very much working perfectley. one last question, where I can find a documnet regarding this wildcards can be use on compliance managment. is there any escape character? some of the description I have start (*** test-1) or (*** test-1***) so I want to escape for (*) charcater. I have tried + description [***test-*#] but doesn't work. if you have a link for any documentation for different complaince managment wildcard options please post. once again thank you for your time!!!

Hi,

I am glad to hear the template is working.

Baseline templates on Cisco Works use Regular expressions.

Here are some good links with documentation:

http://www.cisco.com/en/US/prod/collateral/netmgtsw/ps6504/ps6528/ps2073/prod_white_paper0900aecd8068cc98.pdf

http://www.regular-expressions.info/reference.html

http://en.wikipedia.org/wiki/Regular_expression

Also here are some examples to match the other descriptions:

(*** test-1) ---> description [#.*test-1#]

(*** test-1***) ---> description [#.*test-1.*#]

The . means any character and the * means the previous character 0 or more times. So basically .* will match anything.

Andres.

Thanks for the links and  I have configured close 1200 switches using your template. I have stuck with the last 50. what happen is there is a white space on the description . ex - *** test-x *** ( there is a white space between *** and test also between x and *** . this [#.*test.*] working perfectly for description without any white space (***test-x***) I have search on the link you sent me I couldn't find what regular expression to use for whire space. I know in perl /s use for white space but didn't work here for me. any suggestion. hope fully this is my last question.

Hi,

There migth be a better option, however, this is the best I could think of and it worked on my lab.

This regular expression will match the following: description anything test-x anything

Name: DefaultPreReq     SubMode: Yes      isPrerequisite: Yes
Ordered : No     Prerequisite-Commandset : none     Parent: none
  interface   [#FastEthernet.*#]
  +   switchport   mode   trunk
  +   description  [#.*#]  [#.*test-.*#]  [#.*#]

Name: Commands     SubMode: Yes      isPrerequisite: No
Ordered : No     Prerequisite-Commandset : DefaultPreReq     Parent: none
  interface   [#FastEthernet.*#]  (Using   the   submode   of   conditional   commands   above)
  -   switchport   trunk   allowed   vlan   300,301,302,303,304,305,102
  +   switchport   trunk   allowed   vlan   300,102

Let me know if this helps.

Andres.

yes it does help!!! thank you so very much!!! you saved my day!!!