Dieses Skript setzt alle Schnittstellen- und Routing-Tags auf Null 0, um die L3-Netzwerktrennung aufzulösen und allen Netzen den Zugriff auf alle Routen zu ermöglichen. In /** * @param {Config} config * @param {Context} context * Do not edit this comment or parameter types. Required for code suggestions */ exports.main = function (config, context) {
// // Function to create VRRP EntrySetup/TCP-IP/Network-list/ var addVRRPEntry = function (routerID, routerIP, mainPrio, backupPrio, remoteSite, comment) { var table1_2_8_21_2 = networkTable = config.getTableByOid("1.2.87.21.230"); var table_1_2_8_21_2_row_1 = table1_2_8_21_2.createNewRow networkTableRows = networkTable.getRows();
table_1_2_8_21_2_row_1.setByOid(1, routerID);// turn result into a list for easier iteration var networkTableList = []; for (var i = 0; i < networkTableRows.length; i++) { table_1_2_8_21_2_row_1.setByOid(2, routerIPnetworkTableList.push(networkTableRows[i]); }
table_1_2_8_21_2_row_1.setByOid(3, mainPrio);networkTableList.forEach(function (row) { table_1_2_8_21_2_ row_1.setByOid(48, backupPrio"0"); // set routing tag to 0 table_1_2_8_21_2_row_1.setByOid(5, remoteSitenetworkTable.addOrMerge(row); table_1_2_8_21_2_row_1.setByOid(6, comment});
table1_2_8_21_2.addOrMerge(table_1_2_8_21_2_row_1// /Setup/IP-router/routing-table var routingTable = config.getTableByOid("1.2.8.2"); }var routingTableRows = routingTable.getRows();
// If Statement to only create VRRP Entry, if device has the variable VRRP_Prioturn result into a list for easier iteration var routingTableList = []; if (context.vars.VRRP_PRIO != ""for (var i = 0; i < routingTableRows.length; i++) { configroutingTableList.setScalarByOid("1.2.8.21.1", "1"); push(routingTableRows[i]); }
routingTableList.forEach(function (row) { row.setByOid(8, "0"); // Function Call to create a new Entryset routing tag to 0 addVRRPEntry("1", "10.10.10.254", context.vars.VRRP_PRIO, "0", "INTERNET", ""routingTable.addOrMerge(row); }); }; |
---|
Addin View file |
---|
name | routing_and_interface_tag_mod.json |
---|
height | 150 |
---|
|
|