cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
767
Views
1
Helpful
0
Replies

Cisco IOS-XR configure evpn evi bgp route-targets with netconf

davehouser1
Level 1
Level 1

System: (note this is a vXR image applied to a white box, not a 9K)

 

 

Cisco IOS XR Software, Version 7.4.16
Copyright (c) 2013-2021 by Cisco Systems, Inc.

Build Information:
Built By : ingunawa
Built On : Mon Nov 29 03:56:27 PST 2021
Built Host : iox-ucs-069
Workspace : /auto/srcarchive17/prod/7.4.16/iosxrwbd/ws
Version : 7.4.16
Location : /opt/cisco/XR/packages/
Label : 7.4.16

S9700-53DX-R8 () processor
System uptime is 3 weeks 35 minutes

 

 

I am trying to build evpn evi tunnel between two cisco ios xr systems. I want to automate this process with netconf + yang/rpc payloads.

Here is an example command I would run to create the evpn evi:

 

 

 

evpn evi 99 bgp
evpn evi 99 bgp route-target import 65001:99
evpn evi 99 bgp route-target export 65001:99
evpn evi 99 control-word-disable
evpn evi 99 advertise-mac

 

 

 

This works. After doing this I tried to pull the configuration with xml and this is what I get back 

 

 

 

# show run evpn | xml

 <data>
  <evpn xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-l2vpn-cfg">
   <enable></enable>
   <evpn-tables>
    <evpn-instances>
     <evpn-instance>
      <vpn-id>99</vpn-id>
      <encapsulation>evpn-encapsulation-mpls</encapsulation>
      <side>evpn-side-regular</side>
      <evpn-instance-bgp-auto-discovery>
       <enable></enable>
      </evpn-instance-bgp-auto-discovery>
      <evpn-evi-cw-disable></evpn-evi-cw-disable>
      <evpn-instance-advertise-mac>
       <enable></enable>
      </evpn-instance-advertise-mac>
     </evpn-instance>
    </evpn-instances>
   </evpn-tables>
  </evpn>
 </data>

 

 

 

Notice how there is no mention of the following

 

 

evpn evi 99 bgp route-target import 65001:99
evpn evi 99 bgp route-target export 65001:99

 

 

That seems odd, so I tried pulling the yang model with yangsuite. Same xml was returned. 
I then drilled done on the yang model for Cisco-IOS-XR-l2vpn-cfg, schema is 
/evpn/evpn-tables/evpn-instances/evpn-instance/evpn-instance-bgp-auto-discovery/evpn-route-targets and this is what I found. No mention of "import" or "export" for the route-targets. You can see a side by side of supported commands in the XR for a different evpn evi setting I configured. I did a `?` to see the options. `import` and `export` are listed, but nothing in the yang model?

 

badevpn.PNG

Look at the side by side of a different evi I built, There is no structure for export or import targets in the yang structure. 
I am using yang github pull for 7.4.2, I also checked the latest 7.8.1, same problem. 

Lastly I tried to force the commands with the following rpc

 

 

<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:feed0b70-4876-48a3-8f68-801665a7fc26"><nc:edit-config>
    <nc:target>
      <nc:candidate/>
    </nc:target>
    <nc:config>
      <evpn xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-l2vpn-cfg">
        <evpn-tables>
          <evpn-instances>
            <evpn-instance>
              <vpn-id>3823</vpn-id>
              <encapsulation>evpn-encapsulation-mpls</encapsulation>
              <side>evpn-side-regular</side>
              <evpn-instance-bgp-auto-discovery>
                <evpn-route-policy>
                  <export>65001:99</export>
                  <import>65001:99</import>
                </evpn-route-policy>
                <enable/>
              </evpn-instance-bgp-auto-discovery>
              <evpn-instance-advertise-mac>
                <enable/>
              </evpn-instance-advertise-mac>
              <evpn-evi-cw-disable/>
            </evpn-instance>
          </evpn-instances>
        </evpn-tables>
      </evpn>
    </nc:config>
  </nc:edit-config>
</nc:rpc>

 

 

Here are the errors I recieve back:

 

 

<rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2ae4da20-5a3e-4032-a918-485cd73d78f9">
 <rpc-error>
  <error-type>application</error-type>
  <error-tag>operation-failed</error-tag>
  <error-severity>error</error-severity>
  <error-path xmlns:ns1="http://cisco.com/ns/yang/Cisco-IOS-XR-l2vpn-cfg">ns1:evpn/ns1:evpn-tables/ns1:evpn-instances/ns1:evpn-instance[vpn-id = '99' and encapsulation = 'evpn-encapsulation-mpls' and side = 'evpn-side-regular']/ns1:evpn-instance-bgp-auto-discovery/ns1:evpn-route-policy/ns1:export</error-path>
  <error-message xml:lang="en">Could not find entry in list: Policy [65001:99] must be defined before it can be attached.</error-message>
 </rpc-error>
 <rpc-error>
  <error-type>application</error-type>
  <error-tag>operation-failed</error-tag>
  <error-severity>error</error-severity>
  <error-path xmlns:ns1="http://cisco.com/ns/yang/Cisco-IOS-XR-l2vpn-cfg">ns1:evpn/ns1:evpn-tables/ns1:evpn-instances/ns1:evpn-instance[vpn-id = '99' and encapsulation = 'evpn-encapsulation-mpls' and side = 'evpn-side-regular']/ns1:evpn-instance-bgp-auto-discovery/ns1:evpn-route-policy/ns1:import</error-path>
  <error-message xml:lang="en">Could not find entry in list: Policy [65001:99] must be defined before it can be attached.</error-message>
 </rpc-error>

 

 

Not sure what to make of these errors, however the problem still stands, why does the yang model not have `import` and `export` in the l2vpn object?

Is it possible to automate building `route-target import` and `route-target export` inside an evpn evi with netconf commands? If not, are there plans to support this in future releases? 

 

0 Replies 0