cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
356
Views
3
Helpful
8
Replies

Cisco IOS XR Software, Version 7.0.1 Netconf

kanjarladevika
Level 1
Level 1

Established Netconf connection using ssh, Received Hello Message from device along with capabilities.

I sent below Hello message
<?xml version="1.1" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.1</capability>
</capabilities>
</hello>]]>]]>

After this connection gets terminated abruptly after two enters. But In log I can see that Hello message validation is successful.
May 16 15:21:45.040 netconf/netconf.trace 0/RP0/CPU0 t20216 #2617816: TRC: nc_sm_rcv_eom:5010 Hello message validation success.

If I set chucked Hello message like below, I'm not getting any response.
#195
<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.1</capability>
</capabilities>
</hello>
##

Below get request is also not returning anything

#320
<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get>
<filter>
<interfaces xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-pfi-im-cmd-oper">
<interface-xr>
<interface/>
</interface-xr>
</interfaces>
</filter>
</get>
</rpc>
##

 

Can you please help me with this.

1 Accepted Solution

Accepted Solutions

I’m not sure would need to check 

sandbox-iosxr-1.cisco.com 22 830 57722 57777 admin C1sco12345
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

8 Replies 8

Looking at your output, your device successfully process your hello message, this part is ok. But you here are mixing two different netconf framing methods you see in your first attempt, you used the older end-of-message delimiter ]]>]]> (NETCONF 1.0) but later attempt, you are trying to use chunked framing (NETCONF 1.1) (with #195 and #320), the end device might not support or correctly handle this specific chunking mechanism for the hello message.
 
Try this as your request 
 
<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <get>
    <filter>
      <interfaces xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-pfi-im-cmd-oper">
        <interface-xr>
          <interface/>
        </interface-xr>
      </interfaces>
    </filter>
  </get>
</rpc>
 
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

kanjarladevika
Level 1
Level 1

I sent below Hello message
<?xml version="1.1" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.1</capability>
</capabilities>
</hello>]]>]]>

After this connection gets terminated abruptly after two enters with below statement.

Connection to <device ip> closed by remote host.

This this why, I tried with chunked framework.

Below are the device capabilities

<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>urn:ietf:params:netconf:base:1.1</capability>
<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>
<capability>urn:ietf:params:netconf:capability:rollback-on-error:1.0</capability>
<capability>urn:ietf:params:netconf:capability:validate:1.1</capability>
<capability>urn:ietf:params:netconf:capability:confirmed-commit:1.1</capability>
<capability>urn:ietf:params:netconf:capability:notification:1.0</capability>
<capability>urn:ietf:params:netconf:capability:interleave:1.0</capability>

I just tested this on the devnet sandbox, this format works correctly with the XR device.

<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <get>
    <filter>
      <interfaces xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-pfi-im-cmd-oper">
        <interface-xr>
          <interface/>
        </interface-xr>
      </interfaces>
    </filter>
  </get>
</rpc>

 

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

can you share device version

I’m not sure would need to check 

sandbox-iosxr-1.cisco.com 22 830 57722 57777 admin C1sco12345
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

So it closes as it gets something it does not like is my guess, have you tried <?xml version="1.0" encoding="UTF-8"?>? 

 

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

yes, below is my Hello request to the device

<?xml version="1.0" encoding="UTF-8"?>
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
  <capabilities>
    <capability>urn:ietf:params:netconf:base:1.1</capability>
  </capabilities>
</hello>
]]>]]>