09-11-2021 11:15 AM - edited 09-11-2021 11:19 AM
I tried to use ncclient to get csr1000v running config, and got error message: ncclient.operations.rpc.RPCError: error: application protocol error. My csr1000v version is Cisco IOS XE Software, Version 16.09.05.
I found the application protocol error happened in IPv6 section when turning on the debug log.
<ipv6 xmlns="http://openconfig.net/yang/interfaces/ip">
<addresses>
<rpc-error xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<error-type>application</error-type>
<error-tag>operation-failed</error-tag>
<error-severity>error</error-severity>
<error-message xml:lang="en">application protocol error</error-message>
<error-info>
<bad-element>address</bad-element>
</error-info>
</rpc-error>
</addresses>
My csr1kv with these ipv6 configure:
interface GigabitEthernet1 description IPv6 ADDRESS ip address dhcp negotiation auto ipv6 address 2001:ACAD:23::1/64 no mop enable no mop sysid
The ncclient get_config is working without error when I remove "ipv6 address" config in csr1kv.
Below is my source code in python 3.8.10 and ncclient 0.6.12. Complete log is in attachment output.txt.
from ncclient import manager import logging import xml.dom.minidom logging.basicConfig( level=logging.DEBUG ) m = manager.connect( host="192.168.115.3", port=830, username="cisco", password="cisco123!", hostkey_verify=False, device_params={'name': 'iosxe'}, allow_agent=False, look_for_keys=False ) netconf_reply = m.get_config("running") print(xml.dom.minidom.parseString(netconf_reply.xml).toprettyxml())
Anyone known how to use ncclient get_config with ipv6 address setup in csr1kv?
Solved! Go to Solution.
09-12-2021 09:36 AM - edited 09-12-2021 09:36 AM
@a60814billy does not look like your script I ran this on https://devnetsandbox.cisco.com/RM/Diagram/Index/7b4d4209-a17c-4bc3-9b38-f15184e53a94?diagramType=Topology which is on code train Cisco IOS XE Software, Version 17.03.01a
csr1000v-1#sh run int g2 Building configuration... Current configuration : 185 bytes ! interface GigabitEthernet2 description IPv6 ADDRESS ip address dhcp shutdown negotiation auto ipv6 address 2001:ACAD:23::1/64 no mop enabled no mop sysid crypto map VPN1 end
Here is the snip of the output and attached the entire output for your code.
<config> <name>GigabitEthernet2</name> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type> <description>IPv6 ADDRESS</description> <enabled>false</enabled> </config> <subinterfaces> <subinterface> <index>0</index> <config> <index>0</index> <description>IPv6 ADDRESS</description> <enabled>false</enabled> </config> <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip"> <addresses> <address> <ip>2001:ACAD:23::1</ip> <config> <ip>2001:ACAD:23::1</ip> <prefix-length>64</prefix-length> </config> </address> </addresses> <config> <enabled>false</enabled> </config> </ipv6> </subinterface> </subinterfaces> <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet"> <config>
09-12-2021 09:36 AM - edited 09-12-2021 09:36 AM
@a60814billy does not look like your script I ran this on https://devnetsandbox.cisco.com/RM/Diagram/Index/7b4d4209-a17c-4bc3-9b38-f15184e53a94?diagramType=Topology which is on code train Cisco IOS XE Software, Version 17.03.01a
csr1000v-1#sh run int g2 Building configuration... Current configuration : 185 bytes ! interface GigabitEthernet2 description IPv6 ADDRESS ip address dhcp shutdown negotiation auto ipv6 address 2001:ACAD:23::1/64 no mop enabled no mop sysid crypto map VPN1 end
Here is the snip of the output and attached the entire output for your code.
<config> <name>GigabitEthernet2</name> <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type> <description>IPv6 ADDRESS</description> <enabled>false</enabled> </config> <subinterfaces> <subinterface> <index>0</index> <config> <index>0</index> <description>IPv6 ADDRESS</description> <enabled>false</enabled> </config> <ipv6 xmlns="http://openconfig.net/yang/interfaces/ip"> <addresses> <address> <ip>2001:ACAD:23::1</ip> <config> <ip>2001:ACAD:23::1</ip> <prefix-length>64</prefix-length> </config> </address> </addresses> <config> <enabled>false</enabled> </config> </ipv6> </subinterface> </subinterfaces> <ethernet xmlns="http://openconfig.net/yang/interfaces/ethernet"> <config>
09-12-2021 11:21 AM
Thanks @bigevilbeard, It's works on version 16.12.04a but not in 16.11.01a (https://devnetsandbox.cisco.com/RM/Diagram/Index/11a91667-2137-4eec-b685-6247707f2b45).
I can't found any release notes mention this problem (https://www.cisco.com/c/en/us/td/docs/routers/csr1000/release/notes/xe-16/csr1000v_rn-16-12.html).
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: