首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OpenDaylight不读取来自netconf设备的问候消息

OpenDaylight不读取来自netconf设备的问候消息
EN

Stack Overflow用户
提问于 2019-06-14 17:40:44
回答 1查看 176关注 0票数 1

使用APIExplorer,我尝试将RESTCONF设备连接到Opendaylight。不幸的是,它的Hello消息没有读入到capabilities列表中。

我让Opendaylight Neon运行每个名称中有"restconf“或"netconf”的功能。操作系统为Ubuntu 18.04。为了模拟netconf设备,我使用了docker镜像中的netopeer2 (benjaminsh/netopeer2)。

我确信我拥有正确的ODL IP,因为我能够连接和接收拓扑数据。此外,我确信我的模拟设备会给出hello消息,因为我可以在尝试SSH进入它时看到它。

我使用以下命令启动docker容器:

代码语言:javascript
复制
sudo docker run -it --name netopeer2 -p 1831:830 --rm benjaminsh/netopeer2:latest

我通过这个REST命令添加netconf设备:

代码语言:javascript
复制
post /restconf/operations/netconf-node-topology:create-device 
    {
    "netconf-node-topology:input": {
    "netconf-node-topology:pass-through": {},
    "key-based": {
      "netconf-node-topology:key-id": "netconf",
      "netconf-node-topology:username": "netconf"
    },
    "netconf-node-topology:host": "192.168.56.2",
    "netconf-node-topology:port": "830",
    "netconf-node-topology:tcp-only": "false",
    "netconf-node-topology:reconnect-on-changed-schema": "false",
    "netconf-node-topology:connection-timeout-millis": "20000",
    "netconf-node-topology:max-connection-attempts": "0",
    "netconf-node-topology:between-attempts-timeout-millis": "2000",
    "netconf-node-topology:sleep-factor": "1.5",
    "netconf-node-topology:keepalive-delay": "120",
    "netconf-node-topology:node-id": "new-netconf-device"
      }
    }

之后,我尝试使用下面的REST命令访问收到的hello消息中的功能:

代码语言:javascript
复制
get /restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/netconf-node-topology:odl-hello-message-capabilities

我希望看到odl-hello-message-capabilites中的功能,但它只是说明数据模型内容不存在。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-14 20:44:28

我找到了一个解决方案,我想在其他人遇到类似问题的情况下发布:

在opendaylight中查看日志时,我发现在尝试连接到该设备时存在JAVA应用程序错误。即使将netconf连接器添加到数据中,它也不能通信。

诀窍是将"key-auth“改为"login-pw”。新的REST命令:

代码语言:javascript
复制
post /restconf/operations/netconf-node-topology:create-device 
{
  "netconf-node-topology:input": {
    "netconf-node-topology:pass-through": {},
    "login-password": {
      "netconf-node-topology:username": "netconf",
      "netconf-node-topology:password": "netconf"
    },
    "netconf-node-topology:host": "192.168.56.2",
    "netconf-node-topology:port": "1831",
    "netconf-node-topology:tcp-only": "false",
    "netconf-node-topology:reconnect-on-changed-schema": "false",
    "netconf-node-topology:connection-timeout-millis": "20000",
    "netconf-node-topology:max-connection-attempts": "0",
    "netconf-node-topology:between-attempts-timeout-millis": "2000",
    "netconf-node-topology:sleep-factor": "1.5",
    "netconf-node-topology:keepalive-delay": "120",
    "netconf-node-topology:node-id": "new-netconf-device"
  }
}

功能已经具备了:

代码语言:javascript
复制
get /restconf/operational/network-topology:network-topology 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56595484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档