在Java中使用API​​向mikrotik添加简单队列

时间:2018-09-16 16:28:20

标签: java networking network-programming mikrotik router-os

我是Mikrotik RouterOS API的新手。我使用Java client连接到Mikrotik,并读取接口和它们的信息以及在此写入信息。使用此客户端,可以正确完成以下操作:

打印所有接口及其信息:

List<Map<String, String>> results = con.execute("/interface/print");

创建界面gre1:

con.execute("/interface/gre/add remote-address=1.2.3.4 name=gre1 keepalive=10 comment='test comment'");

为接口gre1添加防火墙规则:

con.execute("/ip/firewall/filter/add action=drop chain=forward in-interface=gre1 protocol=udp dst-port=78,80");

更改接口gre1的IP:

con.execute("/interface/gre/set remote-address=172.16.1.1 .id=gre1");

API command notes中有一些命令示例。

现在,我想为接口添加队列或更改现有队列的信息。我在互联网上做了很多研究。但是我没有找到解决方法。

使用winbox上的终端,可通过以下命令完成此操作:

/queue simple add name=queue1 max-limit=2M/2M target=ether1

在Java中有没有办法做到这一点?

0 个答案:

没有答案