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

AP_129594's avatar
AP_129594
Icon for Nimbostratus rankNimbostratus
Sep 04, 2014

Setting iRule from CLI

I need to schedule a task that required to add 2 iRules back into a virtual. Can somebody help me with the syntax?

 

tmsh virtual rules { rule1 } && { rule2 }

 

3 Replies

  • tmsh modify ltm virtual my_virtual rules { rule1 } && { rule2 }
  • there is no add option, so you have to put all the irules.

    e.g.

    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:80
        ip-protocol tcp
        mask 255.255.255.255
        pool foo
        profiles {
            http { }
            tcp { }
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 7
    }
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) modify ltm virtual bar rules { qux quux }
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm virtual bar
    ltm virtual bar {
        destination 172.28.24.10:80
        ip-protocol tcp
        mask 255.255.255.255
        pool foo
        profiles {
            http { }
            tcp { }
        }
        rules {
            qux
            quux
        }
        source 0.0.0.0/0
        source-address-translation {
            type automap
        }
        vs-index 7
    }