Forum Discussion
smiley_dba_1116
Jun 21, 2012Nimbostratus
Whitelist a iRule, otherwise redirect
Need some help creating an iRule. The idea is that I have a VS, and I will be associating a iRule to do a redirect, but I dont want to do a redirect if a the IP/Subnet is in the iRule data group. I t...
nathe
Jun 21, 2012Cirrocumulus
smiley_dba,
As I've learned recently, in this type of case it's simpler (and a shorter irule) to use Not. So, if you're not in the whitelist redirect. This is because a similar post came up very recently (https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2163192/showtab/groupforums/Default.aspx).
Also, not sure what version you're running but know that matchlass was deprecated in v10 by class match. Two examples below.
v9.x
when HTTP_REQUEST {
if {not ([matchclass [IP::remote_addr] equals $::Whitelist_Sorry]) } {
HTTP::redirect "http://sorry.********.ca/"
}
}
v10.x
when HTTP_REQUEST {
if {not ([class match [IP::remote_addr] equals Whitelist_Sorry]) } {
HTTP::redirect "http://sorry.********.ca/"
}
}
Hope these work for you.
N
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