NETCONF协议netopeer软件安装与环境搭建

NETCONF协议netopeer软件安装与环境搭建

目录

  • NETCONF协议netopeer软件安装与环境搭建
    • 目录
    • 简介
    • 相关网站参考
    • 准备工作
    • 手动编译安装部份依赖包
    • 手动编译netopeer
    • 启动与验证

简介

最近工作涉及一些NETCONF协议调研与验证,NETCONF的自动化配置系统采用Client/Server架构,而netopeer即实现了netconf的C/S框架的开源项目,谨以此文总结记录一下netopeer环境搭建和简单使用过程。

Netopeer是基于开源项目libnetconf库完成的,已实现client和server端的代码。主要涉及的组件为netopeer-cli和netopeer-server;其中netopeer-cli为一个CLI程序,允许通过该程序连接到netconf server,和操纵它的配置数据;netopeer-server为一个netconf服务器端的守护进程,允许与netconf client建立连接,接收配置数据等操作。除了这两个重要的模块,netopeer项目还包含了libnetconf transAPI模块举例,位于项目源码transAPI/路径下,例如cfgsystem模块,实现的是一个ietf-system数据模型。

本文主要介绍使用ubuntu-14.04.5-server 64位系统作为基础环境。

相关网站参考

  • [ Libnetconf文档网站 ]
  • [ Netopeer项目 ]
  • [ Libnetconf项目 ]
  • [ Pyang项目 ]
  • [ Libssh项目 ]

准备工作

1) ubuntu官网下载ubuntu系统安装ISO – ubuntu-14.04.5-server-amd64.iso
2) 安装ubuntu14.04.5 server系统
3) 安装必要的依赖包

# apt-get install libtool python-argparse libtool-bin python-sphinx libffi-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev xsltproc python-setuptools cmake zlib1g-dev libssl-dev python-libxml2 libaugeas-dev openssh-server libreadline-dev

手动编译安装部份依赖包

  1. pyang

    # git clone https://github.com/mbj4668/pyang.git
    # cd pyang
    # python setup.py install

  2. libssh (>=0.6.4)
    下载libssh源码包(https://git.libssh.org/projects/libssh.git)

    # cd libssh
    # mkdir build
    # cd build
    # cmake ..
    # make
    # make install

  3. libnetconf

    # git clone https://github.com/CESNET/libnetconf.git
    # cd libnetconf
    # ./configure
    # make
    # make install

手动编译netopeer

  1. 下载netopeer源码

    # git clone https://github.com/CESNET/netopeer.git

  2. 编译安装netopeer-server

    # cd netopeer/server
    # ./configure
    # make
    # make install

  3. 编译安装netopeer-cli

    # cd netopeer/cli
    # ./configure
    # make
    # make install

启动与验证

启动netopeer server

# netopeer-server -d
默认监听端口x.x.x.x:830,连接的用户名密码为系统用户

验证netopeer-cli与netopeer-server连接

运行netopeer-cli,连接netopeer server
# netopeer-cli
netconf> connect localhost
netconf> get-config startup

其它操作

a) 配置netopeer server模块
# netopeer-configurator

b) 检查默认启动的模块
# netopeer-manager list

你可能感兴趣的:(netconf)