Connecting with an OcNOS Device
To establish a connection between OpenDaylight and an OcNOS VM, below attached file will be used. Make sure to update host IP address and credentials in ocnos_connect.xml file depending on the NETCONF device.
Node-id for the connection can be of the user choice.
ocnos_connect.xml:
<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<node-id>ocnos-3</node-id>
<host xmlns="urn:opendaylight:netconf-node-topology">x.x.x.x</host>
<port xmlns="urn:opendaylight:netconf-node-topology">830</port>
<username xmlns="urn:opendaylight:netconf-node-topology">ocnos</username>
<password xmlns="urn:opendaylight:netconf-node-topology">ocnos</password>
<tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
<keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">10</keepalive-delay>
</node>
Use the following command to make connection. Make sure about the update of data in the ocnos_connect.xml file. “ocnos-3” in URL is node-id.
curl --user "admin":"admin" -H "Content-type: application/xml" -X PUT http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ocnos-3 -d '@ocnos_connect.xml'
After execution of the above command, check the connection status with the following command.
curl --user "admin":"admin" -H "Content-type: application/xml" -X GET http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/ | jq .
The URL from the command can be used in a browser to access as well. ("username:password" = "admin:admin" if asked for sign-in when accessing URL.)
Results of above command:
If the status shows 'connecting', it indicates capability exchange is still ongoing and it will soon move to 'connected'.
Last modified date: 08/17/2023