09-30-2023 05:41 AM
When trying get RPC from IOS XE 17.9.4 c8000v not getting response or error. On hitting enter the netconf session is getting terminated.
below configs are used to
BN-CP#show run | sec netconf
netconf ssh
netconf-yang
BN-CP#
09-30-2023 06:01 AM
the image you posted not clear to use what is trying to do here (what logs you see on the devices ?)- try some troubleshooting using below guide :
09-30-2023 11:58 PM - edited 09-30-2023 11:59 PM
Hi, you need to send a client hello before you do a RPC, also make sure to set the namspace - try this:
# ssh into box
ssh -s username@xeboxhostname -p 830 netconf
# send client hello
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.0</capability>
</capabilities>
</hello>
]]>]]>
# send RPC
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<nc:get>
<nc:filter>
<modules-state xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-library"/>
</nc:filter>
</nc:get>
</nc:rpc>
]]>]]>
However I recommend using a tool or programming language when doing NETCONF with a device. Have a look at https://github.com/CiscoDevNet/yangsuite or use a Python library like scrapli-netconf (https://scrapli.github.io/scrapli_netconf/user_guide/quickstart/) or ncclient (https://pypi.org/project/ncclient/)
HTH
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