Forum Discussion

muntae_kim's avatar
Sep 19, 2022

iCall for working as if LLCF (4EA Interface)

hello? My name is Muntae.

Using iCall, the following LLCF operation is required, so please review whether it is possible to operate according to the work method I wrote.

** When all interfaces are disabled, it is an environment where only one interface can be manually enabled. **

 

[Implementation Goal]
- When interface 1.1 is down, 1.2, 2.1, 2.2 down at the same time
- When interface 1.2 down, 1.1, 2.1, 2.2 down at the same time
- When interface 2.1 down, 1.1, 1.2, 2.2 down at the same time
- When interface 2.2 is down, 1.1, 1.2, 2.1 down at the same time

- When interface 1.1 up, 1.2, 2.1, 2.2 up at the same time
- When interface 1.2 up, 1.1, 2.1, 2.2 up at the same time
- When interface 2.1 up, 1.1, 1.2, 2.2 up at the same time
- When interface 2.2 up, 1.1, 1.2, 2.1 up at the same time

 

[Working procedure]
1. Create /config/llcf.conf file
[Attach the file for details]

sys icall script /Common/interface_1_1_down {
app-service none
definition {
exec tmsh modify net interface 1.2 disabled
exec tmsh modify sys icall handler triggered interface_1_2_down script null
exec tmsh modify net interface 2.1 disabled
exec tmsh modify sys icall handler triggered interface_2_1_down script null
exec tmsh modify net interface 2.2 disabled
exec tmsh modify sys icall handler triggered interface_2_2_down script null
}
description none
events none
}

sys icall script /Common/interface_1_1_up {
app-service none
definition {
exec tmsh modify net interface 1.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_2_down script interface_1_2_down
exec tmsh modify net interface 2.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_1_down script interface_2_1_down
exec tmsh modify net interface 2.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_2_down script interface_2_2_down

}
description none
events none
}

sys icall script /Common/interface_1_2_down {
app-service none
definition {
exec tmsh modify net interface 1.1 disabled
exec tmsh modify sys icall handler triggered interface_1_1_down script null
exec tmsh modify net interface 2.1 disabled
exec tmsh modify sys icall handler triggered interface_2_1_down script null
exec tmsh modify net interface 2.2 disabled
exec tmsh modify sys icall handler triggered interface_2_2_down script null
}
description none
events none
}

sys icall script /Common/interface_1_2_up {
app-service none
definition {
exec tmsh modify net interface 1.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_1_down script interface_1_1_down
exec tmsh modify net interface 2.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_1_down script interface_2_1_down
exec tmsh modify net interface 2.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_2_down script interface_2_2_down

}
description none
events none
}

sys icall script /Common/interface_2_1_down {
app-service none
definition {
exec tmsh modify net interface 2.2 disabled
exec tmsh modify sys icall handler triggered interface_2_2_down script null
exec tmsh modify net interface 1.1 disabled
exec tmsh modify sys icall handler triggered interface_1_1_down script null
exec tmsh modify net interface 1.2 disabled
exec tmsh modify sys icall handler triggered interface_1_2_down script null
}
description none
events none
}

sys icall script /Common/interface_2_1_up {
app-service none
definition {
exec tmsh modify net interface 2.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_2_down script interface_2_2_down
exec tmsh modify net interface 1.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_1_down script interface_1_1_down
exec tmsh modify net interface 1.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_2_down script interface_1_2_down

}
description none
events none
}

sys icall script /Common/interface_2_2_down {
app-service none
definition {
exec tmsh modify net interface 2.1 disabled
exec tmsh modify sys icall handler triggered interface_2_2_down script null
exec tmsh modify net interface 1.1 disabled
exec tmsh modify sys icall handler triggered interface_1_1_down script null
exec tmsh modify net interface 1.2 disabled
exec tmsh modify sys icall handler triggered interface_1_2_down script null
}
description none
events none
}

sys icall script /Common/interface_2_2_up {
app-service none
definition {
exec tmsh modify net interface 2.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_2_1_down script interface_2_1_down
exec tmsh modify net interface 1.1 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_1_down script interface_1_1_down
exec tmsh modify net interface 1.2 enabled
exec sleep 5
exec tmsh modify sys icall handler triggered interface_1_2_down script interface_1_2_down

}
description none
events none
}


sys icall script /common/null {
app-service none
definition {
}
description none
events none
}

 

2. Create the /config/user_alert.conf file
[Attach the file for details]

alert interface_1_1_down "Link: 1.1 is DOWN" {
exec command="tmsh generate sys icall event interface_1_2_down"
exec command="tmsh generate sys icall event interface_2_1_down"
exec command="tmsh generate sys icall event interface_2_2_down"
}

alert interface_1_2_down "Link: 1.2 is DOWN" {
exec command="tmsh generate sys icall event interface_1_1_down"
exec command="tmsh generate sys icall event interface_2_1_down"
exec command="tmsh generate sys icall event interface_2_2_down"
}

alert interface_2_1_down "Link: 2.1 is DOWN" {
exec command="tmsh generate sys icall event interface_1_1_down"
exec command="tmsh generate sys icall event interface_1_2_down"
exec command="tmsh generate sys icall event interface_2_2_down"
}

alert interface_2_2_down "Link: 2.2 is DOWN" {
exec command="tmsh generate sys icall event interface_1_1_down"
exec command="tmsh generate sys icall event interface_1_2_down"
exec command="tmsh generate sys icall event interface_2_1_down"
}

alert interface_1_1_up "Link: 1.1 is UP" {
exec command="tmsh generate sys icall event interface_1_2_up"
exec command="tmsh generate sys icall event interface_2_1_up"
exec command="tmsh generate sys icall event interface_2_2_up"
}

alert interface_1_2_up "Link: 1.2 is UP" {
exec command="tmsh generate sys icall event interface_1_1_up"
exec command="tmsh generate sys icall event interface_2_1_up"
exec command="tmsh generate sys icall event interface_2_2_up"
}

alert interface_2_1_up "Link: 2.1 is UP" {
exec command="tmsh generate sys icall event interface_1_1_up"
exec command="tmsh generate sys icall event interface_1_2_up"
exec command="tmsh generate sys icall event interface_2_2_up"
}

alert interface_2_2_up "Link: 2.2 is UP" {
exec command="tmsh generate sys icall event interface_1_1_up"
exec command="tmsh generate sys icall event interface_1_2_up"
exec command="tmsh generate sys icall event interface_2_1_up"
}

3. Merge script configuration:
#tmsh load sys config merge file /config/llcf.conf

4. Apply settings:
- #tmsh save sys config

5. Check to apply script settings:
#list sys icall handler triggered interface 1.1 down
#list sys icall handler triggered interface 1.2 down
#list sys icall handler triggered interface 2.1 down
#list sys icall handler triggered interface 2.2 down
#list sys icall handler triggered interface 1.1 up
#list sys icall handler triggered interface 1.2 up
#list sys icall handler triggered interface 2.1 up
#list sys icall handler triggered interface 2.2 up

  • Ok, just to make sure this worked, I modified for my local vmware fusion environment (updated above to add the correct enabled/disabled keywords) and it works just fine.

    user_alert.conf as is on my system:

    alert interface_1_1_down "Link: 1.1 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.1 } }"
    }
    alert interface_1_3_down "Link: 1.3 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.3 } }"
    }
    alert interface_1_1_up "Link: 1.1 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 1.1 } }"
    }
    alert interface_1_3_up "Link: 1.3 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 1.3 } }"
    }

     bigip_script.conf appropriate objects as is on my system:

    sys icall script interface_manager {
        app-service none
        definition {
            foreach var { action interface } {
                set $var $EVENT::context($var)
            }
            switch ${interface} {
                "1.1" {
                    tmsh::modify /net interface 1.3 ${action}
                }
                "1.3" {
                    tmsh::modify /net interface 1.1 ${action}
                }
            }
        }
        description none
        events none
    }
    sys icall handler triggered interface_manager {
        script interface_manager
        subscriptions {
            interface_manager {
                event-name interface_manager
            }
        }
    }
  • Hi muntae_kim, have you tested this and it works and you're asking if this is an agreeable solution, or are you asking if it will work as you've specified? I think you said "working solution" so if that's the case, it shouldn't be a problem. But there are ways to significantly reduce the complexity of what you've built. I haven't tested the below, so you'll want to study and test (and likely tweak) what I've written, but it should get you on your way (again...test in a lab!)

     

     

    ###
    ### begin user_alert.conf
    ###
    alert interface_1_1_down "Link: 1.1 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.1 } }"
    }
    alert interface_1_2_down "Link: 1.2 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.2 } }"
    }
    alert interface_2_1_down "Link: 2.1 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 2.1 } }"
    }
    alert interface_2_2_down "Link: 2.2 is DOWN" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 2.2 } }"
    }
    alert interface_1_1_up "Link: 1.1 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled  } { name interface value 1.1 } }"
    }
    alert interface_1_2_up "Link: 1.2 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 1.2 } }"
    }
    alert interface_2_1_up "Link: 2.1 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 2.1 } }"
    }
    alert interface_2_2_up "Link: 2.2 is UP" {
        exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 2.2 } }"
    }
    ###
    ### end user_alert.conf 
    ###
    
    ###
    ### begin icall objects
    ###
    sys icall script interface_manager {
        app-service none
        definition {
            foreach var { action interface } {
                set $var $EVENT::context($var)
            }
            switch ${interface} {
                "1.1" {
                    tmsh::modify /net interface 1.2 ${action}
                    tmsh::modify /net interface 2.1 ${action}
                    tmsh::modify /net interface 2.2 ${action}
                }
                "1.2" {
                    tmsh::modify /net interface 1.1 ${action}
                    tmsh::modify /net interface 2.1 ${action}
                    tmsh::modify /net interface 2.2 ${action}
                }
                "2.1" {
                    tmsh::modify /net interface 1.1 ${action}
                    tmsh::modify /net interface 1.2 ${action}
                    tmsh::modify /net interface 2.2 ${action}
                }
                "2.2" {
                    tmsh::modify /net interface 1.1 ${action}
                    tmsh::modify /net interface 1.2 ${action}
                    tmsh::modify /net interface 2.1 ${action}
                }
            }
        }
        description none
        events none
    }
    
    sys icall handler triggered interface_manager {
        script interface_manager
        subscriptions {
            interface_manager {
                event-name interface_manager
            }
        }
    }
    ###
    ### end icall objects
    ###

     

     

    • JRahm's avatar
      JRahm
      Icon for Admin rankAdmin

      Ok, just to make sure this worked, I modified for my local vmware fusion environment (updated above to add the correct enabled/disabled keywords) and it works just fine.

      user_alert.conf as is on my system:

      alert interface_1_1_down "Link: 1.1 is DOWN" {
          exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.1 } }"
      }
      alert interface_1_3_down "Link: 1.3 is DOWN" {
          exec command="tmsh generate sys icall event interface_manager context { { name action value disabled } { name interface value 1.3 } }"
      }
      alert interface_1_1_up "Link: 1.1 is UP" {
          exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 1.1 } }"
      }
      alert interface_1_3_up "Link: 1.3 is UP" {
          exec command="tmsh generate sys icall event interface_manager context { { name action value enabled } { name interface value 1.3 } }"
      }

       bigip_script.conf appropriate objects as is on my system:

      sys icall script interface_manager {
          app-service none
          definition {
              foreach var { action interface } {
                  set $var $EVENT::context($var)
              }
              switch ${interface} {
                  "1.1" {
                      tmsh::modify /net interface 1.3 ${action}
                  }
                  "1.3" {
                      tmsh::modify /net interface 1.1 ${action}
                  }
              }
          }
          description none
          events none
      }
      sys icall handler triggered interface_manager {
          script interface_manager
          subscriptions {
              interface_manager {
                  event-name interface_manager
              }
          }
      }
  • Hi muntae_kim - my apologies, your post got caught in our spam filter. I've just moved it from the spam queue, but want to make sure I understand what you are asking for. You are wanting someone to take a look and make sure that what you wrote above is correct? Are you running into an error, or asking for someone to proof-read before implementing?

  • Yes. We would like to receive an accurate answer to your inquiry as soon as possible.