php config 路由设置,使用PHP NETCONF配置Juniper路由器

我正在使用NETCONF的PHP库:https://github.com/Juniper/netconf-php . 到目前为止,我已经设法获得了我的脚本所需的配置部分,但最近的挑战仍然是将新配置加载到路由器中 . 我的路由器上的日志:

Nov 27 14:34:48 router.nl sshd[78164]: subsystem request for netconf by user user

Nov 27 14:34:48 router.nl mgd[78168]: UI_CMDLINE_READ_LINE: User 'x', command 'xml-mode netconf need-trailer '

Nov 27 14:34:48 router.nl file[78167]: UI_LOGIN_EVENT: User 'x' login, class 'j-super-user' [78167], ssh-connection 'x.x.x.x 46796 x.x.x.x 22', client-mode 'netconf'

Nov 27 14:34:48 router.nl file[78167]: UI_NETCONF_CMD: User 'x' used NETCONF client to run command 'lock cannot reconstruct arguments'

Nov 27 14:34:48 router.nl file[78167]: UI_NETCONF_CMD: User 'x' used NETCONF client to run command 'edit-config cannot reconstruct arguments default-operation=merge cannot reconstruct arguments'

Nov 27 14:34:48 router.nl file[78167]: UI_NETCONF_CMD: User 'x' used NETCONF client to run command 'unlock cannot reconstruct arguments'

Nov 27 14:34:48 router.nl file[78167]: UI_NETCONF_CMD: User 'x' used NETCONF client to run command 'close-session'

它一直在抱怨无法重建论点 . 这是我正在努力工作的脚本:

require_once '../app/include/netconf/Device.php';

$deviceParams = [

'hostname' => 'x.x.x.x',

'username' => 'x',

'password' => 'password',

'port' => 22

];

$this->device = new Device($deviceParams);

$this->connectRouter();

$islocked = $this->device->lock_config();

$command = '';

if($islocked) {

$this->device->load_xml_configuration($command, 'merge');

}

$this->device->unlock_config();

$this->device->close();

我在netconf {ssh {树下设置了traceoqptions,这是其中一个输出(一切似乎都好):

Nov 30 10:41:57 [86546] Incoming:

merge]]>]]>

Nov 30 10:41:57 [86546] Outgoing:

Nov 30 10:41:57 [86546] Outgoing:

Nov 30 10:41:57 [86546] Outgoing:

Nov 30 10:41:57 [86546] Outgoing: ]]>]]>

Nov 30 10:41:57 [86546] Incoming: ]]>]]>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值