Closed abdkaviani closed 3 years ago
I think you want something like this:
$cmd = "/ip/firewall/nat/set";
$params = ['.id' => 3, 'disabled' => 'yes'];
$data = $API->comm($cmd, $params);
I think, "=.id=3" is wrong. IIRC, API ids start from asterisk :) E.g., *123
. So you cannot simply use the number of your rule from print
command in Terminal, you need to obtain correct .id first.
Hello I want to change one of NAT (num3) from enable to disabled, This is my code:
$API->write("/ip/firewall/nat/set", false);
$API->write("=disabled=yes", false);
$API->write("=.id=3");
What is wrong? Thank you