Description:

With the following Add-in script you can configure RSTP on LANCOM Switches of the GS-3xxx series.

List of used variables:

VariableDescription




 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) {



    config.addScriptLine( "configure terminal" );
    config.addScriptLine( "spanning-tree mode rstp" );

    if (context.device.type.indexOf( "GS-3528XP" ) >= 0 ) {
        config.addScriptLine( "interface GigabitEthernet 1/1-12" );
        config.addScriptLine( "spanning-tree" );
        config.addScriptLine( "spanning-tree edge" );
        config.addScriptLine( "exit" );
        config.addScriptLine( "interface 2.5GigabitEthernet 1/1-12" );
        config.addScriptLine( "spanning-tree" );
        config.addScriptLine( "spanning-tree edge" );
        config.addScriptLine( "exit" );
        config.addScriptLine( "interface 10GigabitEthernet 1/1-4" );
        config.addScriptLine( "spanning-tree" );
        config.addScriptLine( "no spanning-tree edge" );
        config.addScriptLine( "exit" );
    }

    if (context.device.type.indexOf( "GS-3152XP" ) >= 0 ) {
        config.addScriptLine( "interface GigabitEthernet 1/1-48" );
        config.addScriptLine( "spanning-tree" );
        config.addScriptLine( "spanning-tree edge" );
        config.addScriptLine( "exit" );
        config.addScriptLine( "interface 10GigabitEthernet 1/1-4" );
        config.addScriptLine( "spanning-tree" );
        config.addScriptLine( "no spanning-tree edge" );
        config.addScriptLine( "exit" );
    }

    config.addScriptLine( "exit" );

};

Add-in as JSON file:

rstp_gs-31xx_switches.json