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 }

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
}

thanks a bunch…just a space between the 2 rules :slight_smile: