{
if (context.network.isCentralGateway) {
var networkList = { // Function to create VRRP Entry var addVRRPEntry = function (routerID, routerIP, mainPrio, backupPrio, remoteSite, comment) { var table1_2_8_21_2 = config.getTableByOid("1.2.8. |
---|
730
var rowDmz = networkList.createNewRow();
rowDmz.setByOid("1", "DMZ");
rowDmz.setByOid("2", context.vars.DMZ_IP);
rowDmz.setByOid("3", "255.255.255.0");
rowDmz.setByOid("4", "1");
rowDmz.setByOid("5", "256");
rowDmz.setByOid("6", "0");
rowDmz.setByOid("7", "2");
rowDmz.setByOid("8", "0");
rowDmz.setByOid("9", "demilitarized zone");
networkList.addOrMerge(rowDmz);
var routingTable = config.getTableByOid("1.2.8.2");
var routeToGw = routingTable.createNewRow();
routeToGw.setByOid("1", "255.255.255.255");
routeToGw.setByOid("2", "0.0.0.0");
routeToGw.setByOid("8", "0");
routeToGw.setByOid("6", "0");
routeToGw.setByOid("3", context.vars.DMZ_GW);
routeToGw.setByOid("4", "0");
routeToGw.setByOid("5", "0");
routeToGw.setByOid("7", "");
routingTable.addOrMerge(routeToGw);
config.setScalarByOid("1.2.102.12", "DMZ");
config.setScalarByOid("1.2.8.21.1", "1");
config.setScalarByOid("1.2.8.21.3", "30");
var vrrpList = config.getTableByOid("1.2.8.21.2");
var vrrpRow = vrrpList.createNewRow();
vrrpRow.setByOid("1", context.vars.VRID);
vrrpRow.setByOid("2", context.vars.VRRP_IP);
vrrpRow.setByOid("3", context.vars.VRRP_PRIO);
vrrpList.addOrMerge(vrrpRow);
var table_1_2_8_21_2_row_1 = table1_2_8_21_2.createNewRow(); table_1_2_8_21_2_row_1.setByOid(1, routerID); table_1_2_8_21_2_row_1.setByOid(2, routerIP); table_1_2_8_21_2_row_1.setByOid(3, mainPrio); table_1_2_8_21_2_row_1.setByOid(4, backupPrio); table_1_2_8_21_2_row_1.setByOid(5, remoteSite); 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); }; // If Statement to only create VRRP Entry, if device has the variable VRRP_Prio if (context.vars.VRRP_PRIO != "") { config.setScalarByOid("1.2. |
---|
1950
var lbInstances = config.getTableByOid("1.2.19.50.2");
var lbInstance = lbInstances.createNewRow();
lbInstance.setByOid("1", context.vars.VRID);
lbInstance.setByOid("2", context.vars.DMZ_IP);
lbInstance.setByOid("4", "DEFAULT");
lbInstances.addOrMerge(lbInstance);
var messageProfiles = config.getTableByOid("1.2.19.50.3");
var profile = messageProfiles.createNewRow();
profile.setByOid("1", "DEFAULT");
profile.setByOid("2", "DMZ");
profile.setByOid("3", "239.255.22.11");
profile.setByOid("4", "1987");
profile.setByOid("5", "2000");
profile.setByOid("6", "3000");
profile.setByOid("7", "5");
profile.setByOid("8", "15");
profile.setByOid("9", context.vars.LOAD_PASSWORD);
profile.setByOid("10", "3");
profile.setByOid("11", "1");
messageProfiles.addOrMerge(profile);
}
}; // Function Call to create a new Entry addVRRPEntry("1", "10.10.10.254", context.vars.VRRP_PRIO, "0", "INTERNET", ""); } }; |
---|
Add-in as JSON file: View file |
---|
name | ike_load_balancer.json |
---|
height | 150 |
---|
|
|