Closed istoOi closed 8 months ago
Hi,
i did a fresh setup of ubuntu 22.04, php 8.1.13 Test Router is ROS 6.43.8. API User has "write" permission.
It seems the connection works since the example below returns "success"
<?php require('./config.php'); require('./routeros_api.class.php'); $API = new RouterosAPI(); $API->debug = true; if ($API->connect($ROS_ADDR, $ROS_USER, $ROS_PASS)) { echo "success"; $API->disconnect(); }else{ echo "unable to connect"; } ?>
But when i try to add a firwall address-list entry nothing happens.
<?php require('./config.php'); require('./routeros_api.class.php'); $API = new RouterosAPI(); $API->debug = true; if ($API->connect($ROS_ADDR, $ROS_USER, $ROS_PASS)) { echo "success"; $API->write("/ip/firewall/address-list/add", array( "list" => "test_list", "address" => "1.2.3.4" )); $API->disconnect(); }else{ echo "unable to connect"; } ?>
I only get the connection in the Mikrotik logs and the following debug output
Connection attempt #1 to 1.1.1.1:8728... <<< [6] /login <<< [9] =name=API <<< [23] =password=API >>> [5/5] bytes read. >>> [5, 1]!done Connected... success<<< [29] /ip/firewall/address-list/add ^C
I also don't get anything with
$API->write('/ip/firewall/address-list/print', false); var_dump($API->read());
Hi. Did you try to add var_dump($API->read()); before $API->disconnect(); to see actual response to your command?
var_dump($API->read());
$API->disconnect();
Not working in RO v7, any update?
@atarist any logs?
No activity.
Hi,
i did a fresh setup of ubuntu 22.04, php 8.1.13 Test Router is ROS 6.43.8. API User has "write" permission.
It seems the connection works since the example below returns "success"
But when i try to add a firwall address-list entry nothing happens.
I only get the connection in the Mikrotik logs and the following debug output
I also don't get anything with