【问题标题】:Change Profile of PPP Secret in Mikrotik using Mikrotik API使用 Mikrotik API 更改 Mikrotik 中 PPP 秘密的配置文件
【发布时间】:2018-08-10 22:36:10
【问题描述】:

我只想在此代码的倒数第三行中使用此代码 ( ppp secret set profile="NON-Payment" ) 而不是使用 ( /ppp/secret/disable )。我试过但没有成功。请帮忙。

try {
            $client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
        } catch (Exception $e) {
            die('Unable to connect to the router.');
        }
        $printRequest = new RouterOS\Request('/ppp/secret/print');
        $printRequest->setArgument('.proplist', '.id');
        $printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
        $id = $client->sendSync($printRequest)->getProperty('.id');
        $setRequest = new RouterOS\Request('/ppp/secret/disable');
        $setRequest->setArgument('numbers', $id);
        $client->sendSync($setRequest);

【问题讨论】:

    标签: php cakephp mikrotik


    【解决方案1】:

    我终于在没有任何帮助的情况下完成了这项工作。

    只需替换

    '/ppp/secret/disable'
    

    '/ppp/secret/set profile="NON-Payment"'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-23
      • 1970-01-01
      相关资源
      最近更新 更多