6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CSR1000V (IOS16)のNetconf/YANGを試してみる

Last updated at Posted at 2017-03-13

Cisco IOS/IOS-XEのデバイスAPIは10年以上前から色々あるが、標準化状況などを見据えて実装も段階的に増えている。そのため、ドキュメントや実装レベルでも、古いものと新しいものが混ざっており、整理するだけでも大変である。

このエントリは、主に実装が進んでいるハイエンド装置は対象外として、2017年以降少しずつ広がってくるであろう企業向け装置(一般的なLAN/WAN、Cisco IOS/IOS-XE)を対象として実装の歴史をざっくり整理し、Cisco IOS16.4.1を利用してNetconf/YANGをまずは動作させてみた自分用の記録である。

ここではCSR1000Vを使っているが、既にリリースされているCatalyst3850や3650の16.3あたりを使うと同じことができるはず。

##整理
一つのIOS/IOS-XEでサポートされているデバイスAPI。

オペレーションまたは機能名 データモデル メモ 次期
CNS* 独自(非公開) 2001年頃
WSMA* 独自(公開) IOS12.4.24T〜、CNSのOpen実装、内部では使われている 2009年頃
REST-API 独自(公開) Webで検索するとこれを試している人が多い 2014年頃
PnP Agent 独自(公開) 仕様 2015年頃
Netconf 独自(公開) RFC4741/4742ベース、IOS12.4.9T〜 2007年頃
Netconf(本エントリの対象★) YANG, RFC6020 RFC6241ベース、本命、IOS16以降、Cat3850やCSR1000Vなどから 2016年〜
Restconf YANG, RFC6020 RFC8040ベース、本命、IOS16以降、Cat3850やCSR1000Vなどから 2017年〜

*CNS .. Cisco Networking Service
*WSMA .. Web Service Management Agent

##参考
YANG/NETCONF Configuration & Validation Example (Cisco Catalyst 3850)
Data Models Configuration Guide
Chapter: Configuring YANG Datamodel

##バージョン

CSR1000V
CSR-2#sho bootflash: | i .pkg
  4  336782296 Feb 07 2017 13:28:01.0000000000 +00:00 /bootflash/.super.iso.dir/csr1000v-mono-universalk9.16.04.01.SPA.pkg
 11  336782296 Feb 07 2017 13:28:42.0000000000 +00:00 /bootflash/csr1000v-mono-universalk9.16.04.01.SPA.pkg
 12   34892632 Feb 07 2017 13:28:49.0000000000 +00:00 /bootflash/csr1000v-rpboot.16.04.01.SPA.pkg
CSR1000V
CSR-2#show version | i 16.04
Cisco IOS XE Software, Version 16.04.01

##設定
netconf-yangの部分がポイント。これでport 830の待ち受けが始まる。restconf部分はこの動作確認では不要。SSH接続はできている前提。

CSR1000V
transport-map type persistent webui https-webui
 secure-server
!
remote-management
netconf-yang
!
restconf
!
username cisco privilege 15 password 0 cisco
!
virtual-service csr_mgmt
 ip shared host-interface GigabitEthernet1
 activate
!
ip http authentication local
ip http secure-server
!
transport type persistent webui input https-webui
!
netconf ssh

参考)

CSR1000V
CSR-2(config)#netconf-yang ?
  cisco-ia   Configure cisco-ia parameters
  cisco-odm  Configure cisco-odm parameters
  ssh        Configure ssh options
  <cr>

参考)netconf legacyオプションがいい味出してる。

CSR1000V
CSR-2(config)#netconf ?
  format        specify the format spec file to use
  legacy        NETCONF legacy support
  lock-time     Limit time NETCONF can lock configuration
  max-message   maximum received message size
  max-sessions  Limit total number of NETCONF sessions
  ssh           Use SSH to establish NETCONF session

##確認
IOS15.5と比較すると多少異なる。もうちょっといいshowコマンドがあるかもしれない。

CSR1000V
CSR-2#show virtual-service detail 
Virtual service csr_mgmt detail
  State                 : Activated
  Owner                 : IOSd
  Package information
    Name                : iosxe-remote-mgmt.16.04.01.ova
    Path                : bootflash:/iosxe-remote-mgmt.16.04.01.ova
    Application
      Name              : csr_mgmt
      Installed version : 99.99.99
      Description       : CSR-MGMT
    Signing
      Key type          : Cisco release key
      Method            : SHA-1
    Licensing
      Name              : Not Available
      Version           : Not Available

  Detailed guest status
    
----------------------------------------------------------------------
Process               Status            Uptime           # of restarts
----------------------------------------------------------------------
nginx                  UP         0Y 0W 3D  9:40:19        0
climgr                 UP         0Y 0W 3D  9:40:19        2
restful_api            UP         0Y 0W 3D  9:40:19        0
fcgicpa                Down      
pnscag                 Down      
pnscdme                Down      
----------------------------------------------------------------------
Feature         Status                 Configuration
----------------------------------------------------------------------
Restful API   Enabled, UP             port: 55443
                                      auto-save-timer: 30 seconds
                                      socket: unix:/usr/local/nginx/csrapi-fcgi.sock;
                                      single-session: Disabled

PNSC          Disabled, Down

Network stats:
 eth0: RX  packets:292856, TX  packets:6
 eth1: RX  packets:6, TX  packets:6

Coredump file(s): CSR-2_climgr_83_20170310-104325-UTC.core.gz, lost+found
 
  Activated profile name: None
  Resource reservation
    Disk                : 756 MB
    Memory              : 512 MB
    CPU                 : 5% system CPU

  Attached devices
    Type              Name        Alias            
    ---------------------------------------------
    NIC               ieobc_1     ieobc            
    NIC               dp_1_33     net2             
    Disk              _rootfs                      
    Disk              /opt/var                     
    Disk              /opt/var/c                   
    Serial/shell                  serial0          
    Serial/aux                    serial1          
    Serial/Syslog                 serial2          
    Serial/Trace                  serial3          
    Watchdog          watchdog-2                   

  Network interfaces
    MAC address             Attached to interface           
    ------------------------------------------------------
    54:0E:00:0B:0C:02       ieobc_1                         
    00:50:56:A2:6A:84       VirtualPortGroup33              

  Guest interface
  ---
  Interface: eth1
  ip address: 10.71.130.58/21

  ---

  Guest routes
  ---
  Address/Mask                         Next Hop                          Intf.
-------------------------------------------------------------------------------

  ---

  Resource admission (without profile) : passed
    Disk space    : 756MB
    Memory        : 512MB 
    CPU           : 5% system CPU 
    VCPUs         : Not specified

##SSHでCapabilityを確認(SSH/ポート830)
ポート830で接続し、capability exchange。YANGモジュールを含め、非常にたくさんのcapabilityがリターンするのちょっとでうれしい。

