NPS connection request policy

Discussion in 'Windows Server 2003 / 2008 / 2012 / 2016' started by jwl, Apr 11, 2014.

  1. jwl

    jwl New Member

    2
    0
    1
    It says in the tech articles that "regular expression pattern matching syntax" can be used to identify ipv4 subnets in a connection request policy. I read the related article about regular expression pattern matching syntax but there were no solid examples. Other Google searches did nothing to clear my mind so here I am hoping someone will know the answer. Does anyone know if you can use 192.168.0. to identify the 192.168.0.0/24 subnet? Or would you simply put 192.168.0.0/24 in the connection request policy to identify the IPv4 subnet?

    Jamie
     
    Last edited: Apr 11, 2014
  2. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    Regular Expressions or 'RegEx' are a part of computer science related to Finite State Machines (FSM) and Lexers.

    Regular expression - Wikipedia, the free encyclopedia
    Tech Stuff - Regular Expressions - A Gentle User Guide and Tutorial

    An ip range RegEx might look something like this :-

    ^192\.168\.0\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$

    Try it out here :-
    RegExr: Learn, Build, & Test RegEx
     
    Last edited: Apr 11, 2014
  3. jwl

    jwl New Member

    2
    0
    1
    dmarsh - Thank you for the reply. I went back and looked at the tech article and I guess I was mistaken. The acceptable format is to use pattern matching syntax and I'm not sure where I got RegEx.
    Here is the tech article reference minus the link.
    dd197583(v=ws.10)
    I am having trouble understanding pattern matching syntax; they do not give examples.

    I can't find anywhere that gives me an example of how to set/specify a subnet when configuring a client IPv4 condition of a connection request policy. My practice test gives me 4 options; I have ruled 2 out and I'm left with:

    1. Set the Client IPv4 address condition to 192.168.0.0/24
    2. Set the Client IPv4 address condition to 192.168.0

    The practice test is trying to say option 2 is best but I can't find any technet articles to back up either answer.
     
  4. dmarsh
    Honorary Member 500 Likes Award

    dmarsh Petabyte Poster

    4,305
    503
    259
    It is RegEx.

    192\.168\.1\..+

    Reads :-
    192 -> Match literal 192
    \. -> Match literal .
    168 -> Match literal 168
    \. -> Match literal .
    1 -> Match literal 1
    \. -> Match literal .
    .+ -> Matches any character one or more times

    Its similar to the pattern I used above, only I used a more specific pattern.

    ^192\.168\.0\.([1-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))$

    ^ -> Match start of line
    192\.168\.0\. -> Match literal 192.168.0.
    [1-9]|[1-9][0-9] -> Match 1 through 9 or 1 through 9 followed by 0 through 9
    | or
    1([0-9][0-9])|2([0-4][0-9]|5[0-5]) -> Match 1 followed by 0 through 9 followed by 0 through 9 or
    2 followed by 0 through 4 followed by 0 through 9 or
    5 followed by 0 through 5
    $ -> Match end of line

    Mine basically does same except it checks for complete line match (^$)
    and it only allows 1-255 in last octet.
     
    Last edited: Apr 11, 2014

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.