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

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.


RME Baseline config Template REGEX LMS 3.2


I know there are a few posts on here regarding this but I wasn't able to get my question answered...

I'm working on establishing my router baseline template for LMS 3.2. I've figured out how to require certain commands to be in the config and to remove other ones... but what I would like to do is ensure there's not an "Extra" config in there.

An example of this is my remote routers should only have 1 static route, a floating static used for ISDN backup... I would like to create a regex that says somthing similar to, if the router is NOT <my route>, mark it as non compliant.

I've tried a couple different syntaxes without luck.

The Route it want: ip route 150

I'm trying:

- [#ip route (! 150)#]

- ip route[#! 150#]

This same idea would apply to the SNMP config. I can look to ensure that the necessary SNMP views/groups/hosts are there, but I would like to ensure that any "Extras" that don't match my current standard, are marked as non compliant.


My SNMP host:

+ snmp-server host 192.168.<ip> version 3 auth <SNMP v3 uname>

And I want to make sure, there are NO other snmp-server hosts besides the 1 that i designate.

I found this post that was helpful:^1%40%40.2cc1dcca/4#selected_message

But I haven't been able to apply it to this situation. Any thoughts? Thanks.


Accepted Solutions
Cisco Employee

Re: RME Baseline config Template REGEX LMS 3.2

- [#snmp-server host (?!192\.168\.x\.x).*#]


Re: RME Baseline config Template REGEX LMS 3.2

Ok, One other problem:

How can I reference a range of ports on a switch? Our standard switch setup has ports 1-5 configured as VLANA, 6-23 configured with VLANB etc.

I've gotten the thing to look at ports 1-5 on a 3750. In the "Sub mode" field I put this in:

interface [#FastEthernet1/0/[1-5]#]

However, when I try similar on a second port range:

interface [#FastEthernet1/0/[6-23]#]

The compliance audit flags and looks at ALL ports on the switch, including the VLAN interface(s) and Gigabit interfaces. THis confuses me, because I'm defining "FastEthernet", so why is it matching VLAN and GigabitEthernet?


Re: RME Baseline config Template REGEX LMS 3.2

Ok, Nevermind on the 2nd issue. I forgot my regex basics... i can only match single digit numbers with ranges....


interface [#FastEthernet1/0/[6-23]#]


interface [#FastEthernet1/0/([6-9]|1[0-9]|2[0-3])#]

to achieve what I wanted.

Cisco Employee

Re: RME Baseline config Template REGEX LMS 3.2

- [#snmp-server host (?!192\.168\.x\.x).*#]