client
~ $ssh -s cisco@10.71.130.58 -p 830 netconf
cisco@10.71.130.58's password: 
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:xpath:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
<capability>urn:ietf:params:netconf:capability:notification:1.0</capability>
<capability>urn:ietf:params:netconf:capability:interleave:1.0</capability>
<capability>http://tail-f.com/ns/netconf/actions/1.0</capability>
<capability>http://tail-f.com/ns/netconf/extensions</capability>
<capability>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&amp;also-supported=report-all-tagged</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults?revision=2011-06-01&amp;module=ietf-netconf-with-defaults</capability>
<capability>http://cisco.com/ns/yang/ned/ios?module=ned&amp;revision=2016-10-24&amp;features=zone,vservice,vpdn,voice,service-insertion,seg-routing,ptp,pfr,otv,mpls-te,mls,l3vpn,l2vpn,intf-service,eth-evc,esmc,controller,card,bridge-domain,bba-group</capability>
<capability>http://cisco.com/ns/yang/ned/ios/asr1k?module=ned-asr1k&amp;revision=2016-04-07</capability>
<capability>http://cisco.com/yang/cisco-ia?module=cisco-ia&amp;revision=2016-06-30</capability>
<capability>http://cisco.com/yang/cisco-odm?module=cisco-odm&amp;revision=2016-08-05</capability>
<capability>http://cisco.com/yang/cisco-self-mgmt?module=cisco-self-mgmt&amp;revision=2016-05-14</capability>
<capability>http://tail-f.com/ns/aaa/1.1?module=tailf-aaa&amp;revision=2015-06-16</capability>
<capability>http://tail-f.com/ns/mibs/IPV6-TC/199812010000Z?module=IPV6-TC&amp;revision=1998-12-01</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-COMMUNITY-MIB/200308060000Z?module=SNMP-COMMUNITY-MIB&amp;revision=2003-08-06</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-FRAMEWORK-MIB/200210140000Z?module=SNMP-FRAMEWORK-MIB&amp;revision=2002-10-14</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-MPD-MIB/200210140000Z?module=SNMP-MPD-MIB&amp;revision=2002-10-14</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-NOTIFICATION-MIB/200210140000Z?module=SNMP-NOTIFICATION-MIB&amp;revision=2002-10-14</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-TARGET-MIB/200210140000Z?module=SNMP-TARGET-MIB&amp;revision=2002-10-14</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-USER-BASED-SM-MIB/200210160000Z?module=SNMP-USER-BASED-SM-MIB&amp;revision=2002-10-16</capability>
<capability>http://tail-f.com/ns/mibs/SNMP-VIEW-BASED-ACM-MIB/200210160000Z?module=SNMP-VIEW-BASED-ACM-MIB&amp;revision=2002-10-16</capability>
<capability>http://tail-f.com/ns/mibs/SNMPv2-MIB/200210160000Z?module=SNMPv2-MIB&amp;revision=2002-10-16</capability>
<capability>http://tail-f.com/ns/mibs/SNMPv2-SMI/1.0?module=SNMPv2-SMI</capability>
<capability>http://tail-f.com/ns/mibs/SNMPv2-TC/1.0?module=SNMPv2-TC</capability>
<capability>http://tail-f.com/ns/mibs/TRANSPORT-ADDRESS-MIB/200211010000Z?module=TRANSPORT-ADDRESS-MIB&amp;revision=2002-11-01</capability>
<capability>http://tail-f.com/ns/webui?module=tailf-webui&amp;revision=2013-03-07</capability>
<capability>http://tail-f.com/yang/acm?module=tailf-acm&amp;revision=2013-03-07</capability>
<capability>http://tail-f.com/yang/common-monitoring?module=tailf-common-monitoring&amp;revision=2013-06-14</capability>
<capability>http://tail-f.com/yang/confd-monitoring?module=tailf-confd-monitoring&amp;revision=2013-06-14</capability>
<capability>http://tail-f.com/yang/netconf-monitoring?module=tailf-netconf-monitoring&amp;revision=2014-11-13</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-acl-oper?module=cisco-acl-oper&amp;revision=2016-03-30</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-bfd-state?module=cisco-bfd-state&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-bgp-state?module=cisco-bgp-state&amp;revision=2015-10-16</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-bridge-common?module=cisco-bridge-common&amp;revision=2014-09-25&amp;features=configurable-bd-mac-limit-notif,configurable-bd-mac-limit-max,configurable-bd-mac-limit-actions,configurable-bd-mac-aging-types,configurable-bd-flooding-control</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-bridge-domain?module=cisco-bridge-domain&amp;revision=2014-12-01&amp;features=parameterized-bridge-domains,configurable-bd-storm-control,configurable-bd-static-mac,configurable-bd-snooping-profiles,configurable-bd-sh-group-number,configurable-bd-mtu,configurable-bd-member-features,configurable-bd-mac-secure,configurable-bd-mac-features,configurable-bd-mac-event-action,configurable-bd-ipsg,configurable-bd-groups,configurable-bd-flooding-mode,configurable-bd-flooding,configurable-bd-dai,clear-bridge-domain</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-cfm-stats?module=cisco-cfm-stats&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-cfm-stats-dev?module=cisco-cfm-stats-dev&amp;revision=2015-05-27</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-checkpoint-archive?module=cisco-checkpoint-archive&amp;revision=2015-05-20</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-efp-stats?module=cisco-efp-stats&amp;revision=2015-07-07</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-environment?module=cisco-environment&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-ethernet?module=cisco-ethernet&amp;revision=2016-05-10</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-flow-monitor?module=cisco-flow-monitor&amp;revision=2015-10-26</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-ip-sla-stats?module=cisco-ip-sla-stats&amp;revision=2015-05-29</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-ip-sla-stats-dev?module=cisco-ip-sla-stats-dev&amp;revision=2015-06-30</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-lldp-state?module=cisco-lldp-state&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-memory-stats?module=cisco-memory-stats&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-mpls-fwd?module=cisco-mpls-fwd&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-platform-software?module=cisco-platform-software&amp;revision=2015-07-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-process-cpu?module=cisco-process-cpu&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-process-memory?module=cisco-process-memory&amp;revision=2015-04-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-qos-action-marking-cfg?module=cisco-qos-action-marking-cfg&amp;revision=2015-05-09&amp;features=set-wlan-user-priority-support,set-vlan-inner-support,set-srp-priority-support,set-qos-grp-support,set-prec-tunnel-support,set-prec-support,set-mpls-exp-top-support,set-mpls-exp-imp-support,set-fr-fecn-becn-support,set-fr-de-support,set-dscp-tunnel-support,set-discard-class-support,set-dei-support,set-dei-imp-support,set-cos-support,set-cos-inner-suppport,set-atm-clp-support</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-qos-action-oper?module=cisco-qos-action-oper&amp;revision=2015-05-09&amp;features=queue-peak-size-stats-support,priority-bandwidth-exceed-drops-support,marking-stats-support,drop-pkts-no-buffer-stats-support,drop-pkts-flow-stats-support,aggregate-priority-stats-support</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-qos-action-qlimit-cfg?module=cisco-qos-action-qlimit-cfg&amp;revision=2015-05-09&amp;features=qos-grp-based-queuing-support,mpls-exp-based-queuing-support,disc-class-based-queuing-support</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-qos-common?module=cisco-qos-common&amp;revision=2015-05-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-routing-ext?module=cisco-routing-ext&amp;revision=2016-07-09</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-storm-control?module=cisco-storm-control&amp;revision=2014-09-25&amp;features=configurable-storm-control-actions</capability>
<capability>urn:cisco:params:xml:ns:yang:cisco-virtual-service?module=cisco-virtual-service&amp;revision=2016-04-19</capability>
<capability>urn:cisco:params:xml:ns:yang:govern?module=govern&amp;revision=2014-07-16</capability>
<capability>urn:cisco:params:xml:ns:yang:pim?module=pim&amp;revision=2014-06-27&amp;features=bsr,auto-rp</capability>
<capability>urn:cisco:params:xml:ns:yang:pw?module=cisco-pw&amp;revision=2014-12-01&amp;features=static-label-direct-config,pw-vccv,pw-tag-impose-vlan-id,pw-status-config,pw-static-oam-config,pw-short-config,pw-sequencing,pw-preferred-path,pw-port-profiles,pw-oam-refresh-config,pw-mac-withdraw-config,pw-load-balancing,pw-ipv6-source,pw-interface,pw-grouping-config,pw-class-tag-rewrite,pw-class-switchover-delay,pw-class-status,pw-class-source-ip,pw-class-flow-setting,preferred-path-peer,predictive-redundancy-config,flow-label-tlv-code17,flow-label-static-config</capability>
<capability>urn:cisco:params:xml:ns:yang:table-map?module=cisco-table-map&amp;revision=2015-05-19&amp;features=table-map-template-support</capability>
<capability>urn:ietf:params:xml:ns:yang:c3pl-types?module=policy-types&amp;revision=2013-10-07&amp;features=protocol-name-support,match-wlan-user-priority-support,match-vpls-support,match-vlan-support,match-vlan-inner-support,match-src-mac-support,match-security-group-support,match-qos-group-support,match-prec-support,match-packet-length-support,match-mpls-exp-top-support,match-mpls-exp-imp-support,match-metadata-support,match-ipv6-acl-support,match-ipv6-acl-name-support,match-ipv4-acl-support,match-ipv4-acl-name-support,match-ip-rtp-support,match-input-interface-support,match-fr-dlci-support,match-fr-de-support,match-flow-record-support,match-flow-ip-support,match-dst-mac-support,match-discard-class-support,match-dei-support,match-dei-inner-support,match-cos-support,match-cos-inner-support,match-class-map-support,match-atm-vci-support,match-atm-clp-support,match-application-support</capability>
<capability>urn:ietf:params:xml:ns:yang:cisco-ospf?module=cisco-ospf&amp;revision=2016-03-30&amp;features=graceful-shutdown,flood-reduction,database-filter</capability>
<capability>urn:ietf:params:xml:ns:yang:cisco-policy?module=cisco-policy&amp;revision=2016-03-30</capability>
<capability>urn:ietf:params:xml:ns:yang:cisco-policy-filters?module=cisco-policy-filters&amp;revision=2016-03-30</capability>
<capability>urn:ietf:params:xml:ns:yang:cisco-policy-target?module=cisco-policy-target&amp;revision=2016-03-30</capability>
<capability>urn:ietf:params:xml:ns:yang:common-mpls-static?module=common-mpls-static&amp;revision=2015-07-22&amp;deviations=common-mpls-static-devs</capability>
<capability>urn:ietf:params:xml:ns:yang:common-mpls-types?module=common-mpls-types&amp;revision=2015-05-28</capability>
<capability>urn:ietf:params:xml:ns:yang:iana-crypt-hash?module=iana-crypt-hash&amp;revision=2014-04-04&amp;features=crypt-hash-sha-512,crypt-hash-sha-256,crypt-hash-md5</capability>
<capability>urn:ietf:params:xml:ns:yang:iana-if-type?module=iana-if-type&amp;revision=2014-05-08</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-diffserv-action?module=ietf-diffserv-action&amp;revision=2015-04-07&amp;features=priority-rate-burst-support,hierarchial-policy-support,aqm-red-support</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-diffserv-classifier?module=ietf-diffserv-classifier&amp;revision=2015-04-07&amp;features=policy-inline-classifier-config</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-diffserv-policy?module=ietf-diffserv-policy&amp;revision=2015-04-07&amp;features=policy-template-support,hierarchial-policy-support</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-diffserv-target?module=ietf-diffserv-target&amp;revision=2015-04-07&amp;features=target-inline-policy-config</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-inet-types?module=ietf-inet-types&amp;revision=2013-07-15</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-interfaces?module=ietf-interfaces&amp;revision=2014-05-08&amp;features=pre-provisioning,if-mib,arbitrary-names&amp;deviations=ietf-ip-devs</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-interfaces-ext?module=ietf-interfaces-ext</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-ip?module=ietf-ip&amp;revision=2014-06-16&amp;features=ipv6-privacy-autoconf,ipv4-non-contiguous-netmasks</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing?module=ietf-ipv4-unicast-routing&amp;revision=2015-05-25</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-ipv6-unicast-routing?module=ietf-ipv6-unicast-routing&amp;revision=2015-05-25</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-key-chain?module=ietf-key-chain&amp;revision=2015-02-24&amp;features=independent-send-accept-lifetime,hex-key-string,accept-tolerance</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-acm?module=ietf-netconf-acm&amp;revision=2012-02-22</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?module=ietf-netconf-monitoring&amp;revision=2010-10-04</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?module=ietf-netconf-notifications&amp;revision=2012-02-06</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-ospf?module=ietf-ospf&amp;revision=2015-03-09&amp;features=ttl-security,te-rid,router-id,remote-lfa,prefix-suppression,ospfv3-authentication-ipsec,nsr,node-flag,multi-topology,multi-area-adj,mtu-ignore,max-lsa,max-ecmp,lls,lfa,ldp-igp-sync,ldp-igp-autoconfig,interface-inheritance,instance-inheritance,graceful-restart,fast-reroute,demand-circuit,bfd,auto-cost,area-inheritance,admin-control&amp;deviations=ietf-ospf-devs</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-routing?module=ietf-routing&amp;revision=2015-05-25&amp;features=router-id,multiple-ribs&amp;deviations=ietf-ipv4-unicast-routing-devs,ietf-ipv6-unicast-routing-devs,ietf-ospf-devs,ietf-routing-devs</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-smiv2?module=ietf-yang-smiv2&amp;revision=2012-06-22</capability>
<capability>urn:ietf:params:xml:ns:yang:ietf-yang-types?module=ietf-yang-types&amp;revision=2013-07-15</capability>
<capability>urn:ietf:params:xml:ns:yang:mpls-ldp?module=mpls-ldp&amp;revision=2014-09-19&amp;features=mpls-ldp-nsr,mpls-ldp-iccp,mpls-ldp-extended,mpls-ldp-bgp</capability>
<capability>urn:ietf:params:xml:ns:yang:nvo?module=nvo&amp;revision=2015-06-02&amp;deviations=nvo-devs</capability>
<capability>urn:ietf:params:xml:ns:yang:policy-attr?module=policy-attr&amp;revision=2015-04-27</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ATM-FORUM-TC-MIB?module=ATM-FORUM-TC-MIB</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ATM-MIB?module=ATM-MIB&amp;revision=1998-10-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ATM-TC-MIB?module=ATM-TC-MIB&amp;revision=1998-10-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:BGP4-MIB?module=BGP4-MIB&amp;revision=1994-05-05</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:BRIDGE-MIB?module=BRIDGE-MIB&amp;revision=2005-09-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-AAA-SERVER-MIB?module=CISCO-AAA-SERVER-MIB&amp;revision=2003-11-17</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-AAA-SESSION-MIB?module=CISCO-AAA-SESSION-MIB&amp;revision=2006-03-21</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-AAL5-MIB?module=CISCO-AAL5-MIB&amp;revision=2003-09-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ATM-EXT-MIB?module=CISCO-ATM-EXT-MIB&amp;revision=2003-01-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ATM-PVCTRAP-EXTN-MIB?module=CISCO-ATM-PVCTRAP-EXTN-MIB&amp;revision=2003-01-20</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ATM-QOS-MIB?module=CISCO-ATM-QOS-MIB&amp;revision=2002-06-10</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-BGP-POLICY-ACCOUNTING-MIB?module=CISCO-BGP-POLICY-ACCOUNTING-MIB&amp;revision=2002-07-26</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-BGP4-MIB?module=CISCO-BGP4-MIB&amp;revision=2010-09-30</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-BULK-FILE-MIB?module=CISCO-BULK-FILE-MIB&amp;revision=2002-06-10</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CBP-TARGET-MIB?module=CISCO-CBP-TARGET-MIB&amp;revision=2006-05-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CBP-TARGET-TC-MIB?module=CISCO-CBP-TARGET-TC-MIB&amp;revision=2006-03-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CBP-TC-MIB?module=CISCO-CBP-TC-MIB&amp;revision=2008-06-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CDP-MIB?module=CISCO-CDP-MIB&amp;revision=2005-03-21</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CEF-TC?module=CISCO-CEF-TC&amp;revision=2005-09-30</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CONFIG-COPY-MIB?module=CISCO-CONFIG-COPY-MIB&amp;revision=2005-04-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CONFIG-MAN-MIB?module=CISCO-CONFIG-MAN-MIB&amp;revision=2007-04-27</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-CONTEXT-MAPPING-MIB?module=CISCO-CONTEXT-MAPPING-MIB&amp;revision=2008-11-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-DATA-COLLECTION-MIB?module=CISCO-DATA-COLLECTION-MIB&amp;revision=2002-10-30</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-DIAL-CONTROL-MIB?module=CISCO-DIAL-CONTROL-MIB&amp;revision=2005-05-26</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-DOT3-OAM-MIB?module=CISCO-DOT3-OAM-MIB&amp;revision=2006-05-31</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-DYNAMIC-TEMPLATE-MIB?module=CISCO-DYNAMIC-TEMPLATE-MIB&amp;revision=2007-09-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-DYNAMIC-TEMPLATE-TC-MIB?module=CISCO-DYNAMIC-TEMPLATE-TC-MIB&amp;revision=2012-01-27</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-EIGRP-MIB?module=CISCO-EIGRP-MIB&amp;revision=2004-11-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-EMBEDDED-EVENT-MGR-MIB?module=CISCO-EMBEDDED-EVENT-MGR-MIB&amp;revision=2006-11-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ENTITY-ALARM-MIB?module=CISCO-ENTITY-ALARM-MIB&amp;revision=1999-07-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ENTITY-FRU-CONTROL-MIB?module=CISCO-ENTITY-FRU-CONTROL-MIB&amp;revision=2013-08-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ENTITY-SENSOR-MIB?module=CISCO-ENTITY-SENSOR-MIB&amp;revision=2015-01-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ENTITY-VENDORTYPE-OID-MIB?module=CISCO-ENTITY-VENDORTYPE-OID-MIB&amp;revision=2014-12-09</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ETHERLIKE-EXT-MIB?module=CISCO-ETHERLIKE-EXT-MIB&amp;revision=2010-06-04</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-FIREWALL-TC?module=CISCO-FIREWALL-TC&amp;revision=2006-03-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-FTP-CLIENT-MIB?module=CISCO-FTP-CLIENT-MIB&amp;revision=2006-03-31</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-HSRP-EXT-MIB?module=CISCO-HSRP-EXT-MIB&amp;revision=2010-09-02</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-HSRP-MIB?module=CISCO-HSRP-MIB&amp;revision=2010-09-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-ATM2-PVCTRAP-MIB?module=CISCO-IETF-ATM2-PVCTRAP-MIB&amp;revision=1998-02-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-ATM2-PVCTRAP-MIB-EXTN?module=CISCO-IETF-ATM2-PVCTRAP-MIB-EXTN&amp;revision=2000-07-11</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-BFD-MIB?module=CISCO-IETF-BFD-MIB&amp;revision=2011-04-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-FRR-MIB?module=CISCO-IETF-FRR-MIB&amp;revision=2008-04-29</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-ISIS-MIB?module=CISCO-IETF-ISIS-MIB&amp;revision=2005-08-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-MPLS-ID-STD-03-MIB?module=CISCO-IETF-MPLS-ID-STD-03-MIB&amp;revision=2012-06-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-MPLS-TE-EXT-STD-03-MIB?module=CISCO-IETF-MPLS-TE-EXT-STD-03-MIB&amp;revision=2012-06-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-ATM-MIB?module=CISCO-IETF-PW-ATM-MIB&amp;revision=2005-04-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-ENET-MIB?module=CISCO-IETF-PW-ENET-MIB&amp;revision=2002-09-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-MIB?module=CISCO-IETF-PW-MIB&amp;revision=2004-03-17</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-MPLS-MIB?module=CISCO-IETF-PW-MPLS-MIB&amp;revision=2003-02-26</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-TC-MIB?module=CISCO-IETF-PW-TC-MIB&amp;revision=2006-07-21</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IETF-PW-TDM-MIB?module=CISCO-IETF-PW-TDM-MIB&amp;revision=2006-07-21</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IF-EXTENSION-MIB?module=CISCO-IF-EXTENSION-MIB&amp;revision=2013-03-13</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IMAGE-LICENSE-MGMT-MIB?module=CISCO-IMAGE-LICENSE-MGMT-MIB&amp;revision=2007-10-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IMAGE-MIB?module=CISCO-IMAGE-MIB&amp;revision=1995-08-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IP-LOCAL-POOL-MIB?module=CISCO-IP-LOCAL-POOL-MIB&amp;revision=2007-11-12</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IP-TAP-MIB?module=CISCO-IP-TAP-MIB&amp;revision=2004-03-11</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IP-URPF-MIB?module=CISCO-IP-URPF-MIB&amp;revision=2011-12-29</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPMROUTE-MIB?module=CISCO-IPMROUTE-MIB&amp;revision=2005-03-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSEC-FLOW-MONITOR-MIB?module=CISCO-IPSEC-FLOW-MONITOR-MIB&amp;revision=2007-10-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSEC-POLICY-MAP-MIB?module=CISCO-IPSEC-POLICY-MAP-MIB&amp;revision=2000-08-17</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSLA-AUTOMEASURE-MIB?module=CISCO-IPSLA-AUTOMEASURE-MIB&amp;revision=2007-06-13</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSLA-ECHO-MIB?module=CISCO-IPSLA-ECHO-MIB&amp;revision=2007-08-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSLA-JITTER-MIB?module=CISCO-IPSLA-JITTER-MIB&amp;revision=2007-07-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-IPSLA-TC-MIB?module=CISCO-IPSLA-TC-MIB&amp;revision=2007-03-23</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-MEDIA-GATEWAY-MIB?module=CISCO-MEDIA-GATEWAY-MIB&amp;revision=2009-02-25</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-MPLS-LSR-EXT-STD-MIB?module=CISCO-MPLS-LSR-EXT-STD-MIB&amp;revision=2012-04-30</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-MPLS-TC-EXT-STD-MIB?module=CISCO-MPLS-TC-EXT-STD-MIB&amp;revision=2012-02-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-NBAR-PROTOCOL-DISCOVERY-MIB?module=CISCO-NBAR-PROTOCOL-DISCOVERY-MIB&amp;revision=2002-08-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-NTP-MIB?module=CISCO-NTP-MIB&amp;revision=2006-07-31</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-OSPF-MIB?module=CISCO-OSPF-MIB&amp;revision=2003-07-18</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-OSPF-TRAP-MIB?module=CISCO-OSPF-TRAP-MIB&amp;revision=2003-07-18</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-PIM-MIB?module=CISCO-PIM-MIB&amp;revision=2000-11-02</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-PING-MIB?module=CISCO-PING-MIB&amp;revision=2001-08-28</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-PRODUCTS-MIB?module=CISCO-PRODUCTS-MIB&amp;revision=2014-11-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-PTP-MIB?module=CISCO-PTP-MIB&amp;revision=2011-01-28</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-QOS-PIB-MIB?module=CISCO-QOS-PIB-MIB&amp;revision=2007-08-29</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-RADIUS-EXT-MIB?module=CISCO-RADIUS-EXT-MIB&amp;revision=2010-05-25</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-RF-MIB?module=CISCO-RF-MIB&amp;revision=2005-09-01</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-RTTMON-TC-MIB?module=CISCO-RTTMON-TC-MIB&amp;revision=2012-05-25</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB?module=CISCO-SESS-BORDER-CTRLR-CALL-STATS-MIB&amp;revision=2010-09-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SESS-BORDER-CTRLR-STATS-MIB?module=CISCO-SESS-BORDER-CTRLR-STATS-MIB&amp;revision=2010-09-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SMI?module=CISCO-SMI&amp;revision=2012-08-29</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SONET-MIB?module=CISCO-SONET-MIB&amp;revision=2003-03-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-ST-TC?module=CISCO-ST-TC&amp;revision=2012-08-08</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-STP-EXTENSIONS-MIB?module=CISCO-STP-EXTENSIONS-MIB&amp;revision=2013-03-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SUBSCRIBER-IDENTITY-TC-MIB?module=CISCO-SUBSCRIBER-IDENTITY-TC-MIB&amp;revision=2011-12-23</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SUBSCRIBER-SESSION-MIB?module=CISCO-SUBSCRIBER-SESSION-MIB&amp;revision=2012-08-08</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SUBSCRIBER-SESSION-TC-MIB?module=CISCO-SUBSCRIBER-SESSION-TC-MIB&amp;revision=2012-01-27</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-SYSLOG-MIB?module=CISCO-SYSLOG-MIB&amp;revision=2005-12-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-TAP2-MIB?module=CISCO-TAP2-MIB&amp;revision=2009-11-06</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-TC?module=CISCO-TC&amp;revision=2011-11-11</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-UBE-MIB?module=CISCO-UBE-MIB&amp;revision=2010-11-29</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB?module=CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB&amp;revision=2013-07-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VLAN-MEMBERSHIP-MIB?module=CISCO-VLAN-MEMBERSHIP-MIB&amp;revision=2007-12-14</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VOICE-COMMON-DIAL-CONTROL-MIB?module=CISCO-VOICE-COMMON-DIAL-CONTROL-MIB&amp;revision=2010-06-30</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VOICE-DIAL-CONTROL-MIB?module=CISCO-VOICE-DIAL-CONTROL-MIB&amp;revision=2012-05-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VOICE-DNIS-MIB?module=CISCO-VOICE-DNIS-MIB&amp;revision=2002-05-01</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VPDN-MGMT-MIB?module=CISCO-VPDN-MGMT-MIB&amp;revision=2009-06-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:CISCO-VTP-MIB?module=CISCO-VTP-MIB&amp;revision=2013-10-14</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DIAL-CONTROL-MIB?module=DIAL-CONTROL-MIB&amp;revision=1996-09-23</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DIFFSERV-DSCP-TC?module=DIFFSERV-DSCP-TC&amp;revision=2002-05-09</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DIFFSERV-MIB?module=DIFFSERV-MIB&amp;revision=2002-02-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DISMAN-EVENT-MIB?module=DISMAN-EVENT-MIB&amp;revision=2000-10-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DISMAN-EXPRESSION-MIB?module=DISMAN-EXPRESSION-MIB&amp;revision=2000-10-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DRAFT-MSDP-MIB?module=DRAFT-MSDP-MIB&amp;revision=1999-12-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DS1-MIB?module=DS1-MIB&amp;revision=1998-08-01</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:DS3-MIB?module=DS3-MIB&amp;revision=1998-08-01</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ENTITY-MIB?module=ENTITY-MIB&amp;revision=2005-08-10</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ENTITY-SENSOR-MIB?module=ENTITY-SENSOR-MIB&amp;revision=2002-12-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ENTITY-STATE-MIB?module=ENTITY-STATE-MIB&amp;revision=2005-11-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ENTITY-STATE-TC-MIB?module=ENTITY-STATE-TC-MIB&amp;revision=2005-11-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:ETHER-WIS?module=ETHER-WIS&amp;revision=2003-09-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:EXPRESSION-MIB?module=EXPRESSION-MIB&amp;revision=2005-11-24</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:EtherLike-MIB?module=EtherLike-MIB&amp;revision=2003-09-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:FRAME-RELAY-DTE-MIB?module=FRAME-RELAY-DTE-MIB&amp;revision=1997-05-01</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:HCNUM-TC?module=HCNUM-TC&amp;revision=2000-06-08</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IANA-ADDRESS-FAMILY-NUMBERS-MIB?module=IANA-ADDRESS-FAMILY-NUMBERS-MIB&amp;revision=2000-09-08</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IANA-RTPROTO-MIB?module=IANA-RTPROTO-MIB&amp;revision=2000-09-26</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IANAifType-MIB?module=IANAifType-MIB&amp;revision=2006-03-31</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IEEE8021-TC-MIB?module=IEEE8021-TC-MIB&amp;revision=2008-10-15</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IF-MIB?module=IF-MIB&amp;revision=2000-06-14</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IGMP-STD-MIB?module=IGMP-STD-MIB&amp;revision=2000-09-28</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:INET-ADDRESS-MIB?module=INET-ADDRESS-MIB&amp;revision=2005-02-04</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:INT-SERV-MIB?module=INT-SERV-MIB&amp;revision=1997-10-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:INTEGRATED-SERVICES-MIB?module=INTEGRATED-SERVICES-MIB&amp;revision=1995-11-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IP-FORWARD-MIB?module=IP-FORWARD-MIB&amp;revision=1996-09-19</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IP-MIB?module=IP-MIB&amp;revision=2006-02-02</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IPMROUTE-STD-MIB?module=IPMROUTE-STD-MIB&amp;revision=2000-09-22</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:IPV6-FLOW-LABEL-MIB?module=IPV6-FLOW-LABEL-MIB&amp;revision=2003-08-28</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-L3VPN-STD-MIB?module=MPLS-L3VPN-STD-MIB&amp;revision=2006-01-23</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-LDP-GENERIC-STD-MIB?module=MPLS-LDP-GENERIC-STD-MIB&amp;revision=2004-06-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-LDP-STD-MIB?module=MPLS-LDP-STD-MIB&amp;revision=2004-06-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-LSR-STD-MIB?module=MPLS-LSR-STD-MIB&amp;revision=2004-06-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-TC-MIB?module=MPLS-TC-MIB&amp;revision=2001-01-04</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-TC-STD-MIB?module=MPLS-TC-STD-MIB&amp;revision=2004-06-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:MPLS-TE-STD-MIB?module=MPLS-TE-STD-MIB&amp;revision=2004-06-03</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:NHRP-MIB?module=NHRP-MIB&amp;revision=1999-08-26</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:NOTIFICATION-LOG-MIB?module=NOTIFICATION-LOG-MIB&amp;revision=2000-11-27</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:OSPF-MIB?module=OSPF-MIB&amp;revision=2006-11-10</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:OSPF-TRAP-MIB?module=OSPF-TRAP-MIB&amp;revision=2006-11-10</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:P-BRIDGE-MIB?module=P-BRIDGE-MIB&amp;revision=2006-01-09</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:PIM-MIB?module=PIM-MIB&amp;revision=2000-09-28</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:PerfHist-TC-MIB?module=PerfHist-TC-MIB&amp;revision=1998-11-07</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RFC-1212?module=RFC-1212</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RFC-1215?module=RFC-1215</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RFC1155-SMI?module=RFC1155-SMI</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RFC1315-MIB?module=RFC1315-MIB</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RMON-MIB?module=RMON-MIB&amp;revision=2000-05-11</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:RSVP-MIB?module=RSVP-MIB&amp;revision=1998-08-25</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SNMP-FRAMEWORK-MIB?module=SNMP-FRAMEWORK-MIB&amp;revision=2002-10-14</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SNMP-PROXY-MIB?module=SNMP-PROXY-MIB&amp;revision=2002-10-14</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SNMP-TARGET-MIB?module=SNMP-TARGET-MIB&amp;revision=1998-08-04</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SNMPv2-MIB?module=SNMPv2-MIB&amp;revision=2002-10-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SNMPv2-TC?module=SNMPv2-TC</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:SONET-MIB?module=SONET-MIB&amp;revision=2003-08-11</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:TCP-MIB?module=TCP-MIB&amp;revision=2005-02-18</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:TOKEN-RING-RMON-MIB?module=TOKEN-RING-RMON-MIB</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:TOKENRING-MIB?module=TOKENRING-MIB&amp;revision=1994-10-23</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:TUNNEL-MIB?module=TUNNEL-MIB&amp;revision=2005-05-16</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:UDP-MIB?module=UDP-MIB&amp;revision=2005-05-20</capability>
<capability>urn:ietf:params:xml:ns:yang:smiv2:VPN-TC-STD-MIB?module=VPN-TC-STD-MIB&amp;revision=2005-11-15</capability>
</capabilities>
<session-id>85872</session-id></hello>]]>]]>

