07-21-2021 06:59 PM
Hello Boss,
Please kindly see the question below.
07-22-2021 11:24 AM
Hi Jacky
You got wrong tag name 'TwoGigabitEthernet'; should be 'twogigabitethernet' according to the YANG model.
Suggest to read documentation here.
07-22-2021 07:18 PM
Hi Yan,
I tried it but it still doesn't work for "CIsco-IOS-XE-native" but it works for "ieft-interfaces" and "openconfig-interfaces"
It works means I can get the data from the switch. It doesn't work means nothing data from the reply.
Please see the log below.
Waiting for Data...
No session found. Creating a new temporary session
Sending: <nc:hello xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">...</nc:hello> ]]>]]>
Received message from host
initialized: session-id=101 | server_capabilities=<dict_keyiterator object at 0x7f1070892950>
NETCONF CONNECTED 1.1.1.254:830
NETCONF SEND rpc
Requesting 'Dispatch'
Sending: #524 <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3b450594-0156-4372-a521-2b65aca2c757"><nc:get-config> <nc:source> <nc:running/> </nc:source> <nc:filter> <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native"> <interface> <twogigabitethernet> <name>TwoGigabitEthernet1/0/10</name> </twogigabitethernet> </interface> </native> </nc:filter> </nc:get-config> </nc:rpc> ##
Received message from host
<?xml version="1.0" ?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3b450594-0156-4372-a521-2b65aca2c757"> <data/> </rpc-reply>
NETCONF rpc COMPLETE
Requesting 'CloseSession'
Sending: #184 <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:1ae653a5-527b-4d54-8d74-3bb7e726311c"> <nc:close-session/> </nc:rpc> ##
Received message from host
NETCONF DISCONNECT
Received message from host
07-23-2021 09:46 AM
Hi Jacky
Based on the Netconf response, the interface with name TwoGigabitEthernet1/0/10 is not present in the router configuration. I suggest before trying to get specific interface, retrieve all the interfaces by sending RPC:
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:3b450594-0156-4372-a521-2b65aca2c757"><nc:get-config> <nc:source> <nc:running/> </nc:source> <nc:filter> <native xmlns="http://cisco.com/ns/yang/Cisco-IOS-XE-native"> <interface /> </native> </nc:filter> </nc:get-config> </nc:rpc>
If you still get empty data tag, then native model is not implemented or disabled on this router. You also might check Netconf capabilities to make sure that native model is supported.
BTW, what tool do you use to send RPCs. I guess it is not YDK.
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