cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1913
Views
0
Helpful
2
Replies

ncclient get_config error when configure ipv6 on interface

a60814billy
Level 1
Level 1

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?

 

1 Accepted Solution

Accepted Solutions

@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>
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

2 Replies 2

@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>
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io
Getting Started

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: