public icon indicating copy to clipboard operation
public copied to clipboard

Query regarding "export-route-target" and "import-route-target" in OC Yang

Open yongpro opened this issue 3 years ago • 1 comments

Hello,

I am testing OC Yang for some vendor devices. I tried to get config by OC Yang module from vendor devices. But I found cannot get "RT" information that should equal with "export-route-target" and "import-route-target" in network-instance, that is general requirement in L3VPN scenario, there may be two reasons for this:

  1. vendor not support "export-route-target" and "import-route-target" in OC Yang.
  2. "export-route-target" and "import-route-target" in OC Yang not fit L3VPN scenario.

For Q2, could you kindly help to check whether that is only for EVPN scenario but not L3VPN? Follow OC Yang docs:

export-route-target

description: Export Route Target (RT) in the network-instance on a PE. nodetype: leaf-list (rw) type: union type: oc-bgp-types:bgp-ext-community-type type: enumeration AUTO Enable auto route-target generation. When used for EVPN and if not configured, the RT is auto-derived with the format : where 'asn' is the autonomous-system configured in the network-instance default. Auto-derived route targets simplify the configuration of VLAN services for EVPN, especially in VLAN-aware bundle services where you can have multiple VLANs, multiple bridge domains and the VLANS for a given service are not present on all PE devices. /network-instances/network-instance/inter-instance-policies/import-export-policy/config/

Thanks Yong

yongpro avatar Oct 27 '21 03:10 yongpro

The import and export route target for the L3VPN scenario normally uses the leaf-references of:

  • "/network-instances/network-instance/inter-instance-policies/apply-policy/config/import-policy"
  • "/network-instances/network-instance/inter-instance-policies/apply-policy/config/export-policy"

So you can define, a 'routing-policy' with the community values that you want to import or export. And then referenced it in the L3VPN. This brings lot of flexibility but agree did not map the common way to do it in the routers. Recently, the new paths you mentioned were added but are not well supported by the vendors.

The sample rpcs for the routing-policy creation can be:

 <routing-policy xmlns="http://openconfig.net/yang/routing-policy">
          <defined-sets>
            <bgp-defined-sets xmlns="http://openconfig.net/yang/bgp-policy">
              <ext-community-sets>
                <ext-community-set>
                  <ext-community-set-name>{RT_COMMUNITY_SET}</ext-community-set-name>
                  <config>
                    <ext-community-set-name>{RT_COMMUNITY_SET}</ext-community-set-name>
                    <ext-community-member>{RT_VALUE}</ext-community-member>
                    <match-set-options>ANY</match-set-options>
                  </config>
                </ext-community-set>
              </ext-community-sets>
            </bgp-defined-sets>
          </defined-sets>
        </routing-policy>

and it application in the L3VPN:

<network-instances xmlns="http://openconfig.net/yang/network-instance">
          <network-instance>
            <name>{$NI_NAME}</name>
            <config>
              <name>{NI_NAME}</name>
              <type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
              <enabled>true</enabled>
              <description>{NI_DESC}</description>
              <router-id>{NI_ROUTERID}</router-id>
              <route-distinguisher>{NI_RD}</route-distinguisher>
              <enabled-address-families xmlns:oc-types="http://openconfig.net/yang/openconfig-types">{$NI_AF}</enabled-address-families>
            </config>
            <encapsulation>
              <config>
                <encapsulation-type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:MPLS</encapsulation-type>
                <label-allocation-mode xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:INSTANCE_LABEL</label-allocation-mode>
              </config>
            </encapsulation>
            <inter-instance-policies>
              <apply-policy>
                <config>
                  <import-policy>{RT_IMPORT_POLICY}</import-policy>
                  <export-policy>{RT_EXPORT_POLICY}</export-policy>
                </config>
              </apply-policy>
            </inter-instance-policies>
          </network-instance>
        </network-instances>

sbarguil avatar Nov 16 '21 19:11 sbarguil

This issue is stale because it has been open 180 days with no activity. If you wish to keep this issue active, please remove the stale label or add a comment, otherwise will be closed in 14 days.

github-actions[bot] avatar May 23 '24 02:05 github-actions[bot]