
RouterOS PHP class
163
Array
(
[00:1F:1F:XX:XX:XX] => Array
(
[.id] => *2
[interface] => ap11
[mac-address] => 00:1F:1F:XX:XX:XX
)
[00:0C:42:XX:XX:XX] => Array
(
[.id] => *7
[interface] => backbone
[mac-address] => 00:0C:42:XX:XX:XX
)
)
•• function set($cmd, $args, $callback = FALSE)
Set item or command value.
$conn->set("/ip/firewall/filter", array(".id"=>"*10", "chain"=>"forward", "action"=>"reject");
•• function reboot()
Reboots RouterOS. Returns TRUE on success.
•• function cancel($tag = FALSE, $callback = FALSE)
Cancel last or tagged command. Returns TRUE on success.
•• function fetchurl($url, $callback = FALSE)
Uses /tool/fetch to download file from remote server. It can be used for example to fetch latest RouterOS releases.
Returns TRUE on success.
$conn->fetchurl("http://66.228.113.58/routeros-mipsbe-4.3.npk");
•• function move($cmd, $id, $before, $callback = FALSE)
Move specified item before another item. Returns TRUE on success.
$conn->move("/ip/firewall/filter", "*5", "*10");
•• function add($cmd, $args, $callback = FALSE)
Add new item for command. Returns new ID on success.
$conn->add("/ip/firewall/filter", "chain=forward action=drop");
•• function remove($cmd, $id, $callback = FALSE)
Remove specified item or array of items for command. Returns TRUE on success.
$conn->remove("/ip/firewall/filter", "*10");
$conn->remove("/ip/firewall/filter", array("*10", "*20"));
•• function unsett($cmd, $id, $value, $callback = FALSE)
Unset value for specified item. Returns TRUE on success.
Komentáře k této Příručce