Forum Discussion
Gorf_33479
Nimbostratus
Mar 10, 2011iRule to filter based on subnet
Greetings all, I have been reading some other forum posts about using iRules to filter client IP's, and I have come across some discussions about how to get subnets to work, but I am still a little lo...
hoolio
Cirrostratus
Mar 10, 2011Hi Gorf,
The switch statement you're using performs a string comparison of the client IP against the addresses. It would be more efficient to use an address type datagroup and 'matchclass' to do this. An address datagroup also supports subnets.
http://devcentral.f5.com/wiki/default.aspx/iRules/matchclass
when CLIENT_ACCEPTED {
if { not ([matchclass [IP::client_addr] equals allowed_subnets_class]) } {
drop
}
}
Aaron
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