Forum Discussion

HIZ_389275's avatar
HIZ_389275
Icon for Nimbostratus rankNimbostratus
Apr 24, 2019

Control iRule by TMSH

Hi, I am searching command line for iRule which can be available by TMSH. In advance I made two kinds of iRules, and when something happens,want to apply either by command line. I understand WEBUI is easier, but I just want to confirm.

 

5 Replies

  • Enter

    tmsh
    if you aren't already in the TMOS shell. Then execute this command:

    modify ltm virtual  rules {  ... }

    where and are the names of the virtual server and iRule, respectively. If either is in an administrative partition, be sure to specify that in the name. This will probably replace any iRules previously assigned to the virtual server, so you'll want to specify those as well as the one you're adding.

  • Moreover, if possible, could you tell how to make iRule disable, I just tried to replace create with delete, but syntax error occurred.

     

    • jaikumar_f5's avatar
      jaikumar_f5
      Icon for MVP rankMVP

      Hi HIZ,

      You said in your post,

      when something happens
      , care to share the scenario, maybe we can help better, which you can complete in a single Irule too.

    • HIZ_389275's avatar
      HIZ_389275
      Icon for Nimbostratus rankNimbostratus

      Hi Jaikumar, Thank you for your reply. Unfortunately hard to share any information according to NDA. I just would just like to know how to disable iRule by tmsh which is on virtual srv in advance. Many thanks!

       

  • The modify command can be used to remove an iRule from a virtual server. If the rule you added is the only one in use, then specify

    rules {none}
    . Otherwise, just list the previous rules, excluding the one that was added:
    rules {rule-1 rule-2}
    .