Forum Discussion
Geo Location I-Rule to Block Continents but allow certain IP addresses then redirect
I have a simple I-Rule that blocks Continents but I need to revise this to block continents I choose, but allow certain IP addresses from a Continent that is blocked. The Continents that are blocked will be redirected to a website. Any help will be appreciated. Here is my current rule blocking traffic from Europe
when CLIENT_ACCEPTED { Get the continent client IP if { [whereis [IP::client_addr] continent] eq "EU"} { log local0. "Traffic from Europe rejected." reject
} }
5 Replies
- Richard__HarlanHistoric F5 Account
You can add a Datagroup with IPs that are allowed.
when CLIENT_ACCEPTED {if { ([whereis [IP::client_addr] continent] eq "EU") && not ( [class match [IP::client_addr] equals whitelist ) {reject}Have not tested just the idea should work.
- marv_Williams_5
Nimbostratus
Comes back as "Not well formed XML"
- Richard__HarlanHistoric F5 Account
Sorry I missed a few close brackets this on syntax checked on a LTM and loaded without a problem
when CLIENT_ACCEPTED { if { ( [whereis [IP::client_addr] continent] eq "EU") && not ( [class match [IP::client_addr] equals whitelist] ) } { reject }}
- marv_Williams_5
Nimbostratus
This one worked. I just need to create a whitelist group. Thanks
- IRONMAN
Cirrostratus
Hi,
Can i use this irule for my LTM to block source base continents wise block list, also how to LTM know the continents IP's .Let me know that step also.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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