Description:
You can use this add-in script to configure firewall rules on LCOS devices.
List of used variables:
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) { var addFirewallRule = function ( Name , Protocols , Source , Destination , Action , SrcTag , RtgTag ) { var firewallRule = config.getTableByOid( "1.2.8.10.2" ); var firewallRule_row = firewallRule.createNewRow(); firewallRule_row.setByOid( "1" , Name ); // Name of this rule firewallRule_row.setByOid( "2" , Protocols ); // Protocols firewallRule_row.setByOid( "3" , Source ); // Source firewallRule_row.setByOid( "4" , Destination ); // Destination firewallRule_row.setByOid( "7" , Action ); // Actions firewallRule_row.setByOid( "15" , SrcTag ); // Actions firewallRule_row.setByOid( "14" , RtgTag ); // Routing tag firewallRule.addOrMerge(firewallRule_row);
} // Firewall Prefixes // %L local network // %H DSL- / ISDN- / PPTP- or VPN-Remote-Site // %E MAC-Address // %A IP-Address // %M Netmask // %P Protocol // %S Services/Ports // Example Rule // addFirewallRule("DenyAll", "ANYHOST", "ANYHOST", "REJECT", "0")
};
|
---|
Add-in as JSON file:
LCOS Firewall-Rule.json