1

I would like to get a routing table from a csr device. Basically, the same information that is provided with the show ip route command. I would expect a non-empty rpc message from the csr with non-empty routing table, which is not the case. The piece of code:

enter image description here

In reality, I get the empty message:

rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:ad911b9f-70ab-4af8-a369-c80bf0924fb9" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"></rpc-reply

I built the xml based on ietf-ip yang model.

user3603644
  • 95
  • 1
  • 7
  • It is mighty suspicious that your `routing` variable contains no namespace information in that XML content. Have you tried to properly namespace the elements in your `filter`? The proper reply for to your query would contain an empty `` element, if nothing matches the filter - perhaps you are dealing with a non-standard NETCONF device. – predi Aug 16 '22 at 13:50

1 Answers1

0

You use get_config, so you only query configuration data.

You must use the normal get to query operational data as well. So it would look something like this: csr.get(filter=("subtree", routing)).

The filter also looks a bit off, but you need to check the YANG models. You can also try filtering only for routing at the beginning. I would guess that with routing you get data from the "ietf-routing" model, but that maybe depends on your IOS version.

ubaumann
  • 180
  • 1
  • 7