ODL Netconf 连接器 + Netopeer

Netconf 连接器 + Netopeer

介绍

Netopeer(一个开源的 NETCONF 服务器)可用于在 OpenDaylight 中测试/探索 NETCONF 南向。

安装

本指南将使用带有 netopeer的Docker容器。要安装 Docker 并启动netopeer 映像,请执行以下步骤:

  • 安装 docker http://docs.docker.com/linux/step_one/
  • 启动netopeer镜像:
    docker run --rm -t -p 1831:830 dockeruser/netopeer
  • 通过调用验证
    netopeer 是否正在运行(netopeer 应立即发送其 HELLO 消息:
 ssh root@localhost -p 1831 -s netconf
(password root)

挂载 netopeer NETCONF 服务器

前提条件:

  • OpenDaylight 以功能odl-restconf-all和 odl-netconf-connector-all. Netopeer
  • 已在 docker 中启动并运行

现在只需按照以下部分进行操作:生成新的 NETCONF 连接器。在有效载荷中更改:
PUT

http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/netopeer
<node xmlns="urn:TBD:params:xml:ns:yang:network-topology">
  <node-id>netopeer</node-id>
  <host xmlns="urn:opendaylight:netconf-node-topology">127.0.0.1</host>
  <port xmlns="urn:opendaylight:netconf-node-topology">1831</port>
  <username xmlns="urn:opendaylight:netconf-node-topology">root</username>
  <password xmlns="urn:opendaylight:netconf-node-topology">root</password>
  <tcp-only xmlns="urn:opendaylight:netconf-node-topology">false</tcp-only>
  <!-- non-mandatory fields with default values, you can safely remove these if you do not wish to override any of these values-->
  <reconnect-on-changed-schema xmlns="urn:opendaylight:netconf-node-topology">false</reconnect-on-changed-schema>
  <connection-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">20000</connection-timeout-millis>
  <max-connection-attempts xmlns="urn:opendaylight:netconf-node-topology">0</max-connection-attempts>
  <between-attempts-timeout-millis xmlns="urn:opendaylight:netconf-node-topology">2000</between-attempts-timeout-millis>
  <sleep-factor xmlns="urn:opendaylight:netconf-node-topology">1.5</sleep-factor>
  <!-- keepalive-delay set to 0 turns off keepalives-->
  <keepalive-delay xmlns="urn:opendaylight:netconf-node-topology">120</keepalive-delay>
</node>

成功挂载 netopeer 后,可以通过调用 RESTCONF 读取其配置:
GET

 http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/netopeer/yang-ext:mount/

结果如下:

{
   
    "ietf-netconf-acm:nacm": {
   
        "denied-data-writes": 0,
        "denied-notifications": 0,
        "denied-operations": 0
    },
    "toaster:toaster": {
   
        "toasterModelNumber": "toaster",
        "toasterStatus": "down",
        "toasterManufacturer": "CESNET, z.s.p.o."
    },
    "ietf-netconf-monitoring:netconf-state": {
   
        "statistics": {
   
            "netconf-start-time": "2022-07-12T08:59:02Z",
            "in-bad-hellos": 0,
            "in-bad-rpcs": 0,
            "out-rpc-errors": 0,
            "dropped-sessions": 0,
            "in-rpcs": 111,
            "out-notifications": 0,
            "in-sessions": 1
        },
        "schemas": {
   
            "schema": [
                {
   
                    "identifier": "ietf-yang-types"
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值