05-04-2023 04:50 AM
Hi Community,
I am running in my lab 16.9 IOS-XE, and trying to work on automation to pull the interface data like IP addresses. And so far I was happily using the ietf-interfaces or the openconfig-interfaces yang models, they perfectly provided me the JSON structured data I needed.
But now as I am testing more and more use-cases, and added IPv6 addresses, the models, both of them fail.
"error-message": "Bad return value",
"error-path": "/ietf-interfaces:interfaces/interface=GigabitEthernet3/ietf-ip:ipv6/address",
"error-tag": "operation-failed",
"error-type": "application"
Yang-SUITE also shows everything until it doesnt reach the interface with IPv6 address. Could anyone of you having a higher version IOS-XE test, if this is only a version error?
curl -X 'GET' 'https://[your-router-IP]:443/restconf/data/ietf-interfaces:interfaces' -H 'accept: application/yang-data+json' -k -u [yourusername]:[yourpassword]
Or do you have idea why does it fail?
Many thanks!
Solved! Go to Solution.
05-04-2023 05:50 AM
Check the version running, i saw this here --> https://community.cisco.com/t5/devnet-sandbox/ncclient-get-config-error-when-configure-ipv6-on-interface/td-p/4464007
05-04-2023 05:02 AM
Hello @IPBence,
What is the router model on your lab ?
05-04-2023 05:06 AM
Hello, csr1000v
05-04-2023 05:50 AM
Check the version running, i saw this here --> https://community.cisco.com/t5/devnet-sandbox/ncclient-get-config-error-when-configure-ipv6-on-interface/td-p/4464007
05-04-2023 06:08 AM
Dear Team,
Thanks, I can confirm its a SW version related issue, I went to the Cisco official sandboy with newest IOS-XE:
And then I created an IPv6 address on a loopavk interface, and requested the ietf-interfaces json, and it received just fine.
curl -X 'GET' 'https://sandbox-iosxe-latest-1.cisco.com:443/restconf/data/ietf-interfaces:interfaces' -H 'accept: application/yang-data+json' -k -u admin:C1sco12345
{
"name": "Loopback6",
"description": "ipv6 ietf-interfaces-yang test",
"type": "iana-if-type:softwareLoopback",
"enabled": true,
"ietf-ip:ipv4": {
},
"ietf-ip:ipv6": {
"address": [
{
"ip": "fd0e:2043:6075:a2cb::1",
"prefix-length": 100
}
]
}
},
Thanks!
Now I am just wandering why the ietf and openconifg models doesnt contain the vrf attribute, while the native model does, but thats the topic for a different thread I guess
05-04-2023 07:29 AM
To my understanding, the VRF attribute is a feature that is specific to certain vendors and platforms, and may not be applicable or relevant to all device. In some cases the IETF and OpenConfig models may not include a VRF attribute by default, as they are designed to provide a generic representation of network configurations. From what i have seen though some vendors have chosen to include the VRF attribute in their implementations of the IETF or OpenConfig YANG models, either as an extension or as a vendor-specific attribute.
The native model, may include features and attributes that are unique to that system, including the VRF attribute. This reflects the fact that the native model is optimized for the specific capabilities and requirements of that vendor's devices, and may not be directly interoperable with other vendors or platforms without additional customization or translation.
Hope this helps.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide