Forum Discussion
irule rejecting all the request
we have created below irule in which we want to allow one ip address to access the normal website all other request should be rejected but when we place below rule url is not opening even for 10.1.1.1
when HTTP_REQUEST { if { [HTTP::host] contains "a.b.com" } { switch [IP::addr [IP::client_addr] mask 255.255.255.255] { "10.1.1.1" { pool Pool_A_Prod } default { reject } } } }
3 Replies
- Lee_Payne_53457
Cirrostratus
We use something similar to the below to block access to some sites, unless you are aplpying the iRule to multiple VIP's or have multiple DNS names pointing to the same VIP I wouldn't bother looking in the host header it adds needless complication.
set clientip [IP::client_addr] if { [IP::addr 10.1.1.1/32 equals $clientip] } { pool pool_a } else { reject } - Thomas_Gobet
Nimbostratus
I'm sorry to ask you that but why did you post it a second time ? There's already your own question here : https://devcentral.f5.com/questions/irule-not-working-23758 - IheartF5_45022
Nacreous
Your problem was trying to use a switch statement with [IP::addr [IP::client_addr] mask 255.255.255.255] - it doesn't work like that. Use the syntax lapayne suggests.
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