Description:
With the following Addin script you can add routes to the configuration of LANCOM devices using LCOS.
List of used ariables:
Add-in code:
exports.main = function (config, context) {
var addRoute = function (DestinationIP, IpMask, RtgTag, AdminDistance, PeerOrIP, Distance, Masquerade, Active, Comment) {
var TableRouting = config.getTableByOid("1.2.8.2");
var TableRouting_row = TableRouting.createNewRow();
TableRouting_row.setByOid(1, DestinationIP);
TableRouting_row.setByOid(2, IpMask);
TableRouting_row.setByOid(8, RtgTag);
TableRouting_row.setByOid(9, AdminDistance);
TableRouting_row.setByOid(3, PeerOrIP);
TableRouting_row.setByOid(4, Distance);
TableRouting_row.setByOid(5, Masquerade);
TableRouting_row.setByOid(6, Active);
TableRouting_row.setByOid(7, Comment);
TableRouting.addOrMerge(TableRouting_row);
};
addRoute("123.123.123", "255.255.255.255", "0", "0", "INTERNET", "0", "1", "0", "Route xy");
}
|
---|
Add-in as JSON file:
add_routes_lcos.json