Forum Discussion
AndOs
May 28, 2017Cirrostratus
Yes.
You could use something simple like this
when RULE_INIT {
set static::bypass_LB_net "10.20.118.0/24"
set static::bypass_LB_member "10.210.34.100"
}
when CLIENT_ACCEPTED {
set currentpool [LB::server pool]
if { [IP::addr [IP::client_addr] equals $static::bypass_LB_net] } {
pool $currentpool member $static::bypass_LB_member
}
}
or if you want to be more dynamic, use a datagroup where you define which network you want to send to which pool member.
ltm data-group internal bypass_LB_DG {
partition test
records {
10.10.20.0/24 {
data 10.110.30.43
}
10.20.118.0/24 {
data 10.210.34.100
}
}
type ip
}
ltm rule bypass_LB_irule {
when CLIENT_ACCEPTED {
set currentpool [LB::server pool]
set poolmember [class match -value [IP::client_addr] equals bypass_LB_DG]
if { $poolmember ne "" } {
some errorhandling is always good to have :)
if { [catch {
pool $currentpool member $poolmember
} poolselectstatus] != 0} {
log local0. "Error selecting member $poolmember $poolselectstatus"
}
}
}
}
These are a bit untested but hopefully you can get something out of them 🙂
/Andreas