Forum Discussion
6 Replies
- DEJNimbostratus
Hello,
Depending on your VIP preference. The below irule will drop the traffic if neither value matches. If there is a match it will go to the default pool assigned to the VIP. If you need both values to match change or to and.
when HTTP_REQUEST { Check if http_header contains hex code or the client IP is not in the allow list if { !(([HTTP::header "name_of_header"] equals "3196E8D30330CA17238FAS013036") or ([class match [IP::client_addr] equals WHITELIST]))} { if neither value matches drop traffic drop } }
- sandy16Altostratus
thanks, so I have done this (added the pool default and else for drop) but it gives me some errors in the GUI -
when HTTP_REQUEST { Check if http_header contains hex code or the client IP is not in the allow list if { !([HTTP::header "name_of_header"] equals "3196E8D30330CA17238FAS013036" or [class match [IP::client_addr] equals WHITELIST])} { pool default else { if neither value matches drop traffic drop } }
- DEJNimbostratusHello S, I've updated the iRule a bit. My apologies but I'm pretty much free-handing this iRule (left my laptop at work). A few questions. 1. What header will contain the hex value you are matching against? 2. Have you already created the datagroup you will be using in this iRule? 3. Try the edited code in my original reply. If you still get a GUI error, please post the error.
- sandy16Altostratus
ok, the error i get is: [invalid option "else" must be: member][else] what am i doing wrong?
- DEJNimbostratusLooking at the iRule you pasted in it looks like there may be a close bracket missing in front of else } else
- sandy16Altostratus
ok, i found the issue. the else statement needs to be in the same line as the close bracket. Valid format: } else { drop
Invalid format: else { drop