cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
680
Views
5
Helpful
2
Replies

Getting OSPF neighbors through NETCONF/YANG

aurelien.fasolo
Level 1
Level 1

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

  • With the OSPF-MIB model, no response is provided by the router (the request times out) :

 

<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>

 

  • With ietf-routing model, the response provided by the router is empty

 

<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

2 Replies 2

Marcel Zehnder
Spotlight
Spotlight

Hi. Well, it's vendor/os specific, but Cisco-IOS-XE-ospf-oper is working.

 

aurelien.fasolo
Level 1
Level 1

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.