Svevak_211593
Feb 25, 2016Nimbostratus
whitelist + geoblocking in iRule
Hi,
the problem is I would like to allow some countries and some IPs from not allowed countries to get access.
I'm not quite sure why this won't work:
when CLIENT_ACCEPTED {
switch[ whereis [IP::client_addr] country ] {
"DE" { set allowed 1 }
"AT" { set allowed 1 }
"CH" { set allowed 1 }
"LI" { set allowed 1 }
"LU" { set allowed 1 }
default { set allowed 0 }
}
elseif {
if {
[matchclass [IP::client_addr] equals datagroup whitelistIP ] } {
pool datagroup-whitelistIP
}
else {
reject
}
}
Can anybody help me?