Forum Discussion
smiley_dba_1116
Nimbostratus
May 06, 2013Block multiple IPs
Quick question. is there a way to use a elseif/else statement to block more then one IP? I have the following iRule to block and singluar or whole subnet, but want to know how I can add an addition IP/Subnet to the rule. Thank you.
when CLIENT_ACCEPTED {
if { [IP::addr [IP::client_addr] equals 10.10.10.10] } {
drop
}
}
3 Replies
- What_Lies_Bene1
Cirrostratus
Try this, using a Data Group/Class;Create a Data Group (called source_ips below) with just the IP addresses of the hosts you’d like to accept when CLIENT_ACCEPTED { if { not [class match [IP::client_addr] equals source_ips] } { reject } } - smiley_dba_1116
Nimbostratus
Will this iRule also allow traffic if people are not on the list?
RGW - What_Lies_Bene1
Cirrostratus
No it won't. If you need it the other way around remove the 'not' and put the unwanted addresses in the DG; everything else will pass.
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