##※参考:SSHでCapabilityを確認(古いNetconf)
IOS 15.5(3)S5に対して、ポート22の古いNetconfでリターンするCapabilityは以下。比較するとかなり少ない。また、当然YANG capabilityはリターンしない。

client
~ $ssh -s cisco@10.71.130.57 netconf
Password: 
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities><capability>urn:ietf:params:netconf:base:1.0</capability>
<capability>urn:ietf:params:netconf:capability:writeable-running:1.0</capability>
<capability>urn:ietf:params:netconf:capability:startup:1.0</capability>
<capability>urn:ietf:params:netconf:capability:url:1.0</capability>
<capability>urn:cisco:params:netconf:capability:pi-data-model:1.0</capability>
<capability>urn:cisco:params:netconf:capability:notification:1.0</capability>
</capabilities><session-id>1015950016</session-id></hello>]]>]]>

##Pythonでget_configその1

ncclientを使ってrunning configを取得、表示。ncclientのサイトに使い方とサンプルがある。あとは、XMLで返ってくるのでETreeとかで頑張る?

test.py
from ncclient import manager
import xml.dom.minidom as minidom

with manager.connect(host=HOST, port=830, username=USER, password=PASS, hostkey_verify=False, device_params={'name':'csr'}) as m:
    c = m.get_config(source='running').data_xml
    
    config = minidom.parseString(c).toprettyxml(indent='  ')
    print(config)
