Security

Reply
Frequent Contributor II
Posts: 149
Registered: ‎04-20-2009

Creating a ClearPass regex for an IP address

I am trying to create a Network Device Group in CPPM where the device IP addresses will match a regular expression.

The devices in the Group will have a common first and third octet. The second and fourth octet will vary.

 

eg.  192.xxx.100.yyy

 

I have no experience with regular expressions but I think this might work.

 

^192(.[0-9]*){3}(.)100(.[0-9]*){3}$

 

 

MVP
Posts: 500
Registered: ‎04-03-2007

Re: Creating a ClearPass regex for an IP address

The regex you proposed would allow 192.999.100.999, which isn't a valid address (obviously). A quick google search found this, which looks like it would be useful: http://answers.oreilly.com/topic/318-how-to-match-ipv4-addresses-with-regular-expressions/

==========
Ryan Holland, ACDX #1 ACMX #1
The Ohio State University
Frequent Contributor II
Posts: 149
Registered: ‎04-20-2009

Re: Creating a ClearPass regex for an IP address

Thanks Ryan,

 

The document you pointed out gave me a push in the right direction.

From it and a couple of other regex cheat sheets I was able to configure and test the following

 

^192\.([0-9]{1,3})\.100\.([0-9]{1,3})$

 

matches on all ip addresses in the form of 192.xxx.100.yyy

 

 

Search Airheads
Showing results for 
Search instead for 
Did you mean: