Description:

This add-In script can be used to configure VRRP on LANCOM Routers with LCOS Version 10.80 and below.

List of used variables:

VariableDescription
VRRP_PRIOAssign to devices which should use VRRP and set a priority.

Add-in code:

/**
 * @param {Config} config
 * @param {Context} context
 * Do not edit this comment or parameter types. Required for code suggestions
*/
exports.main = function (config, context) {
        if (context.vars.VRRP_PRIO != "") {
                config.setScalarByOid("1.2.8.21.1", "1");               // Enable VRRP
               
                var VRRPtable = config.getTableByOid("1.2.8.21.2");
                var VRRPtable_row = VRRPtable.createNewRow();
                VRRPtable_row.setByOid(1, "42");                        // Router ID
                VRRPtable_row.setByOid(2, "10.10.10.10");               // Router IP
                VRRPtable_row.setByOid(3, context.vars.VRRP_PRIO);      // Main Priority
                VRRPtable_row.setByOid(4, "0");                         // Backup Priority
                VRRPtable_row.setByOid(5, "INTERNET");                  // Remote Site
                VRRPtable_row.setByOid(6, "");                          // Comment
                VRRPtable.addOrMerge(VRRPtable_row);
        }
};

Add-in as JSON file: