cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1672
Views
0
Helpful
3
Replies

BGP single prefix retrieval using netconf/yang

thanhuwng
Level 1
Level 1

Hi, I'm looking to get detail of a BGP prefix on IOS-XR router using netconf/yang similar to what the CLI "show bgp 1.1.1.1/32" achieves. So far I can't do that.

If I use the filter below

<bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-oper">

<instances>

  <instance>

   <instance-name>default</instance-name>

    <instance-active>

     <default-vrf>

      <afs>

       <af>

        <af-name>ipv4-unicast</af-name>

        <networks>

         <network>

          <network>1.1.1.1/32<network/>

         <network>

        </networks>

       </af>

      </afs>

     </default-vrf>

    </instance-active>

   </instance>

</instances>

</bgp>

I get back all BGP ipv4 prefixes without detail on them.

If I use the filter below

<bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-oper">

<instances>

  <instance>

   <instance-name>default</instance-name>

    <instance-active>

     <default-vrf>

      <afs>

       <af>

        <af-name>ipv4-unicast</af-name>

        <networks>

        </networks>

       </af>

      </afs>

     </default-vrf>

    </instance-active>

   </instance>

</instances>

</bgp>


I get all prefixes with detail of them.


Is there a way to retrieve detail of a single BGP prefix?


thanks

Hung

1 Accepted Solution

Accepted Solutions

saalvare
Cisco Employee
Cisco Employee

The network filter currently needs full key specification as shown below.  We have a ddts (CSCvf05647)  to support prefix filter with partial key in request.

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

  <get>

    <filter type="subtree">

      <bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-oper">

        <instances>

          <instance>

<instance-name>default</instance-name>

            <instance-active>

<default-vrf>

              <afs>

               <af>

<af-name>ipv4-unicast</af-name>

<networks>

<network>

<rd>0000000000000000</rd>

<network>192.168.28.5</network>

<prefix-length>32</prefix-length>

<af-name>ipv4</af-name>

<process-instance-id>0</process-instance-id>

</network>

</networks>

               </af>

</afs>

</default-vrf>

            </instance-active>

          </instance>

        </instances>

      </bgp>

    </filter>

  </get>

View solution in original post

3 Replies 3

abhirame
Cisco Employee
Cisco Employee

We have asked the responsible team about this and will get back to you shortly.

saalvare
Cisco Employee
Cisco Employee

The network filter currently needs full key specification as shown below.  We have a ddts (CSCvf05647)  to support prefix filter with partial key in request.

<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

  <get>

    <filter type="subtree">

      <bgp xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-bgp-oper">

        <instances>

          <instance>

<instance-name>default</instance-name>

            <instance-active>

<default-vrf>

              <afs>

               <af>

<af-name>ipv4-unicast</af-name>

<networks>

<network>

<rd>0000000000000000</rd>

<network>192.168.28.5</network>

<prefix-length>32</prefix-length>

<af-name>ipv4</af-name>

<process-instance-id>0</process-instance-id>

</network>

</networks>

               </af>

</afs>

</default-vrf>

            </instance-active>

          </instance>

        </instances>

      </bgp>

    </filter>

  </get>

Thanks Santiago. I couldn't get the full key spec filter to work, but understand there's a pending DDTS to make the partial key work so will wait until the fix is available.

thanks

Hung

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: