iRule to apply Dynamic Bandwidth Controller Policy depending on Client subnet

Hi all,

We have a requirement to apply different Dynamic Bandwidth Controller Polcies depending on the client subnet. This needs to operate on both traffic from client and from server. I have an example which works for all Clients, but need to assign different limits based on client subnet.

when CLIENT_ACCEPTED {
    set mycookie [IP::remote_addr]:[TCP::remote_port]
    BWC::policy attach dynamic_BC $mycookie
}

when SERVER_CONNECTED {
    set mycookie [IP::remote_addr]:[TCP::remote_port]
    BWC::policy attach dynamic_BC $mycookie
}

An example of what I wish to achieve:

Client address is in 10.200.0.0/22 then 1MBit maximum upload/download enforced. Client address is in 10.204.0.0/22 then 10MBit maximum upload/download enforced.

Thanks in advance!

Steve

You can use the example in this page to change your irule:

when CLIENT_ACCEPTED {
  if { [IP::addr [IP::remote_addr] equals 206.0.0.0 mask 255.0.0.0] } {
     pool clients_from_206
  } else {
     pool other_clients_pool
 }
}