For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Rene_125890's avatar
Rene_125890
Icon for Nimbostratus rankNimbostratus
Apr 24, 2014

Handling iRules in a Virtual Server

I have a Virtual server that has already associated an iRule. This iRule has a "When CLIENT_ACCEPTED" sentence. I want to add another iRule to this Virtual server that has a "When CLIENT_ACCEPTED" sentence too. Do I have to use only one When CLIENT_ACCEPTED sentence even though this sentences are in different iRules?

 

By the way, I haven't used more than 1 iRule in VS. do iRules have an order in which They are applied?

 

5 Replies

  • You can apply multiple iRules to the same virtual server that trigger on the same events. And you can set priority on them as well:

     

    https://devcentral.f5.com/wiki/iRules.priority.ashx

     

    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      Though it may be possible to combine the iRules into one for simplicity if you so choose.
    • Rene_125890's avatar
      Rene_125890
      Icon for Nimbostratus rankNimbostratus
      so, does it means that iRules are not applied in the order They appear into the VS?
    • Cory_50405's avatar
      Cory_50405
      Icon for Noctilucent rankNoctilucent
      They are applied in the order they appear. When applying priority to events, the highest priority event is executed last in order, ensuring that it takes precedence over any previous matches.
  • And in addition to what Cory said, if you have two iRules with conflicting outcomes the iRule executed last determines the outcome. So if iRule1 says go to pool1 and iRule2 says go to pool2, the traffic goes to pool2. So to avoid a lot of headache - make sure you don't have conflicts in your iRules.