Forum Discussion
irule that block host to all ip address except specific ip
Hello Rafish,
Please try the below irule
when HTTP_REQUEST {
set low_host [string tolower [HTTP::host]]
if {(( $low_host starts_with "test1.technion.ac.il" ) || ( $low_host starts_with "test2.technion.ac.il" ) || ( $low_host starts_with "test3.technion.ac.il" ) || ( $low_host starts_with "test4.technion.ac.il" ) )&& ( [IP::addr [IP::client_addr] equals 10.10.10.10] )} {
HTTP::respond 404 content "Blocked by irule" log local0. "$low_host traffic has come from blocked subnet" }
}
I also got the same error and then I have given space between IP::addr and [IP::client_addr]. After that, irule was working fine. You can also given try by giving space between IP::addr and [IP::client_addr]
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