Forum Discussion
Irule help for a VS without default pool assigned.
Hi experts, need some help in the below irule. Idea is to allow traffic to the VS if there is a custom header in the request. But i found out that there is NO default Pool assigned to the VS since there is a LTM Policy attached that is doing uri-based redirections to different Pools. What should i use instead of "pool default" to allow traffic?
when HTTP_REQUEST {
Check if http_header contains the custom header
if { [HTTP::header exists "Customheader"] and ([HTTP::header "Customeheader"] contains "CF53DD5F68BBFC30DFTG5A31A8A41B8AS") } { pool default
if neither value matches drop traffic
} else { drop } }
8 Replies
- Yann_Desmarest_
Nacreous
Hello,
You should use :
pool /partition/pool_nameor alternatively
node ip_addr port_number- sandy16
Altostratus
Thanks Yann, idea is to pass the request if header is there and drop if not. I need to use something generic, like "accept" as the action. But that gives an error of undefined procedure. I dont need to be specific as mentioning the pool or node name as that contradicts the LTM policy applied to the vs.
Hello,
You should use :
pool /partition/pool_nameor alternatively
node ip_addr port_number- sandy16
Altostratus
Thanks Yann, idea is to pass the request if header is there and drop if not. I need to use something generic, like "accept" as the action. But that gives an error of undefined procedure. I dont need to be specific as mentioning the pool or node name as that contradicts the LTM policy applied to the vs.
Hello,
You can do the following :
when HTTP_REQUEST { if { [HTTP::header exists "Customheader"] and ([HTTP::header "Customheader"] contains "CF53DD5F68BBFC30DFTG5A31A8A41B8AS") } { do nothing } else { reject } }or you can negate the if condition :
when HTTP_REQUEST { if { !([HTTP::header exists "Customheader"] and ([HTTP::header "Customheader"] contains "CF53DD5F68BBFC30DFTG5A31A8A41B8AS")) } { reject } }- or you can simply do this directly within your ltm policy
- Yann_Desmarest_
Nacreous
Hello,
You can do the following :
when HTTP_REQUEST { if { [HTTP::header exists "Customheader"] and ([HTTP::header "Customheader"] contains "CF53DD5F68BBFC30DFTG5A31A8A41B8AS") } { do nothing } else { reject } }or you can negate the if condition :
when HTTP_REQUEST { if { !([HTTP::header exists "Customheader"] and ([HTTP::header "Customheader"] contains "CF53DD5F68BBFC30DFTG5A31A8A41B8AS")) } { reject } }- Yann_Desmarest_
Nacreous
or you can simply do this directly within your ltm policy
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