Forum Discussion
sysadmin_2015_2
Nimbostratus
Sep 08, 2017Virtual Server - Block IP
Hello,
We need to block a several subnets for a particular virtual server. Is the best way to use an iRule? And can you please send me an example of an iRule we can use?
Thank you for the...
Faruk_AYDIN
Altostratus
Sep 11, 2017In my opinion, the best way is to create an IP datagroup, then write an iRule like this:
Datagroup which defines denied client IP addresses/networks
class denied_clients {
network 10.0.0.0/8
host 192.168.10.0/24
}
when CLIENT_ACCEPTED {
if { [class match [IP::client_addr] equals denied_clients] }{
log local0. "client IP: [IP::client_addr] - discarded"
discard
}
}
To use a datagroup makes it easy to manage, whenever you want to add an IP subnet or delete an IP subnet, you can do it easily without touching to the 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