Versionen im Vergleich

Schlüssel

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


Deutsch

With the following Addin script you can add routes to the configuration of LANCOM devices using LCOS.

Englisch

Beschreibung:

Mit dem folgenden Add-in Skript können Sie Routen zur Konfiguration von LANCOM Geräten mit LCOS hinzufügen.

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

/**
 * @param {Config} config
 * @param {Context} context
 * Do not edit this comment or parameter types. Required for code suggestions

*/exports.main

=

function

(config,

context)

{



    // Funktion zum Anlegen von Routen

   
var addRoute = function (DestinationIP, IpMask, RtgTag, AdminDistance, PeerOrIP, Distance, Masquerade, Active, Comment) {

     
  
var TableRouting = config.getTableByOid("1.2.8.2"); // Setup/IP-Router/IP-Routing-Table

     
  var TableRouting_row = TableRouting.createNewRow();
        TableRouting_row.setByOid(1, DestinationIP);
        //[1] IP-Address     : 15 chars from 1234567890.
        TableRouting_row.setByOid(
1
2, 
DestinationIP
IpMask);               //[
1
2] IP-
Address
Netmask   
  : 15 chars from 1234567890.

        TableRouting_row.setByOid(8, RtgTag);               //[8] Rtg-tag        : 5 chars from 1234567890
        TableRouting_row.setByOid(
2
9, 
IpMask
AdminDistance);        //[9] Admin-Distance : 3 chars from 1234567890
        TableRouting_row.setByOid(3, PeerOrIP);             //[
2
3] Peer-or-IP
-Netmask : 15
     : 21 chars from ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789 (lower case characters are converted to upper case)
        TableRouting_row.setByOid(4, Distance);             //[4] Distance       : 2 chars from 1234567890
.

        TableRouting_row.setByOid(5, Masquerade);           //[5] Masquerade     : No (0), on (1), intranet (2)  - numbers has to be used
       
 TableRouting_row.setByOid(
8
6, 
RtgTag); //[8] Rtg-tag : 5 chars from 1234567890
Active);               //[6] Active         : No (1), Yes (0), Semi (2)     - numbers has to be used
        TableRouting_row.setByOid(7, Comment);              //[7] Comment        : 64 chars from #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()*+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz `
        TableRouting.addOrMerge(TableRouting_row);
    };

    //Anlegen der Routen    
    addRoute("123.123.123", "255.255.255.255", "0", "0", "INTERNET", "0", "1", "0", "Route xy");

}

Add-in als JSON-Datei:

View file
nameadd_routes_lcos.json
height150


Englisch

Description:

With the following Addin script you can add routes to the configuration of LANCOM devices using LCOS.

List of used ariables:

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



    // Funktion zum Anlegen von Routen
    var addRoute = function (DestinationIP, IpMask, RtgTag, AdminDistance, PeerOrIP, Distance, Masquerade, Active, Comment) {
        var TableRouting = config.getTableByOid("1.2.8.2"); // Setup/IP-Router/IP-Routing-Table
        var TableRouting_row = TableRouting.createNewRow();
        TableRouting_row.setByOid(1, DestinationIP);        //[1] IP-Address     : 15 chars from 1234567890.
       
 TableRouting_row.setByOid(
9
2, 
AdminDistance
IpMask);               //[
9
2] 
Admin-Distance
IP-Netmask     : 
3
15 chars from 1234567890
.
        TableRouting_row.setByOid(8, RtgTag);               //[8] Rtg-tag        : 5 chars from 1234567890
        TableRouting_row.setByOid(
3
9, 
PeerOrIP
AdminDistance);        //[9] Admin-Distance : 3 chars from 1234567890
        TableRouting_row.setByOid(3, PeerOrIP);             //[3] Peer-or-IP    
: 21 chars from ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()+-,/:;<=>?[\]^_.0123456789 (lower case characters are converted to upper case)

     
  
TableRouting_row.setByOid(4, Distance);           
  
//[4] Distance     
  : 2 chars from 1234567890

       
TableRouting_row.setByOid(5, Masquerade);           
//[5] Masquerade   
  : No (0), on (1), intranet (2) 
 - numbers has to be used 

       
TableRouting_row.setByOid(6, Active);               
//[6] Active         
: No (1), Yes (0), Semi (2)     
- numbers has to be used

       
TableRouting_row.setByOid(7, Comment);           
   //[7] Comment       
 : 64 chars from #ABCDEFGHIJKLMNOPQRSTUVWXYZ@{|}~!$%&'()*+-,/:;<=>?[\]^_.0123456789abcdefghijklmnopqrstuvwxyz `

       
TableRouting.addOrMerge(TableRouting_row);

 
  };


    //Anlegen der Routen    
   
addRoute("123.123.123", "255.255.255.255", "0", "0", "INTERNET", "0", "1", "0", "Route xy");
}


}

Add-in as JSON file:

View file
nameadd_routes_lcos.json
height150
download json file