Forum Discussion
bmohanak_276891
Cirrus
Jul 13, 2016I need help with an iRule to restrict inbound connections to certain IPs
Hello F5 Experts.
I am New to F5 and iRules, I am helping my team to troubleshoot an iRule Issue, Basically the Irule is already in place which is to allow only the IPs listed in the iRule to have ...
Ed_Summers
Nimbostratus
Jul 13, 2016This may be a good application for a data-group. It may make management of the allowed IP addresses easier. If you create an internal data-group called 'allowed_ips', the iRule below will reject connections that are not sourced from an IP in the data-group.
Also for your string match, both entries contain '/devicexx/enxx', so the OR is superfluous. That is, unless the information you redacted is different between the entries?
if { ([string tolower [HTTP::uri]] contains "/devicexx/enxx") ||
([string tolower [HTTP::uri]] contains "/devicexx/enxx/airxx.aws") } {
if { ! [class match [IP::client_addr] eq allowed_ips] } {
log local0. "Matched default policy: Access Denied
reject
}
}
}
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