Forum Discussion
Permit specif IPs to pools, all others see a simple maintenance page
I have an iRule set up to redirect to specific pools depending on uri. Now maintenance is being done and only specific IPs need to be allowed to sites, all other get a simple web page that the site is down.
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/jumper" { pool tango.golf_TGIIS_Https_Pool log local0. "redirect irule pool tango.golf_TGIIS_Https_Pool" } "/" - "/annie" - "/bugg" - "/charles" - "/dog" - "/fashion" - "/golf" - "/harry" - "/ink" - "/jonas" - "/kegg" - "/limber" - "/micro" - "/nosehair" - "/orange" - "/pinky" - "/queen" - "/romeo" - "/survey" - "/tango" - "/useless" - "/valve" - "/whiskey" - "/xray" - "/yonkers" - "/zulu" - "/poolball*" { pool waterpolo_WPIIS_Https_Pool log local0. "redirect irule pool waterpolo_WPIIS_Https_Pool" } default { pool skijump_SKJWEB_Https_Pool log local0. "redirect irule pool skijump_SKJWEBHttps_Pool" } } }
I've set up a Datagroup list with the IP's in it. I just need assistance allowing only the ips in group to the site, while sending all others to the simple website down page. I have an irule for that also.
2 Replies
- John_Alam_45640Historic F5 AccountCan you re-post your question. This time add a couple of empty lines before and after your iRule, then highlight the irule and press CTRL-K.
- Thomas_Gobet
Nimbostratus
You can add the data group condition at the first line of your iRule.
For example :
when HTTP_REQUEST { if { not ( [class match [IP::client_addr] equals my_ip_datagroup] ) } { reject } switch -glob [string tolower [HTTP::uri]] { "/jumper" { pool tango.golf_TGIIS_Https_Pool log local0. "redirect irule pool tango.golf_TGIIS_Https_Pool" } "/" - "/annie" - "/bugg" - "/charles" - "/dog" - "/fashion" - "/golf" - "/harry" - "/ink" - "/jonas" - "/kegg" - "/limber" - "/micro" - "/nosehair" - "/orange" - "/pinky" - "/queen" - "/romeo" - "/survey" - "/tango" - "/useless" - "/valve" - "/whiskey" - "/xray" - "/yonkers" - "/zulu" - "/poolball*" { pool waterpolo_WPIIS_Https_Pool log local0. "redirect irule pool waterpolo_WPIIS_Https_Pool" } default { pool skijump_SKJWEB_Https_Pool log local0. "redirect irule pool skijump_SKJWEBHttps_Pool" } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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