OpenDaylight不会从netconf设备读取hello消息

OpenDaylight不会从netconf设备读取hello消息,opendaylight,ietf-netconf,Opendaylight,Ietf Netconf,使用APIExplorer,我尝试将RESTCONF设备连接到Opendaylight。不幸的是,它的Hello消息没有读入功能列表 我让Opendaylight Neon运行着每一个名字中都有“restconf”或“netconf”的功能。操作系统是Ubuntu 18.04。 为了模拟netconf设备,我使用docker映像中的netopeer2(benjaminsh/netopeer2) 我确信我拥有ODL的正确IP,因为我能够连接和接收拓扑数据。 此外,我确信我的模拟设备会给出一条hel

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

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

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

我找到了一个解决方案,希望在其他人遇到类似问题时发布:

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

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

get /restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/netconf-node-topology:odl-hello-message-capabilities
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