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 Netzwerkzuordnung auf einer Unified Firewall erstellen oder ändern.

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

ufApi

=

config.getUfApi();



 
var networkInterfaceMap = {
     
"Gastnetz": "eth2",
     
"Paedagogik": "eth3"
 
};

  var networks = Object.keys(networkInterfaceMap);

 
var i;

 
for (i=0; i<networks.length; i++) {
   
  ufApi.modifyObject(
       
  "network-connections",
         
ufApi.lookup("network-connections", {name: networks[i]}),
         
{ {
              'interface': ufApi.lookup(

             
    "interfaces",
               
  {name: networkInterfaceMap[networks[i]]}
           
) } )   )
          }
      )
      ufApi.modifyObject(

       
  "networks",
         
ufApi.lookup("networks", {name: networks[i]}),
         
{ {
              'interface': networkInterfaceMap[networks[i]]

       
  }
     
)
 
}

};

Add-in als JSON-Datei:

View file
nameuf-netzzuordnung.json
height150

...

Englisch

Description:

With the following Add-in script you can create or modify the network mapping on a Unified Firewall.

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)

{


  var

ufApi

=

config.getUfApi();



 
var networkInterfaceMap = {

     
"Gastnetz": "eth2",

     
"Paedagogik": "eth3"

 
};


  var networks = Object.keys(networkInterfaceMap);

 
var i;


 
for (i=0; i<networks.length; i++) {

   
  ufApi.modifyObject(

       
  
"network-connections",

         
ufApi.lookup("network-connections", {name: networks[i]}),

         
{
{
              'interface': ufApi.lookup(

             
    "interfaces",

               
  {name: networkInterfaceMap[networks[i]]}

           
) } )
  )
          }
      )
      ufApi.modifyObject(

       
  "networks",

         
ufApi.lookup("networks", {name: networks[i]}),

         
{
{
              'interface': networkInterfaceMap[networks[i]]

       
  
}

     
)

 
}


};

Add-in as JSON file:

View file
nameuf-netzzuordnung.json
height150


...