Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Help with version 4.x irule

Hello,

   I have 2 urls
    https://mydomain/baa/init.do
    https://mydomain/admin/init.do

   And one pool mydomain.

My requirement is from a single soure 10.2.2.4 only allow access to url https://mydomain/admin/init.do rest all has to go to https://mydomain/baa/init.do or discard.

   The Big-IP OS is running 4.5.11

   I tried with the following statement

if(client_addr == 10.2.2.4)
{redirect to "https://mydomain" + "/admin" + "/init.do" + http_uri}
else {use pool mydomain}
if(client_addr!= 10.2.2.4)
{redirect to "https://mydomain" + "/baa" + "/init.do" + http_uri}
{use pool mydomain}
 else {discard}
}

   But its not working.
   This is really urgent for me please help.
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Can i have some help on this pls
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
The logic in the iRule doesn't make sense to me.  If client_addr equals "10.2.2.4" redirect, else use pool.  Then you do a not test on the client_addr which would be the same case as the previous else.  You then have an extra "{use pool mydomain}" before the else.

This is a shot in the dark, but this might do what you want

if (client_addr == 10.2.2.4)
{ redirect to "https://mydomain/admin/init.do" + http_uri }
else
{ redirect to "https://mydomain/baa/init.do" + http_uri }


If you define the default pool to "mydomain" this should work for you.  I'm still unclear how the "discard" fits in.  What case would you want that applied since you are only comparing on source ip and that is either equals or not equals.

If you can provide a more detailed logic flow for how you want it to work, I could try to expand a bit further on this.

-Joe
0