Forum Discussion
yaoxu_11146
Nimbostratus
May 29, 2008how to write universal ACL iRule
we have a F5 device,which is supporting a lot of VSs, and these VSs require the same ACL, which means these VSs only accept access from our Corp intranet. below is our iRule for certain pool:
when CLIENT_ACCEPTED {
if {[matchclass [IP::remote_addr] equals $::Client_Intranet]} {
pool Pool_DestinationPool
} else {drop
}
}
Note: Client_Intranet is the data group.
the pain is that we have to write individual iRule for each pool. i'm wondering whether there is a way to write a universal iRule that works for all VSs which requires the same ACL. sth like below?
if {[matchclass [IP::remote_addr] not equals $::Client_Intranet]} {
drop
}
any advice will be highly appreciated~~
- hoolio
Cirrostratus
Your second rule should work fine to drop any requests which are made from clients not defined in the intranet datagroup. Any other request will be sent to the default pool defined on the virtual server. - yaoxu_11146
Nimbostratus
thanks hoolio, finally i find out it should be this way - hoolio
Cirrostratus
Ah, sorry, I didn't notice the syntax error. - Colin_Walker_12Historic F5 AccountThat's correct. Since the iRules are only associated on a per-VIP basis, you'd have to apply this particular rule to every VIP you wanted to be governed by this ACL. The nice part, at least, is that they would all be referencing the same iRule, so any changes would be globally applied.
- hoolio
Cirrostratus
If you want to enforce a global ACL across all VIPs (and even self IPs), you can use packet filters. For more details, you can take a look at the LTM network and systems configuration guide for your version on AskF5.com. Here's a link to the 9.4 section on packet filters (Click here).
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