Forum Discussion

Bhupendra's avatar
Bhupendra
Icon for Altocumulus rankAltocumulus
Jun 20, 2023

irule

I want to put below condition on irule, please help

1. If source IP matches and URI is /A  and /B traffic should be forwarded to POOL A

2. If user is accessing /C-new, rewrite URI to /C and forward to POOL A

3. if not matches 1 and 2 condition defalut POOL B

7 Replies

  • Maybe think about using a local traffic policy rather than an iRule. It will be more efficient and easier for you to manage

  • Hi Bhupendra , 
    in Step 2 of rewrite >>> do you need the source ip matches as well or Not ? 

    So you need to match on specific source IP address/address first and then match /A or /B then move traffic to pool A but if the same match on source ip address/addresses but with uri starts with /c-new modify it to be /C and forward traffic to pool A 

    if non of those forward to pool B 

    that's Correct ? 

     

    • Bhupendra's avatar
      Bhupendra
      Icon for Altocumulus rankAltocumulus

      Hi Mohamed_Ahmed_Kansoh 

       

      in Step 2 of rewrite >>> do you need the source ip matches as well or Not ? ------- >>>>No we don't want to match source IP here only URI with any source.

      So you need to match on specific source IP address/address first and then match /A or /B then move traffic to pool A but if the same match on source ip address/addresses but with uri starts with /c-new modify it to be /C and forward traffic to pool A 

      if non of those forward to pool B
      that's Correct ? ----------------->>First condition match on specific source IP address/address first  then match URI /A or /B for selected source IPs then move traffic to pool A

      Second condition -any source with uri starts with /c-new modify it to be /C and forward traffic to pool A

      If no condition match from 1&2 then default traffic should be route POOL B