Forum Discussion
Rafish_129330
Nimbostratus
Apr 23, 2018irule that block host to all ip address except specific ip
Hello,
I need irule that block access to some url for all ip address except specific ip, i wrote the irule and i success to block the url but the problem is that the irule block access to all i...
Lee_Sutcliffe
Nacreous
Apr 23, 2018You could simply the logic by placing different host headers into a datagroup:
**DATAGROUP**
ltm data-group internal host_dg {
records {
test1.technion.ac.il {}
test2.technion.ac.il {}
test3.technion.ac.il {}
test4.technion.ac.il {}
}
type string
}
**iRULE**
when HTTP_REQUEST {
if {([class match [HTTP::host] starts_with host_dg]) && ([IP::addr[IP::remote_addr] equals 10.10.10.10/255.255.255.255])} {
HTTP::respond 404 "Not Found" "Connection" "close"
log local0. "This Connetion blocked By iRule My-iRule"
}
}
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