Forum Discussion

sctkd's avatar
sctkd
Icon for Altostratus rankAltostratus
Mar 15, 2021

DNS irule / topology

Hello-

 

I have a DNS irule in place to select a particular pool based on LDNS source subnet. However, the WIP load balancing method still overrides my irule. For example, with the irule in place, GA, RR LB methods will ultimately lead to the incorrect pool selection.

 

Using a Topology reference outside of an iRule, (Wide IP > Topology) with the Topology LB method selected does work, however I need this to work within an iRule. How am I able to enforce the iRule logic?

 

My iRule is as follows:

 

when DNS_REQUEST {

 if { [IP::addr [IP::remote_addr] equals 10.0.0.0/9] } {

    if { [active_members pool1] > 0 } {

       pool pool1

 }

 elseif { [IP::addr [IP::remote_addr] equals 10.128.0.0/9] } {

    if { [active_members pool2] > 0 } {

   pool pool2

 }

}

}

}

 

  • eey0re's avatar
    eey0re
    Icon for Cirrostratus rankCirrostratus

    Just to check - are you are adding this iRule as a GTM iRule (DNS > GSLB > iRules) attached to the WideIP, not as an LTM iRule attached to the Virtual Server (DNS Listener)?

     

    Are you possibly using a non-zero route-domain with your DNS listener? If so, you may need to add that route domain for the IP::addr subnet comparison to work.

  • I adjusted the iRule and it's now processing and matching correctly.

     

    when DNS_REQUEST {

     if { ( [IP::addr [IP::remote_addr] equals 10.0.0.0/9 ] ) and ( [active_members pool1 ] > 0 ) } {

           pool pool1

     }

     if { ( [IP::addr [IP::remote_addr] equals 10.128.0.0/9 ] ) and ( [active_members pool2 ] > 0 ) } {

          pool pool2

     }

    }

  • Thanks eey0re. I do have the iRule in the GSLB iRules and it is attached to the WideIP. Just 1 route domain 0 with everything in it. The logs appear as though there isn't even any iRule in place. Ideas of any debugging within the iRule that would help?

     

    Thanks again.