return
<?xml version="1.0" ?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <native xmlns="http://cisco.com/ns/yang/ned/ios">
    <version>16.4</version>
    <boot-start-marker/>
    <boot-end-marker/>
    <service>
      <timestamps>
        <debug>
          <datetime>
            <msec/>
          </datetime>
        </debug>
        <log>
          <datetime>
            <msec/>
          </datetime>
        </log>
      </timestamps>
    </service>
    <platform>
      <console>
        <output>auto</output>
      </console>
    </platform>
    <hostname>CSR-2</hostname>
    <enable>
      <secret>
        <type>5</type>
        <secret>$1$gi3J$VCM0Q9b3ZbHjDmBPhHG8i1</secret>
      </secret>
    </enable>
    <username>
      <name>admin</name>
      <password>
        <encryption>0</encryption>
        <password>Nms12345</password>
      </password>
    </username>
    <username>
      <name>cisco</name>
      <privilege>15</privilege>
      <password>
        <encryption>0</encryption>
        <password>cisco</password>
      </password>
    </username>
    <username>
      <name>testuser</name>
      <password>
        <encryption>0</encryption>
        <password>C1sco12345</password>
      </password>
    </username>
    <ip>
      <domain>
        <name>solse.local</name>
      </domain>
      <forward-protocol>
        <protocol>nd</protocol>
      </forward-protocol>
      <http>
        <authentication>
          <local/>
        </authentication>
        <server>true</server>
        <secure-server>true</secure-server>
      </http>
      <route>
        <ip-route-interface-forwarding-list>
          <prefix>0.0.0.0</prefix>
          <mask>0.0.0.0</mask>
          <fwd-list>
            <fwd>10.71.135.254</fwd>
          </fwd-list>
        </ip-route-interface-forwarding-list>
      </route>
      <ssh>
        <rsa>
          <keypair-name>ssh-key</keypair-name>
        </rsa>
        <version>2</version>
      </ssh>
      <access-list>
        <extended>
          <name>IP-Adm-V4-Int-ACL-global</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>tcp</protocol>
              <any/>
              <dst-any/>
              <dst-tcp-eq>www</dst-tcp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>20</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>tcp</protocol>
              <any/>
              <dst-any/>
              <dst-tcp-eq>443</dst-tcp-eq>
            </ace-rule>
          </access-list-seq-rule>
        </extended>
        <extended>
          <name>implicit_deny</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>deny</action>
              <protocol>ip</protocol>
              <any/>
              <dst-any/>
            </ace-rule>
          </access-list-seq-rule>
        </extended>
        <extended>
          <name>preauth_v4</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <dst-any/>
              <dst-udp-eq>domain</dst-udp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>20</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>tcp</protocol>
              <any/>
              <dst-any/>
              <dst-tcp-eq>domain</dst-tcp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>30</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <src-udp-eq>bootps</src-udp-eq>
              <dst-any/>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>40</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <dst-any/>
              <dst-udp-eq>bootpc</dst-udp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>50</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <src-udp-eq>bootpc</src-udp-eq>
              <dst-any/>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>60</sequence>
            <ace-rule>
              <action>deny</action>
              <protocol>ip</protocol>
              <any/>
              <dst-any/>
            </ace-rule>
          </access-list-seq-rule>
        </extended>
        <extended>
          <name>test-ansible</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>ip</protocol>
              <host>1.1.1.1</host>
              <dst-any/>
              <log/>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>20</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>ip</protocol>
              <host>2.2.2.2</host>
              <dst-any/>
              <log/>
            </ace-rule>
          </access-list-seq-rule>
        </extended>
      </access-list>
    </ip>
    <ipv6>
      <access-list>
        <named-acl>
          <name>implicit_deny_v6</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>deny</action>
              <protocol>ipv6</protocol>
              <any/>
              <destination-any/>
            </ace-rule>
          </access-list-seq-rule>
        </named-acl>
        <named-acl>
          <name>preauth_v6</name>
          <access-list-seq-rule>
            <sequence>10</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <destination-any/>
              <dst-udp-eq>domain</dst-udp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>20</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>tcp</protocol>
              <any/>
              <destination-any/>
              <dst-tcp-eq>domain</dst-tcp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>30</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>icmp</protocol>
              <any/>
              <destination-any/>
              <named-msg-type>nd-ns</named-msg-type>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>40</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>icmp</protocol>
              <any/>
              <destination-any/>
              <named-msg-type>nd-na</named-msg-type>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>50</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>icmp</protocol>
              <any/>
              <destination-any/>
              <named-msg-type>router-solicitation</named-msg-type>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>60</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>icmp</protocol>
              <any/>
              <destination-any/>
              <named-msg-type>router-advertisement</named-msg-type>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>70</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>icmp</protocol>
              <any/>
              <destination-any/>
              <named-msg-type>redirect</named-msg-type>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>80</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <src-udp-eq>547</src-udp-eq>
              <destination-any/>
              <dst-udp-eq>546</dst-udp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>90</sequence>
            <ace-rule>
              <action>permit</action>
              <protocol>udp</protocol>
              <any/>
              <src-udp-eq>546</src-udp-eq>
              <destination-any/>
              <dst-udp-eq>547</dst-udp-eq>
            </ace-rule>
          </access-list-seq-rule>
          <access-list-seq-rule>
            <sequence>100</sequence>
            <ace-rule>
              <action>deny</action>
              <protocol>ipv6</protocol>
              <any/>
              <destination-any/>
            </ace-rule>
          </access-list-seq-rule>
        </named-acl>
      </access-list>
    </ipv6>
    <interface>
      <GigabitEthernet>
        <name>1</name>
        <negotiation>
          <auto>true</auto>
        </negotiation>
        <ip>
          <address>
            <primary>
              <address>10.71.130.58</address>
              <mask>255.255.248.0</mask>
            </primary>
          </address>
        </ip>
        <mop>
          <enabled>false</enabled>
        </mop>
      </GigabitEthernet>
      <GigabitEthernet>
        <name>2</name>
        <negotiation>
          <auto>true</auto>
        </negotiation>
        <ip>
          <no-address>
            <address>false</address>
          </no-address>
        </ip>
        <mop>
          <enabled>false</enabled>
        </mop>
        <shutdown/>
      </GigabitEthernet>
      <GigabitEthernet>
        <name>3</name>
        <negotiation>
          <auto>true</auto>
        </negotiation>
        <ip>
          <no-address>
            <address>false</address>
          </no-address>
        </ip>
        <mop>
          <enabled>false</enabled>
        </mop>
        <shutdown/>
      </GigabitEthernet>
      <Loopback>
        <name>0</name>
        <ip>
          <no-address>
            <address>false</address>
          </no-address>
        </ip>
      </Loopback>
    </interface>
    <banner>
      <motd>
        <start-marker>^CHello</start-marker>
        <message>Ansible</message>
      </motd>
    </banner>
    <diagnostic>
      <bootup>
        <level>minimal</level>
      </bootup>
    </diagnostic>
    <control-plane/>
    <line>
      <console>
        <first>0</first>
        <stopbits>1</stopbits>
      </console>
      <vty>
        <first>0</first>
        <last>4</last>
        <transport>
          <input>
            <input>all</input>
          </input>
        </transport>
      </vty>
    </line>
    <multilink>
      <bundle-name>authenticated</bundle-name>
    </multilink>
    <redundancy/>
    <spanning-tree>
      <extend>
        <system-id/>
      </extend>
    </spanning-tree>
    <subscriber>
      <templating/>
    </subscriber>
    <aaa>
      <new-model/>
      <authorization>
        <exec>
          <name>default</name>
          <a1>
            <local/>
          </a1>
        </exec>
      </authorization>
      <session-id>common</session-id>
    </aaa>
    <crypto>
      <pki>
        <certificate>
          <chain>
            <name>TP-self-signed-4057790232</name>
            <certificate>
              <serial>01</serial>
              <certtype>self-signed</certtype>
            </certificate>
            <certificate>
              <serial>quit</serial>
            </certificate>
          </chain>
        </certificate>
        <trustpoint>
          <id>TP-self-signed-4057790232</id>
          <enrollment>
            <selfsigned/>
          </enrollment>
          <revocation-check>none</revocation-check>
          <rsakeypair>TP-self-signed-4057790232</rsakeypair>
          <subject-name>cn=IOS-Self-Signed-Certificate-4057790232</subject-name>
        </trustpoint>
      </pki>
    </crypto>
    <virtual-service>
      <name>csr_mgmt</name>
      <activate/>
    </virtual-service>
    <snmp-server>
      <community>
        <name>NMS_private</name>
        <RW/>
      </community>
      <community>
        <name>NMS_public</name>
        <RO/>
      </community>
      <community>
        <name>private</name>
        <RW/>
      </community>
      <community>
        <name>public</name>
        <RO/>
      </community>
    </snmp-server>
    <license>
      <udi>
        <pid>CSR1000V</pid>
        <sn>94A08OEI6IF</sn>
      </udi>
    </license>
  </native>
  <netconf-yang xmlns="http://cisco.com/yang/cisco-self-mgmt">
    <cisco-ia xmlns="http://cisco.com/yang/cisco-ia">
      <auto-sync>without-defaults</auto-sync>
      <init-sync>without-defaults</init-sync>
      <intelligent-sync>false</intelligent-sync>
      <snmp-trap-control>
        <global-forwarding>true</global-forwarding>
      </snmp-trap-control>
      <message-diag-level>0</message-diag-level>
      <max-diag-messages-saved>30</max-diag-messages-saved>
      <post-sync-acl-process>true</post-sync-acl-process>
      <config-change-delay>0</config-change-delay>
      <process-missing-prc>true</process-missing-prc>
      <logging>
        <confd-log-level>error</confd-log-level>
        <ciaauthd-log-level>error</ciaauthd-log-level>
        <nes-log-level>error</nes-log-level>
        <onep-log-level>error</onep-log-level>
        <odm-log-level>error</odm-log-level>
        <sync-log-level>error</sync-log-level>
      </logging>
      <blocking>
        <cli-blocking-enabled>false</cli-blocking-enabled>
        <confd-cfg-blocking-enabled>true</confd-cfg-blocking-enabled>
      </blocking>
    </cisco-ia>
    <cisco-odm xmlns="http://cisco.com/yang/cisco-odm">
      <polling-enable>false</polling-enable>
      <on-demand-default-time>30000</on-demand-default-time>
      <on-demand-enable>false</on-demand-enable>
      <actions>
        <action-name>EthernetCFMStats</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>ACL</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>MemoryProcesses</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>CPUProcesses</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>MPLSLDPNeighbors</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>BGP</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>IPRoute</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>MemoryStats</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>BridgeDomain</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>OSPF</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>MPLSStaticBinding</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>EFPStats</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>LLDPNeighbors</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>Environment</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>VirtualService</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>FlowMonitor</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>Archive</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>PlatformSoftware</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>BFDNeighbors</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>Interfaces</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>MPLSForwardingTable</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
      <actions>
        <action-name>IPSLAStats</action-name>
        <polling-interval>120000</polling-interval>
        <mode>poll</mode>
      </actions>
    </cisco-odm>
  </netconf-yang>
  <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
    <interface>
      <name>GigabitEthernet1</name>
      <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
      <enabled>true</enabled>
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
        <address>
          <ip>10.71.130.58</ip>
          <netmask>255.255.248.0</netmask>
        </address>
      </ipv4>
      <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
    </interface>
    <interface>
      <name>GigabitEthernet2</name>
      <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
      <enabled>false</enabled>
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
    </interface>
    <interface>
      <name>GigabitEthernet3</name>
      <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
      <enabled>false</enabled>
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
    </interface>
    <interface>
      <name>Loopback0</name>
      <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:softwareLoopback</type>
      <enabled>true</enabled>
      <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
      <ipv6 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip"/>
    </interface>
  </interfaces>
  <routing xmlns="urn:ietf:params:xml:ns:yang:ietf-routing">
    <routing-instance>
      <name>default</name>
      <description>default-vrf [read-only]</description>
      <interfaces/>
      <routing-protocols>
        <routing-protocol>
          <type>static</type>
          <name>1</name>
          <static-routes>
            <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing">
              <route>
                <destination-prefix>0.0.0.0/0</destination-prefix>
                <next-hop>
                  <next-hop-address>10.71.135.254</next-hop-address>
                </next-hop>
              </route>
            </ipv4>
          </static-routes>
        </routing-protocol>
      </routing-protocols>
    </routing-instance>
  </routing>
</data>

##Pythonでget_configその2

xmltodicモジュールを使ってXMLのリターンをディクショナリオブジェクトに変換し、JSONにダンプして表示。

test2.py
from ncclient import manager
import xmltodict
import json

with manager.connect(host=HOST, port=830, username=USER, password=PASS, hostkey_verify=False, device_params={'name':'csr'}) as m:
    c = m.get_config(source='running').data_xml
      
    json = json.dumps(xmltodict.parse(c), indent=4)
    print(json)
return
{
    "data": {
        "@xmlns": "urn:ietf:params:xml:ns:netconf:base:1.0",
        "@xmlns:nc": "urn:ietf:params:xml:ns:netconf:base:1.0",
        "native": {
            "@xmlns": "http://cisco.com/ns/yang/ned/ios",
            "version": "16.4",
            "boot-start-marker": null,
            "boot-end-marker": null,
            "service": {
                "timestamps": {
                    "debug": {
                        "datetime": {
                            "msec": null
                        }
                    },
                    "log": {
                        "datetime": {
                            "msec": null
                        }
                    }
                }
            },
            "platform": {
                "console": {
                    "output": "auto"
                }
            },
            "hostname": "CSR-2",
            "enable": {
                "secret": {
                    "type": "5",
                    "secret": "$1$gi3J$VCM0Q9b3ZbHjDmBPhHG8i1"
                }
            },
            "username": [
                {
                    "name": "admin",
                    "password": {
                        "encryption": "0",
                        "password": "Nms12345"
                    }
                },
                {
                    "name": "cisco",
                    "privilege": "15",
                    "password": {
                        "encryption": "0",
                        "password": "cisco"
                    }
                },
                {
                    "name": "testuser",
                    "password": {
                        "encryption": "0",
                        "password": "C1sco12345"
                    }
                }
            ],
            "ip": {
                "domain": {
                    "name": "solse.local"
                },
                "forward-protocol": {
                    "protocol": "nd"
                },
                "http": {
                    "authentication": {
                        "local": null
                    },
                    "server": "true",
                    "secure-server": "true"
                },
                "route": {
                    "ip-route-interface-forwarding-list": {
                        "prefix": "0.0.0.0",
                        "mask": "0.0.0.0",
                        "fwd-list": {
                            "fwd": "10.71.135.254"
                        }
                    }
                },
                "ssh": {
                    "rsa": {
                        "keypair-name": "ssh-key"
                    },
                    "version": "2"
                },
                "access-list": {
                    "extended": [
                        {
                            "name": "IP-Adm-V4-Int-ACL-global",
                            "access-list-seq-rule": [
                                {
                                    "sequence": "10",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "tcp",
                                        "any": null,
                                        "dst-any": null,
                                        "dst-tcp-eq": "www"
                                    }
                                },
                                {
                                    "sequence": "20",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "tcp",
                                        "any": null,
                                        "dst-any": null,
                                        "dst-tcp-eq": "443"
                                    }
                                }
                            ]
                        },
                        {
                            "name": "implicit_deny",
                            "access-list-seq-rule": {
                                "sequence": "10",
                                "ace-rule": {
                                    "action": "deny",
                                    "protocol": "ip",
                                    "any": null,
                                    "dst-any": null
                                }
                            }
                        },
                        {
                            "name": "preauth_v4",
                            "access-list-seq-rule": [
                                {
                                    "sequence": "10",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "dst-any": null,
                                        "dst-udp-eq": "domain"
                                    }
                                },
                                {
                                    "sequence": "20",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "tcp",
                                        "any": null,
                                        "dst-any": null,
                                        "dst-tcp-eq": "domain"
                                    }
                                },
                                {
                                    "sequence": "30",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "src-udp-eq": "bootps",
                                        "dst-any": null
                                    }
                                },
                                {
                                    "sequence": "40",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "dst-any": null,
                                        "dst-udp-eq": "bootpc"
                                    }
                                },
                                {
                                    "sequence": "50",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "src-udp-eq": "bootpc",
                                        "dst-any": null
                                    }
                                },
                                {
                                    "sequence": "60",
                                    "ace-rule": {
                                        "action": "deny",
                                        "protocol": "ip",
                                        "any": null,
                                        "dst-any": null
                                    }
                                }
                            ]
                        },
                        {
                            "name": "test-ansible",
                            "access-list-seq-rule": [
                                {
                                    "sequence": "10",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "ip",
                                        "host": "1.1.1.1",
                                        "dst-any": null,
                                        "log": null
                                    }
                                },
                                {
                                    "sequence": "20",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "ip",
                                        "host": "2.2.2.2",
                                        "dst-any": null,
                                        "log": null
                                    }
                                }
                            ]
                        }
                    ]
                }
            },
            "ipv6": {
                "access-list": {
                    "named-acl": [
                        {
                            "name": "implicit_deny_v6",
                            "access-list-seq-rule": {
                                "sequence": "10",
                                "ace-rule": {
                                    "action": "deny",
                                    "protocol": "ipv6",
                                    "any": null,
                                    "destination-any": null
                                }
                            }
                        },
                        {
                            "name": "preauth_v6",
                            "access-list-seq-rule": [
                                {
                                    "sequence": "10",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "destination-any": null,
                                        "dst-udp-eq": "domain"
                                    }
                                },
                                {
                                    "sequence": "20",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "tcp",
                                        "any": null,
                                        "destination-any": null,
                                        "dst-tcp-eq": "domain"
                                    }
                                },
                                {
                                    "sequence": "30",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "icmp",
                                        "any": null,
                                        "destination-any": null,
                                        "named-msg-type": "nd-ns"
                                    }
                                },
                                {
                                    "sequence": "40",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "icmp",
                                        "any": null,
                                        "destination-any": null,
                                        "named-msg-type": "nd-na"
                                    }
                                },
                                {
                                    "sequence": "50",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "icmp",
                                        "any": null,
                                        "destination-any": null,
                                        "named-msg-type": "router-solicitation"
                                    }
                                },
                                {
                                    "sequence": "60",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "icmp",
                                        "any": null,
                                        "destination-any": null,
                                        "named-msg-type": "router-advertisement"
                                    }
                                },
                                {
                                    "sequence": "70",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "icmp",
                                        "any": null,
                                        "destination-any": null,
                                        "named-msg-type": "redirect"
                                    }
                                },
                                {
                                    "sequence": "80",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "src-udp-eq": "547",
                                        "destination-any": null,
                                        "dst-udp-eq": "546"
                                    }
                                },
                                {
                                    "sequence": "90",
                                    "ace-rule": {
                                        "action": "permit",
                                        "protocol": "udp",
                                        "any": null,
                                        "src-udp-eq": "546",
                                        "destination-any": null,
                                        "dst-udp-eq": "547"
                                    }
                                },
                                {
                                    "sequence": "100",
                                    "ace-rule": {
                                        "action": "deny",
                                        "protocol": "ipv6",
                                        "any": null,
                                        "destination-any": null
                                    }
                                }
                            ]
                        }
                    ]
                }
            },
            "interface": {
                "GigabitEthernet": [
                    {
                        "name": "1",
                        "negotiation": {
                            "auto": "true"
                        },
                        "ip": {
                            "address": {
                                "primary": {
                                    "address": "10.71.130.58",
                                    "mask": "255.255.248.0"
                                }
                            }
                        },
                        "mop": {
                            "enabled": "false"
                        }
                    },
                    {
                        "name": "2",
                        "negotiation": {
                            "auto": "true"
                        },
                        "ip": {
                            "no-address": {
                                "address": "false"
                            }
                        },
                        "mop": {
                            "enabled": "false"
                        },
                        "shutdown": null
                    },
                    {
                        "name": "3",
                        "negotiation": {
                            "auto": "true"
                        },
                        "ip": {
                            "no-address": {
                                "address": "false"
                            }
                        },
                        "mop": {
                            "enabled": "false"
                        },
                        "shutdown": null
                    }
                ],
                "Loopback": {
                    "name": "0",
                    "ip": {
                        "no-address": {
                            "address": "false"
                        }
                    }
                }
            },
            "banner": {
                "motd": {
                    "start-marker": "^CHello",
                    "message": "Ansible"
                }
            },
            "diagnostic": {
                "bootup": {
                    "level": "minimal"
                }
            },
            "control-plane": null,
            "line": {
                "console": {
                    "first": "0",
                    "stopbits": "1"
                },
                "vty": {
                    "first": "0",
                    "last": "4",
                    "transport": {
                        "input": {
                            "input": "all"
                        }
                    }
                }
            },
            "multilink": {
                "bundle-name": "authenticated"
            },
            "redundancy": null,
            "spanning-tree": {
                "extend": {
                    "system-id": null
                }
            },
            "subscriber": {
                "templating": null
            },
            "aaa": {
                "new-model": null,
                "authorization": {
                    "exec": {
                        "name": "default",
                        "a1": {
                            "local": null
                        }
                    }
                },
                "session-id": "common"
            },
            "crypto": {
                "pki": {
                    "certificate": {
                        "chain": {
                            "name": "TP-self-signed-4057790232",
                            "certificate": [
                                {
                                    "serial": "01",
                                    "certtype": "self-signed"
                                },
                                {
                                    "serial": "quit"
                                }
                            ]
                        }
                    },
                    "trustpoint": {
                        "id": "TP-self-signed-4057790232",
                        "enrollment": {
                            "selfsigned": null
                        },
                        "revocation-check": "none",
                        "rsakeypair": "TP-self-signed-4057790232",
                        "subject-name": "cn=IOS-Self-Signed-Certificate-4057790232"
                    }
                }
            },
            "virtual-service": {
                "name": "csr_mgmt",
                "activate": null
            },
            "snmp-server": {
                "community": [
                    {
                        "name": "NMS_private",
                        "RW": null
                    },
                    {
                        "name": "NMS_public",
                        "RO": null
                    },
                    {
                        "name": "private",
                        "RW": null
                    },
                    {
                        "name": "public",
                        "RO": null
                    }
                ]
            },
            "license": {
                "udi": {
                    "pid": "CSR1000V",
                    "sn": "94A08OEI6IF"
                }
            }
        },
        "netconf-yang": {
            "@xmlns": "http://cisco.com/yang/cisco-self-mgmt",
            "cisco-ia": {
                "@xmlns": "http://cisco.com/yang/cisco-ia",
                "auto-sync": "without-defaults",
                "init-sync": "without-defaults",
                "intelligent-sync": "false",
                "snmp-trap-control": {
                    "global-forwarding": "true"
                },
                "message-diag-level": "0",
                "max-diag-messages-saved": "30",
                "post-sync-acl-process": "true",
                "config-change-delay": "0",
                "process-missing-prc": "true",
                "logging": {
                    "confd-log-level": "error",
                    "ciaauthd-log-level": "error",
                    "nes-log-level": "error",
                    "onep-log-level": "error",
                    "odm-log-level": "error",
                    "sync-log-level": "error"
                },
                "blocking": {
                    "cli-blocking-enabled": "false",
                    "confd-cfg-blocking-enabled": "true"
                }
            },
            "cisco-odm": {
                "@xmlns": "http://cisco.com/yang/cisco-odm",
                "polling-enable": "false",
                "on-demand-default-time": "30000",
                "on-demand-enable": "false",
                "actions": [
                    {
                        "action-name": "EthernetCFMStats",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "ACL",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "MemoryProcesses",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "CPUProcesses",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "MPLSLDPNeighbors",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "BGP",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "IPRoute",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "MemoryStats",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "BridgeDomain",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "OSPF",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "MPLSStaticBinding",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "EFPStats",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "LLDPNeighbors",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "Environment",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "VirtualService",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "FlowMonitor",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "Archive",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "PlatformSoftware",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "BFDNeighbors",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "Interfaces",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "MPLSForwardingTable",
                        "polling-interval": "120000",
                        "mode": "poll"
                    },
                    {
                        "action-name": "IPSLAStats",
                        "polling-interval": "120000",
                        "mode": "poll"
                    }
                ]
            }
        },
        "interfaces": {
            "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-interfaces",
            "interface": [
                {
                    "name": "GigabitEthernet1",
                    "type": {
                        "@xmlns:ianaift": "urn:ietf:params:xml:ns:yang:iana-if-type",
                        "#text": "ianaift:ethernetCsmacd"
                    },
                    "enabled": "true",
                    "ipv4": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip",
                        "address": {
                            "ip": "10.71.130.58",
                            "netmask": "255.255.248.0"
                        }
                    },
                    "ipv6": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    }
                },
                {
                    "name": "GigabitEthernet2",
                    "type": {
                        "@xmlns:ianaift": "urn:ietf:params:xml:ns:yang:iana-if-type",
                        "#text": "ianaift:ethernetCsmacd"
                    },
                    "enabled": "false",
                    "ipv4": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    },
                    "ipv6": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    }
                },
                {
                    "name": "GigabitEthernet3",
                    "type": {
                        "@xmlns:ianaift": "urn:ietf:params:xml:ns:yang:iana-if-type",
                        "#text": "ianaift:ethernetCsmacd"
                    },
                    "enabled": "false",
                    "ipv4": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    },
                    "ipv6": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    }
                },
                {
                    "name": "Loopback0",
                    "type": {
                        "@xmlns:ianaift": "urn:ietf:params:xml:ns:yang:iana-if-type",
                        "#text": "ianaift:softwareLoopback"
                    },
                    "enabled": "true",
                    "ipv4": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    },
                    "ipv6": {
                        "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ip"
                    }
                }
            ]
        },
        "routing": {
            "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-routing",
            "routing-instance": {
                "name": "default",
                "description": "default-vrf [read-only]",
                "interfaces": null,
                "routing-protocols": {
                    "routing-protocol": {
                        "type": "static",
                        "name": "1",
                        "static-routes": {
                            "ipv4": {
                                "@xmlns": "urn:ietf:params:xml:ns:yang:ietf-ipv4-unicast-routing",
                                "route": {
                                    "destination-prefix": "0.0.0.0/0",
                                    "next-hop": {
                                        "next-hop-address": "10.71.135.254"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

以上です。

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?