F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Puneet_110030's avatar
Puneet_110030
Icon for Nimbostratus rankNimbostratus
Dec 11, 2013

using irules to call datagroups

Hi All, I have 3 data groups based on subnets as follows: DG1 10.10.0.0 255.255.0.0 DG2 12.12.0.0 255.255.0.0 DG3 11.11.0.0 255.255.0.0

 

Apart from this i have 3 rate rate classes meant to applied to the the above 3 data groups. Is there a way i can use an irule to call for these 3 data groups, apply 3 different rate classes to them and not apply any rate class to anything else that does fall under the above data groups.

 

Many Thanks.

 

2 Replies

  • Can I assume when you say "3 data groups" that you mean 3 entries in a single (address0based) data group? If so, then something like this:

    when CLIENT_ACCEPTED {
        if { [class match [IP::client_addr] equals my_net_dg] } {
            rateclass [class match -value [IP::client_addr] equals my_net_dg]
        }
    }
    

    where "my_net_dg" is my example address-based data group.

  • I get what you're saying, but I think it would be WAY easier (and more efficient) to do all of this in a single data group. Like this:

    10.10.0.0/255.255.0.0 := rate_class_1
    12.12.0.0/255.255.0.0 := rate_class_2
    11.11.0.0/255.255.0.0 := rate_class_3
    

    Where the address and mask are specified and the value is the corresponding rate class. With 3 separate data groups, you'd have to iterate through all of them to find a match.