netopeer2环境搭建

netopeer2环境搭建
centos7共享与windows共享⽂件
使⽤centos-7-x86_64-Everythong-1708.iso镜像⽂件安装centos7。
安装VMware Tools后,执⾏
$sudo/usr/bin/vmhgfs-fuse .host://mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
centos7下netopeer2环境搭建
netopeer2是实现基于NETCONF协议的⽹络配置管理服务,使⽤sysrepo实现NETCONF的数据库。
依赖包:
libyang
cmake-3.6.1
cmocka-1.1.3
使⽤centos-7-x86_64-Everythong-1708.iso镜像⾃带的⼯具包安装
- pcre, pcre-devel;
- doxygen;
- valgrind, valgrind-devel;
- graphviz, graphviz-devel(可选);
- libXaw
- graphviz-gd
编译libyang
$ make build; cd build
$ cmake ..
$ make
$ sudo make install
sysrepo
编译sysrepo:
$ make build; cd build
$ cmake ..
$ make
$ sudo make install
libnetconf2
libssh-0.7.3
- zlib, zlib-devel;
- openssl, openssl-devel;(keyutils-libs-devel, libcom_err-devel, libselinux-devel, libverto-devel, libkadm5, krb5-devel)
编译libnetconf2:
$ make build; cd build
$ cmake ..
$ make
$ sudo make install
netopeer2
编译netopeer2
$ make build; cd build
$ cmake ..
$ make
# ln -s /usr/local/lib64/libsysrepo.so.5/lib64/
# ln -s /usr/local/lib64/libnetconf2.so.1/lib64/
# ln -s /usr/local/lib64/libyang.so.1/lib64/
# make install
启动netopeer2-server
*【出现错误时:netopeer2-server: error while loading shared libraries: libssh.so.4: cannot open shared object file: No such
file or directory 建⽴相应⽂件的软连接】
$ sudo ln -s /usr/local/lib/libssh.so.4 /lib/
$ sudo ln -s /usr/local/lib/libssh_threads.so.4 /lib64/
[root@localhost netopeer2]# netopeer2-server -d -v 2
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/nacm.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/metadata.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/yangdata.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/libyang_ext_test.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/user_types/user_yang_types.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/user_types/user_inet_types.so" successfully loaded.
[INF]: LY: Reading module "ietf-yang-metadata".
[INF]: LY: Module "ietf-yang-metadata@2016-08-05" successfully parsed as implemented.
[INF]: LY: Reading module "yang".
[INF]: LY: Resolving "yang" unresolved schema nodes and
[INF]: LY: All "yang" schema nodes and constraints resolved.
......
[INF]: SR: Datastore copied from <startup> to <running>.
[INF]: SR: Session 1 (user "root") created.
[INF]: LY: Resolving unresolved data nodes and
[INF]: LY: There is no leafref "/ietf-keystore:keystore/ietf-keystore:asymmetric-keys/ietf-keystore:asymmetric-key/ietf-keystore:name" with the value "genke y", but it is not required.
[INF]: LY: All data nodes and constraints resolved.
[INF]: LN: Listening on 0.0.0.0:830 for SSH connections.
......
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
启动netopeer2-cli与server建⽴连接
[renzg@localhost netopeer2]$ netopeer2-cli
get_netconf_dir: Configuration directory "/home/renzg/opeer2-cli" did not exist, created.
load_config: No saved history.
load_config: No saved configuration.
> connect localhost
The authenticity of the host 'localhost' cannot be established.
ssh-rsa key fingerprint is fe:94:a1:55:72:51:60:99:b4:92:c9:0a:0b:01:04:df:da:fc:52:aa.构建和谐社会论文
Are you sure you want to continue connecting (yes/no)? yes
Interactive SSH Authentication
Type your password:
Password:ddc
> get-config running
cmd_getconfig: Unparsed command arguments.
get-config [--help] --source running|startup|candidate [--filter-subtree[=<file>] | --filter-xpath <XPath>] [--defaults report-all|report-all-tagged|trim|explicit] [--o ut <file>] [--rpc-timeout <seconds>]
> get-config --source running
DATA
<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">
<listen>
<endpoint>
<name>default-ssh</name>
<ssh>离婚冷静期细则
<tcp-server-parameters>
<local-address>0.0.0.0</local-address>
<local-address>0.0.0.0</local-address>
<keepalives>
<idle-time>1</idle-time>
<max-probes>10</max-probes>
<probe-interval>5</probe-interval>
</keepalives>
</tcp-server-parameters>
<ssh-server-parameters>
以吏为师<server-identity>
<host-key>
<name>default-key</name>
<public-key>
<keystore-reference>genkey</keystore-reference>
</public-key>
</host-key>
</server-identity>
<client-authentication>
<supported-authentication-methods>
<publickey/>
<passsword/>
<other>interactive</other>
</supported-authentication-methods>
<users/>
</client-authentication>
</ssh-server-parameters>
</ssh>
</endpoint>
</listen>
</netconf-server>
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
<asymmetric-keys>
<asymmetric-key>
<name>genkey</name>
<algorithm>rsa2048</algorithm>
<public-key>MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Kew7d5cw/oyFV6D6TDD
iaUal5V1ikj9Dka4e5m3w5TNelb9xgxjRUPm2457XQROqoXY+jvBYKXz7XF+neO8
H+QzRZcuDxIP/4HU+ZQF4HytK+d7546EX7+izElUQKGyggw4ZJ3cd6fabIfuuxmS
XwLV9GXYJTHCdsauUgeS244uGlOfVZtMpHjDwPlLEGcGOzQhqE2sVWKUS3Eo2XY8
7sN7WuHRQxJSi+rNeKER7YS/D+h7iLwjZIheIVi+Cwu1SVkH1MzVcbWIaIpdhaSG
j2buXWTgRvwTuQvHGpRm9611OItl3jYenb3CEAVuilq61v6QmX9mKpuWtNoeY4E/
NQIDAQAB</public-key>
</asymmetric-key>
</asymmetric-keys>
</keystore>
SSH Call Home
对于⽹络设备的初始化部署和持续管理都是⾮常有帮助的。
⽅式1:通过sysrepocfg命令导⼊netopeer2/example_configuration/⽬录下的l⽂件# sysrepocfg --import=l --format=xml --datastore=running --module=ietf-netconf-server
开启netopeer2-server
[root@localhost netopeer2-master]# netopeer2-server -d -v2
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/nacm.so" successfully loaded.
[INF]: LY: Plugin "/usr/local/lib64/libyang1/extensions/metadata.so" successfully loaded.
......
[INF]: SR: Triggering "ietf-netconf-acm" "done" event on enabled data.
[INF]: LN: Call Home client "default-client"
[INF]: LN: Trying to connect via IPv6 to ::1:4334.
[INF]: LN: getsockopt() error (Connection refused).
[INF]: LN: Trying to connect via IPv4 to 127.0.0.1:4334.
......
[INF]: LN: Trying to connect via IPv6 to ::1:4334.
[INF]: LN: Successfully connected to localhost:4334 over IPv6.
[INF]: SR: Session 11 (user "root") created.
气浮导轨
[INF]: LN: Received an SSH message "request-service" of subtype "ssh-userauth".
[INF]: LN: Received an SSH message "request-auth" of subtype "none".
[INF]: LN: Received an SSH message "request-auth" of subtype "password".
[INF]: LN: User "root" authenticated.
......
[INF]: LY: Resolving unresolved data nodes and
[INF]: LY: All data nodes and constraints resolved.
[INF]: NP: Session 2: thread 4 event new RPC.
开启netopeer2-cli,输⼊listen命令
向日葵之歌[root@localhost netopeer2-master]# netopeer2-cli
> listen
Waiting 60s for an SSH Call Home connection on
The authenticity of the host '::1' cannot be established.
ssh-rsa key fingerprint is fe:94:a1:55:72:51:60:99:b4:92:c9:0a:0b:01:04:df:da:fc:52:aa.
Are you sure you want to continue connecting (yes/no)? yes
root@::1 password:
>
⽅式2:通过netopeer2-cli的edit-config⽅式导⼊netopeer2/example_configuration/⽬录下的l⽂件
> edit-config --target running --config=./example_configuration/l
OK
参考
完毕。

本文发布于:2024-09-23 03:27:20,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/214735.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:部署   安装   配置管理   实现   协议   环境   错误
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议