sync: auto-sync from GURU-5070 at 2026-06-12 05:57:38
Author: Mike Swanson Machine: GURU-5070 Timestamp: 2026-06-12 05:57:38
This commit is contained in:
24
tmp/addnpmnat.php
Normal file
24
tmp/addnpmnat.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require_once("config.inc");
|
||||
require_once("filter.inc");
|
||||
global $config;
|
||||
init_config_arr(array('nat','outbound','rule'));
|
||||
$rules =& $config['nat']['outbound']['rule'];
|
||||
foreach ($rules as $r) {
|
||||
if (($r['source']['network'] ?? '') === '172.16.3.20/32' && ($r['target'] ?? '') === '72.194.62.10') { echo "ALREADY_EXISTS\n"; exit(0); }
|
||||
}
|
||||
$new = array(
|
||||
'source' => array('network' => '172.16.3.20/32'),
|
||||
'sourceport' => '',
|
||||
'descr' => 'NPM rmm-api server->agent reply source pin -> 72.194.62.10 (RMM cmd-delivery diag)',
|
||||
'target' => '72.194.62.10',
|
||||
'target_subnet' => '',
|
||||
'interface' => 'wan',
|
||||
'poolopts' => '',
|
||||
'source_hash_key' => '',
|
||||
'destination' => array('any' => ''),
|
||||
);
|
||||
array_unshift($rules, $new);
|
||||
write_config("Add NPM (172.16.3.20) outbound SNAT pin -> 72.194.62.10");
|
||||
$ret = filter_configure();
|
||||
echo "ADDED ret=$ret total_outbound_rules=".count($rules)."\n";
|
||||
Reference in New Issue
Block a user