Forum Discussion
Svevak_211593
Nimbostratus
Feb 16, 2016whitelist for IPs in iRule
Hello,
I would like to whitelist some IPs in an iRule. The IPs are defined in a datagroup.
Here is my code, but I'm not sure if this works...
when CLIENT_ACCEPTED {
if { ([class ...
Svevak_211593
Nimbostratus
Feb 24, 2016Thank you guys! I think it works this way:)
I got one more question. I would like to add Geoblocking to this iRule. But it doesn't work for me.
So Whitelist for one IP + Geoblocking:
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
}
}
Is this correct?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects