Hello guys!
i’m using the API in C# to add and remove Firewall Mangle.
i can print and remove mangles but i can not add new one!
i can add mangle in terminal and ssh:
ip firewall mangle add chain=prerouting src-address=192.168.25.25 comment=username new-connection-mark=conn1 disabled=no
but it does not work in API:
private void addMangle(MikrotikAPI mikrotik)
{
mikrotik.Send("/ip/firewall/mangle/add", false);
mikrotik.Send("=chain=prerouting", false);
mikrotik.Send("=src-address=192.168.25.25", false);
mikrotik.Send("=action=mark-packet", false);
mikrotik.Send("=new-connection-mark=conn1", false);
mikrotik.Send("=comment=username", false);
mikrotik.Send("=disabled=false", true);//false or no
foreach (var res in mikrotik.Read())
Debug.WriteLine(res);
}
in result i got:
!trap=message=no such command prefix
RouterOS: V3.2 and 6.13
any suggestions?