02-27-2023 02:41 AM
Hi,
I am using a C8000v (17.9.1). In a nutshell, I have two VRF: one with OSPFv2 neighbors, one with OSPFv3 neighbors.
OSPF peering are confirmed with CLI outputs :
RT-20#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
0.0.0.51 0 FULL/ - 00:00:35 10.51.0.1 Tunnel2051
RT-20#show ospfv3 vrf * neighbor
OSPFv3 1 address-family ipv6 vrf UNDERLAY (router-id 0.0.0.20)
Neighbor ID Pri State Dead Time Interface ID Interface
0.0.0.51 1 FULL/DR 00:00:32 18 BDI3001
I am essentially trying to get the same information using NETCONF/YANG (if possible using non-native models). I have tried several models but none provided the expected result
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get>
<filter>
<OSPF-MIB xmlns="urn:ietf:params:xml:ns:yang:smiv2:OSPF-MIB">
<ospfNbrTable>
<ospfNbrEntry>
<ospfNbrIpAddr/>
<ospfNbrRtrId/>
<ospfNbrState/>
</ospfNbrEntry>
</ospfNbrTable>
</OSPF-MIB>
</filter>
</get>
</rpc>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="101">
<get>
<filter>
<routing-state xmlns="urn:ietf:params:xml:ns:yang:ietf-routing">
<routing-instance>
<routing-protocols>
<routing-protocol>
<ospf xmlns="urn:ietf:params:xml:ns:yang:ietf-ospf">
<instance>
<area>
<area-id/>
<interfaces>
<neighbor/>
</interfaces>
</area>
</instance>
</ospf>
</routing-protocol>
</routing-protocols>
</routing-instance>
</routing-state>
</filter>
</get>
</rpc>
<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:ad4c934b-9300-470b-989a-11182df7c1f3">
<data/>
</rpc-reply>
Can someone help me on this or provide some guidance?
Regards
02-27-2023 03:43 AM
Hi. Well, it's vendor/os specific, but Cisco-IOS-XE-ospf-oper is working.
02-28-2023 12:33 AM
Hi, thanks for this answer @Marcel Zehnder. I can indeed get the information this way. I would very much prefer using standard models though. I understand that native models are sometimes needed to represent specific features or implementations but OSPF neighborships should be accessible elsewhere. I just can't put the finger on it.
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