OpenDaylight 不从 netconf 设备读取问候消息
OpenDaylight does not read a hello message from a netconf device
我尝试使用 APIExplorer 将 RESTCONF 设备连接到 Opendaylight。不幸的是,它的 Hello Message 没有读入功能列表。
我有 Opendaylight Neon 运行 每个名称中包含 "restconf" 或 "netconf" 的功能。 OS 是 Ubuntu 18.04。
为了模拟 netconf 设备,我使用 docker 图像 (benjaminsh/netopeer2) 中的 netopeer2。
我确信我拥有正确的 ODL IP,因为我能够连接和接收拓扑数据。
此外,我确信我的模拟设备会发出问候消息,因为当我尝试通过 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 命令访问收到的问候消息中的功能:
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 中的功能,但它只是说数据模型内容不存在。
我找到了我想要的解决方案 post 以防其他人遇到类似问题:
在 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
我尝试使用 APIExplorer 将 RESTCONF 设备连接到 Opendaylight。不幸的是,它的 Hello Message 没有读入功能列表。
我有 Opendaylight Neon 运行 每个名称中包含 "restconf" 或 "netconf" 的功能。 OS 是 Ubuntu 18.04。 为了模拟 netconf 设备,我使用 docker 图像 (benjaminsh/netopeer2) 中的 netopeer2。
我确信我拥有正确的 ODL IP,因为我能够连接和接收拓扑数据。 此外,我确信我的模拟设备会发出问候消息,因为当我尝试通过 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 命令访问收到的问候消息中的功能:
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 中的功能,但它只是说数据模型内容不存在。
我找到了我想要的解决方案 post 以防其他人遇到类似问题:
在 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