Forum Discussion
Marc_Weisbrod_6
Nimbostratus
Nov 09, 2006IRule to redirect to another side based on network
All,
I am trying to write an Irule to redirect users who are not on our local site to another page. I have written this Irule but I am unsure if the Irule can accept subnets.
...
hoolio
Cirrostratus
Nov 09, 2006You can set up your hosts and networks in a class (datagroup in the GUI) and then reference that class in a rule. Here is an example:
class my_hosts_networks_class {
network 10.0.0.0 mask 255.0.0.0
host 192.168.0.100
}
rule filter_clients_rule {
when HTTP_REQUEST {
if { [matchclass [IP::remote_addr] equals $::my_hosts_networks_class] } {
pool http-pool
}
else {
HTTP::redirect "http://192.168.0.12/local_only.jsp"
}
}
}You can either add the class in the GUI under iRules >> Datagroups, or edit the bigip.conf and run 'b load' to initialize the change.
Aaron
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
