Forum Discussion

Grandiser's avatar
Grandiser
Icon for Nimbostratus rankNimbostratus
Feb 12, 2024

CLI syntax to change i-rule order

Hi;   Let's say I had a virtual server called Vserver and I had to irules bound to it. i-rule1 and i-rule2   In the Web based console "GUI", I can control the order by going to Local traffic >> v...
  • F5_Design_Engineer's avatar
    Feb 12, 2024

    Hi Grandiser,

    You can use

     

    tmsh edit ltm rule 'name_of_the_iRule'

     

     

    2nd method

    Create a new irule with new name using create command with new rule order sequence 

    tmsh create ltm rule NEW-IRULE irule1 irlue 2

    then use modify statement in the Virtual server to switch the iRule to new iRule

    tmsh modify /ltm virtual rules { NEW-IRULE }

    Please note  this will removes all the applied irules and only adds the new irule inside the curly braces.

    When using tmsh, you can only create iRules using the editor, which starts when you use the create or edit commands. You cannot create an iRule directly on the command line. The vim editor applies the autoindent and smartindent options. You can toggle on/off paste mode using the F12 key.

     

    11.3 tmsh cli for irule | DevCentral

    https://clouddocs.f5.com/cli/tmsh-reference/v13/modules/ltm/ltm_rule.html

    Hope this helps

    🙏