New install NSO and Connect with XR by CLI/Netconf NED
Not update any NSO article to my blog, I will put more NSO info to here, wish that will help more guys. The article will include more hands-on experiences, help beginner fast connect xr devices with nso by cli or netconf ned. For netcong NED, build by Pioneer at former, that need to manual exclude the Yang file that no support. In the article, will build netconf ned by native tool of NSO 5.2.0.
Platform Info
[[email protected] opt]# ncs --version 5.2.0.1 [[email protected] opt]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core)
RP/0/RP0/CPU0:frank#show ins ac sum Wed Aug 7 01:53:03.286 UTC Active Packages: 1 xrv9k-xr-6.6.3.14I version=6.6.3.14I [Boot image]
Install NSO
[[email protected] nso-install]# bash nso-5.2.0.1.linux.x86_64.signed.bin [[email protected] nso-install]# ./nso-5.2.0.1.linux.x86_64.installer.bin /opt/ncs-520 [[email protected] nso-install]# cd .. [[email protected] opt]# source ncs-520/ncsrc [[email protected] opt]# ncs-setup --dest /opt/ncs-520-run [[email protected] opt]# cd ncs-520-run/ [[email protected] ncs-520-run]# ncs [[email protected] nso-install]# ncs_cli -u admin -C admin connected from 10.125.6.211 using ssh on nso [email protected]#
Put the ncsrc to bashrc:
[root@nso ~]# echo "source /opt/ncs-520/ncsrc" >> .bash_profile
Enable copy/paste of multi-line
Add follow config under of ncs.conf <cli>:
<space-completion><enabled>false</enabled></space-completion> <ignore-leading-whitespace>true</ignore-leading-whitespace> <auto-wizard><enabled>false</enabled></auto-wizard>
Then do package reload in NSO:
[email protected]# packages reload
Add XRv9k and connect by by CLI NED
Add xrv9k, then commit
XR Version is 6.6.3 14i
Attention: xr 6.6.2 have an issu for “Cisco-IOS-XR-sysadmin-vm.yang” , so if you use 6.6.2, please exclude the yang when you build the netconf ned.
Cisco-IOS-XR-sysadmin-vm.yang has a violation of RFC 6087 YANG model guidelines, section 4.9. This will be corrected in future release.
devices authgroups group frank default-map remote-name cisco default-map remote-password cisco123 devices device xrv9k-controller address 192.168.0.6 authgroup frank device-type cli ned-id cisco-ios-xr device-type cli protocol ssh state admin-state unlocked
Enable SSH/netconf-yang, and generate ssh key:
RP/0/RP0/CPU0:R6_bgp_controller(config)#show configuration Tue Jul 30 10:04:21.566 UTC Building configuration... !! IOS XR Configuration 6.6.3.14I netconf-yang agent ssh ! ssh server logging ssh server v2 ssh server netconf vrf default RP/0/RP0/CPU0:R6_bgp_controller(config)#commit Sun Aug 4 15:29:19.990 UTC RP/0/RP0/CPU0:R6_bgp_controller(config)#end RP/0/RP0/CPU0:R6_bgp_controller#crypto key generate dsa Sun Aug 4 15:30:51.032 UTC The name for the keys will be: the_default Choose the size of your DSA key modulus. Modulus size can be 512, 768, or 1024 bits. Choosing a key modulus How many bits in the modulus [1024]: Generating DSA keys ... Done w/ crypto generate keypair [OK]
Then fetch ssh host key:
[email protected]# devices device xrv9k-controller ssh fetch-host-keys
sync config from xrv9k:
[email protected]# devices device xrv9k-controller sync-from
Build Yang NED by native tools in 5.2.x and change to Netconf NED
Change cli to netconf and enable yang project by native tools
[email protected]# devtools true [email protected]# config Entering configuration mode terminal [email protected](config)# ...... [email protected](config)# show config netconf-ned-builder project xr 6.6 device xrv9k-controller local-user admin vendor Cisco max-download-threads 1 <<< xr should only have 1 thread ! devices device xrv9k-controller device-type netconf ned-id netconf no device-type cli protocol ssh ! [email protected]# devices device xrv9k-controller connect result true info (admin) Connected to xrv9k-controller - 192.168.0.6:830
Fetch Yang module and download
[email protected]# netconf-ned-builder project xr 6.6 fetch-module-list [email protected]# netconf-ned-builder project xr 6.6 module Cisco-IOS-XR-* * select [email protected]# show netconf-ned-builder project xr 6.6 module statu NAME REVISION STATUS ---------------------------------------------------------------------------- Cisco-IOS-XR-Subscriber-infra-subdb-oper 2018-09-28 selected,downloaded Cisco-IOS-XR-aaa-aaacore-cfg 2018-09-04 selected,downloaded Cisco-IOS-XR-aaa-diameter-base-mib-cfg 2015-11-09 selected,downloaded Cisco-IOS-XR-aaa-diameter-cfg 2019-03-28 selected,downloaded ......
Building netconf ned and export:
[email protected]# netconf-ned-builder project xr 6.6 build-ned [email protected]# show netconf-ned-builder project xr 6.6 build-status build-status success [email protected]# show netconf-ned-builder project xr 6.6 ned-directory-path ned-directory-path /opt/ncs-520-run/state/netconf-ned-builder/xr-nc-6.6 [email protected]# netconf-ned-builder project xr 6.6 export-ned to-directory /tmp tar-file /tmp/ncs-5.2.0.1-xr-nc-6.6.tar.gz
Copy to package directory, untar file is ok:
[[email protected] tmp]# mv -f ncs-5.2.0.1-xr-nc-6.6.tar.gz /opt/ncs-520-run/packages/ [[email protected] tmp]# ls /opt/ncs-520-run/packages/ cisco-iosxr cn-to-dc dc-to-cn ncs-5.2.0.1-xr-nc-6.6.tar.gz rpl
Package reload and update netconf ned:
[email protected]# packages reload [email protected]# show packages package oper-status PACKAGE PROGRAM META FILE CODE JAVA BAD NCS PACKAGE PACKAGE CIRCULAR DATA LOAD NAME UP ERROR UNINITIALIZED VERSION NAME VERSION DEPENDENCY ERROR ERROR ERROR INFO ------------------------------------------------------------------------------------------------------------------------------------------------------------------- cisco-iosxr-cli-7.13 X - - - - - - - - - cn-to-dc - - - - - - - - X [cn-to-dc-template.xml:2 Unknown servicepoint: cn-to-dc] dc-to-cn - - - - - - - - X [dc-to-cn-template.xml:2 Unknown servicepoint: dc-to-cn] rpl X - - - - - - - - - xr-nc-6.6 X - - - - - - - - - [email protected]# config Entering configuration mode terminal [email protected](config)# devices device xrv9k-controller [email protected](config-device-xrv9k-controller)# device-type netconf ned-id xr-nc-6.6 [email protected](config-device-xrv9k-controller)# port 830 [email protected](config)# commit Commit complete. [email protected](config)# exit a[email protected]# devices device xrv9k-controller sync-from result true
Create a service module of python base
Will put detail info for custom service module at next article~ 🙂
[[email protected] opt]# cd ncs-520-run/packages/ [[email protected] opt]# python -V Python 2.7.5 [[email protected] packages]# ncs-make-package --service-skeleton python sr [[email protected] packages]# cd sr [[email protected] sr]# tree . ├── package-meta-data.xml ├── python │ └── sr │ ├── __init__.py │ └── main.py ├── README ├── src │ ├── Makefile │ └── yang │ └── sr.yang ├── templates └── test ├── internal │ ├── lux │ │ ├── Makefile │ │ └── service │ │ ├── dummy-device.xml │ │ ├── dummy-service.xml │ │ ├── Makefile │ │ ├── pyvm.xml │ │ └── run.lux │ └── Makefile └── Makefile 9 directories, 14 files
版权声明:
本文链接:New install NSO and Connect with XR by CLI/Netconf NED
版权声明:本文为原创文章,仅代表个人观点,版权归 Frank Zhao 所有,转载时请注明本文出处及文章链接