Beschreibung:

Mit diesem Add-in Skript können Sie Firewall-Regeln auf LCOS-Geräten konfigurieren.

Liste der verwendeten Variablen:

VariableBeschreibung




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 als JSON-Datei:

LCOS Firewall-Rule.json