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

Not getting netconf RPC response IOS XE 17.9.4 c8000v

prohit
Level 1
Level 1

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.

prohit_0-1696077520889.png

 

below configs are used to 

BN-CP#show run | sec netconf
netconf ssh
netconf-yang
BN-CP#

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

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 :

https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/177/b_177_programmability_cg/m_177_prog_yang_netconf.html

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Marcel Zehnder
Spotlight
Spotlight

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