Toggle Virtual Address ARP

Problem this snippet solves:

This example shows how to toggle ARP for all the virtual addresses on a unit.

Code :

proc script::run {} {
    set state [lindex $tmsh::argv 1]

    if { $state ne "disabled" && $state ne "enabled" } {
        puts "Requires one argument: \[enabled/disabled\] "
    } else {
        foreach {address} [tmsh::get_config /ltm virtual-address] {
            tmsh::modify /ltm virtual-address [tmsh::get_name $address] arp $state
            puts "ARP $state for virtual address [tmsh::get_name $address]"

proc script::help {} {
    tmsh::add_help "Enable/Disable ARP for all virtual addresses on this unit\n\ntoggle-virtual-address-arp \[enabled/disabled\]"
Published Mar 10, 2015
Version 1.0

Was this article helpful?

1 Comment

  • This Script works in the Common Partition only. It is not working for other partitions even though I create script in each partition.