Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Deutsch

Beschreibung:

Mit dem folgenden Add-in Skript können Sie die Masquerading-Einstellungen in der Routing-Tabelle von LCOS-Routern ändern.

Liste der verwendeten Variablen:

VariableBeschreibung
context.vars.RoutingTablePeer


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)

{ if

{
    if (context.device.isGateway)

{



 
      // Auslesen der Routen mit Gegenstelle Internet
       
var rows = config.getTableByOid("1.2.8.2").getRows();
     
  // turn result into a list for filtering below:
       
var list = [];
     
  for (var i = 0; i < rows.length; i++) {
         
  list.push(rows[i]);
     
  }

     
  // Ändern der Maskierung zu un-maskiert
     
  list.filter(function (row) {
         
  // find matching rows
         
  var peer = row.getByOid("3");
           
return peer == context.vars.RoutingTablePeer;
     
  }).forEach(function (row) {
       
    row.setByOid(5, "2");
     
  });
 
  }

};

Add-in als JSON-Datei:

View file
nameIPRouterChangeMasquerading.json
height150

...

Englisch

Description:

With the following Addin script you can change the masquerading settings in the routing table of LCOS routers.

List of used variables:

VariableDescription
context.vars.RoutingTablePeer


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)

{ if

{
    if (context.device.isGateway)

{



 
      // Auslesen der Routen mit Gegenstelle Internet
       
var rows = config.getTableByOid("1.2.8.2").getRows();
     
  // turn result into a list for filtering below:
       
var list = [];
     
  for (var i = 0; i < rows.length; i++) {
         
  list.push(rows[i]);
     
  }

     
  // Ändern der Maskierung zu un-maskiert
     
  list.filter(function (row) {
         
  // find matching rows
         
  var peer = row.getByOid("3");
           
return peer == context.vars.RoutingTablePeer;
     
  }).forEach(function (row) {
       
    row.setByOid(5, "2");
     
  });
 
  }

};

Add-in as JSON file:

View file
nameIPRouterChangeMasquerading.json
height150

...