Forum Discussion
Deekdeek_103899
Feb 28, 2011Nimbostratus
Newbie mantenance page based on IP address
Hi Im new to F5 world. what i want to do for our maintenance page that redirects all except a certain IP address specified to a site down page. so something like this only IP a...
Chris_Miller
Mar 01, 2011Altostratus
Did you create the datagroup yet? It's pretty self-explanatory once you get to the data groups section via my instructions above.
From there, let's say you made a data group called "maintenance_addresses." Your iRule would look similar to below:
when HTTP_REQUEST {
if { ![matchclass [IP::client_addr] eq maintenance_addresses] } {
HTTP::redirect "http://www.sample.com/maintenancepage.html" }
}
For a step-by-step on the rule:
1. First, we're doing this from the HTTP_REQUEST event. That event is triggered as soon as the user makes an HTTP Request.
2. We're using "matchclass" to see whether the data group you created contains the user's IP address. Since we want to redirect users whose IPs aren't in the data group, we're using the "!" symbol to basically say "if their address isn't in the data group."
3. If their address wasn't in the data group, we redirect them to the maintenance page.
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