I need know how to enable and disable ethernet ports with api and php..
I was testing with these codes, but i cant fix them..Im so bad
Code: Select all
if ($API->connect($ipRouteros , $username , $pass, $api_puerto)) {
{
$API->write('/interface/ethernet',false);
$API->write('=disable=ether4',true);
}
}
Code: Select all
if ($API->connect($ipRouteros , $username , $pass, $api_puerto))
{
$API->write("interface/ethernet",false);
$API->write("=SET=");
$API->write("ether4",false);
$API->write("=disabled=yes",true);
}
P.D: I trying create 2 php, one of them to active an specific ethernet port, and another php to desactive it.
It's my first project with mikrotik API :S