Forum Discussion

vinceKahn_97184's avatar
vinceKahn_97184
Historic F5 Account
Mar 14, 2011

GTM - Topology irule

I'm trying to create an irule that uses one of my defined topology records to make a decision. I thought maybe "matchregion" would do it but can't get it to work. Maybe this isn't what matchregion is for? But in the example below it doesn't matter if i say equal or not equal it's never true. Any ideas?

 

 

when DNS_REQUEST {

 

if { [matchregion [IP::client_addr] equals Parkwood] } {

 

host 10.1.1.1

 

}

 

}

 

7 Replies

  • Hi guys,

     

    It does not seems to be working with me !! how about you Vince ?

     

     

    when DNS_REQUEST {

     

    if { [matchregion ldns ip] equals $CGNO}{

     

    host 10.1.1.1

     

    log local2. "**** Request from [IP::client_addr]****"

     

    }

     

    else { host 2.2.2.2

     

    log local2. "****Request from [IP::client_addr] ****"

     

    }

     

    }

     

     

    I configured Region using the Big-IP GUI:

     

    CGNO

     

    IP:subnet is x.x.x.x/24

     

     

    Even i'm not getting anything in the log, unless I put the log line before if statement !

     

     

    Thanks
  • Hi Wassim,

     

    Is your "CGNO" a datagroup or defined within topology?

     

     

    Bhattman

     

  • Hi Bhattman ,

     

     

    It's defined within topology:

     

    Global Traffic ›› Topology : Regions

     

     

    Not sure what data group is!

     

     

    -W
  • Hey guys,

     

     

    It's working now. I followed this thread: "GTM iRule help with matchregion?"

     

    http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1174529/showtab/groupforums/Default.aspx1225408

     

    Thanks for Banyan,

     

    Here what i did according to Banyan's example:

     

     

    when DNS_REQUEST {

     

    if { [matchregion ldns CGNO]}{

     

    host 1.1.1.1

     

    log local2. "**** Request from [IP::client_addr]****"

     

     

    }

     

    else { host 2.2.2.2

     

    log local2. "****Request from [IP::client_addr] ****"

     

    }

     

    }

     

     

  • vinceKahn_97184's avatar
    vinceKahn_97184
    Historic F5 Account
    Thanks everyone, finally got back here after being off most of last week. Here's what worked based on the examples above:

     

     

    when DNS_REQUEST {

     

    if { [matchregion ldns Parkwood] } {

     

    log local0. "[IP::client_addr]"

     

    host 10.1.1.1

     

    }

     

    }
  • Also may be useful

     

    https://devcentral.f5.com/community/group/aft/1170857/asg/39