【问题标题】:OpenDaylight does not read a hello message from a netconf deviceOpenDaylight 不会从 netconf 设备读取 hello 消息
【发布时间】:2019-10-28 22:22:56
【问题描述】:

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

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

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

我用这个命令启动 docker 容器:

sudo docker run -it --name netopeer2 -p 1831:830 --rm benjaminsh/netopeer2:latest

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

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 消息中访问功能:

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 中的功能,但它只是说数据模型内容不存在。

【问题讨论】:

    标签: opendaylight ietf-netconf


    【解决方案1】:

    我找到了一个解决方案,我想发布以防其他人遇到类似问题:

    在查看登录 opendaylight 时,我发现尝试连接设备时出现 JAVA 应用程序错误。即使 netconf 连接器被添加到数据中,它也无法通信。

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

    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"
      }
    }
    

    功能在那里:

    get /restconf/operational/network-topology:network-topology 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-24
      • 1970-01-01
      • 2021-09-10
      • 2020-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多