Versionen im Vergleich

Schlüssel

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


Deutsch

Beschreibung:

Mit diesem Skript können Sie ein Port-Forwarding erstellen.

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



    // Required variables:
    // CustomTag  = string
    // CustomIP   = string
    // CustomPort = string

    // /Setup/IP-Router/1-N-NAT/Service-Table
    var serviceTable = config.getTableByOid("1.2.8.9.4");
    var myRow = serviceTable.createNewRow();
    myRow.setByOid("1", context.vars.CustomPort);  //D-port-from
    myRow.setByOid("5", "0");                      //Active (No (1), Yes (0))
    myRow.setByOid("3", context.vars.CustomPort);  //D-port-to
    myRow.setByOid("7", "MANAGEMENT");             //Peer
    myRow.setByOid("2", context.vars.CustomIP);    //Intranet-Address
    myRow.setByOid("4", "443");                    //Map-Port
    myRow.setByOid("8", "0");                      //Protocol (TCP (1), UDP (2), TCP+UDP (0))
    myRow.setByOid("9", "0.0.0.0");                //WAN-Address
    myRow.setByOid("6", "");                       //Comment
    serviceTable.addOrMerge(myRow);

};

Add-in als JSON-Datei:

View file
nameport_forwarding.json
height150

Englisch

Description:

You can use this script to create a port forwarding.

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)

{



   
//
Required
variables:

    //
CustomTag
 =
string
string
    //
CustomIP
  =
string
string
    //
CustomPort
=
string
string

    //
/Setup/IP-Router/1-N-NAT/Service-Table
var serviceTable =

    var serviceTable = config.getTableByOid("1.2.8.9.4");
var myRow =

    var myRow = serviceTable.createNewRow();

    myRow.setByOid("1",
context.vars.CustomPort);
 //D-port-from

    myRow.setByOid("5",
"0");
                     //Active
(No
(1),
Yes
(0))

    myRow.setByOid("3",
context.vars.CustomPort);
 //D-port-to

    myRow.setByOid("7",
"MANAGEMENT");
//Peer
            //Peer
    myRow.setByOid("2",
context.vars.CustomIP);
   //Intranet-Address

    myRow.setByOid("4",
"443");
                   //Map-Port

    myRow.setByOid("8",
"0");
                     //Protocol
(TCP
(1),
UDP
(2),
TCP+UDP
(0))

    myRow.setByOid("9",
"0.0.0.0");
               //WAN-Address

    myRow.setByOid("6",
"");
//Comment
                      //Comment
    serviceTable.addOrMerge(myRow);
};


};

Add-in as JSON file:

View file
nameport_forwarding.json
height150