03-11-2011 01:47 PM
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
Solved! Go to Solution.
03-14-2011 07:03 AM
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.
03-14-2011 08:39 AM
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.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.
03-15-2011 07:27 AM
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.
03-11-2011 03:43 PM
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
03-12-2011 07:57 AM
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!!!
03-12-2011 10:54 AM
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
03-12-2011 05:52 PM
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.
03-12-2011 06:35 PM
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.
03-13-2011 05:25 PM
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.
03-14-2011 07:03 AM
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.
03-14-2011 08:25 AM
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!!!
03-14-2011 08:39 AM
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.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.
03-14-2011 07:42 PM
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.
03-15-2011 07:27 AM
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.
03-15-2011 12:22 PM
yes it does help!!! thank you so very much!!! you saved my day!!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide