Search code examples
opendaylightietf-netconf

OpenDaylight does not read a hello message from a netconf device


Using the APIExplorer, I tried to connect a RESTCONF device to Opendaylight. Unfortunately, its Hello Message is not read into the capabilities list.

I have Opendaylight Neon running with every feature that has "restconf" or "netconf" in its name. OS is Ubuntu 18.04. For simulation of a netconf device, I use netopeer2 out of a docker image (benjaminsh/netopeer2).

I am positive that I have the right IP of ODL, for I am able to connect and receive topology data. Furthermore, I am sure that my simulated device gives a hello message, since I get to see it when I try to SSH into it.

I start the docker container with this command:

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

I add the netconf device by this REST Command:

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

After that, I try to access the capabilities out of the received hello message with this REST command:

get /restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device/netconf-node-topology:odl-hello-message-capabilities

I expected to see the capabilities in odl-hello-message-capabilites, but it just says that the data model content does not exist.


Solution

  • I have found a solution that I want to post in case someone else has a similar problem:

    While viewing the Log in opendaylight I found out, that there are JAVA application errors while trying to connect to the device. Even though the netconf connector gets added to the data, it is not capable of communication.

    What did the trick was to change from "key-auth" to "login-pw". New REST command:

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

    The capabilities are there:

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