Forum Discussion
Custom error page iRule with IP address filtering
Hi,
I'm not good with writing iRules so I would like some help. :)
We have a BIG-IP device with LTM and AFM provisioned. Customer would like us to configure the following. They have a list of public IP addresses that are allowed to reach/connect their server in our infra. They want to allow these addresses to access the server, but anything else besides these IPs should be redirected to a custom "underconstruction.html" page.
So I'm guessing the iRule would look like something like this:
if allowed ips try to access SERVER then forward traffic to POOL
else redirect to underconstruction.html
I'm bad at progamming, so this is all I got, I wouldn't know how to program this. :)
Or can this be done with LTM policies?
Any help is very much appriciated.
You can use LTM policy to achieve requirement.
However iRule is also choice. Create data group
and try below iRule.MyIPList
when HTTP_REQUEST { if { [class match [IP::client_addr] equals MyIPList] } { pool alternate_pool } else { HTTP::redirect "https://[HTTP::host]/underconstruction.html" } }
- Samir_Jha_52506Noctilucent
You can use LTM policy to achieve requirement.
However iRule is also choice. Create data group
and try below iRule.MyIPList
when HTTP_REQUEST { if { [class match [IP::client_addr] equals MyIPList] } { pool alternate_pool } else { HTTP::redirect "https://[HTTP::host]/underconstruction.html" } }
- tihi_341714Nimbostratus
Thanks a lot! I managed to get this working with an iFile.
Have a nice day!
Recent Discussions
Related Content
* 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