cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

RegEx Help

Jump to solution

We are in the process of dropping in quite a bit of configuration related to ISE and Dot1x.  I have a Dot1x rule created where I have defined several lines of interface code where all of them must be found.  If one of the lines of code is not found all would be applied in the remediation script.

pastedImage_0.png

The problem lies in the Regular Expression needed for the config block start.  I do not want this configuration applied to the following

     - The first port of any switch (reserved for internal purposes).  As an example I do not want this applied to 1/0/1, 2/0/1, 3/0/1, 4/0/1 ect..

     - Config cannot be applied to a routed switchport or a trunk port.

Just getting started this is what I have come up with so far

^interface (GigabitEthernet|FastEthernet|TenGigabitEthernet|Ethernet)[0-4]\/[0-9]\/[0-9]

pastedImage_3.png

1 Solution

The end block for most Cisco interface blocks will be

!

View solution in original post

2 Replies
Level 12

This string will not the first port in any switch

^interface (GigabitEthernet|FastEthernet|TenGigabitEthernet|Ethernet)([0-4]\/[0-9]\/[2-9]|[0-4]\/[1-9]\/[0-9])

Anyone familiar with the config end block ?  Not sure how to stop the config search within the interface config block of a Cisco switch.

0 Kudos

The end block for most Cisco interface blocks will be

!

View solution in original post