OcNOS DC : OpenConfig Command Reference : BGP OpenConfig Translation
BGP OpenConfig Translation
Create BGP Instance
This XML configuration snippet is used to initiate a BGP process with the associated autonomous system number and router ID.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload for configuring a BGP process within a network instance. It sets the BGP autonomous system number (AS) and specifies the router ID.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">
<identifier>oc-pol-types:BGP</identifier>
<name>100</name>
<config>
<identifier>oc-pol-types:BGP</identifier>
<name>100</name>
</config>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
</global>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to configure a BGP process with the AS number and set the BGP router ID.
router bgp 100
bgp router-id 1.2.3.4
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload used to configure a network instance with the name and type. It also configures a BGP instance with an AS number and sets the BGP router ID.
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>default</instance-name>
<instance-type>vrf</instance-type>
<config>
<instance-name>default</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>default</vrf-name>
</config>
</vrf>
</network-instance>
</network-instances>
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
<router-id>1.2.3.4</router-id>
</config>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response that provides information about the enabled state and identifiers, as well as details about the BGP global configuration, including the AS number and router ID.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<state>
<as>100</as>
</state>
<global>
<state>
<router-id>1.2.3.4</router-id>
</state>
</global>
</global>
</bgp>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</state>
</protocol>
</protocols>
</network-instance>
</network-instances>
Restrictions
Leaf /oc-netinst:network-instances/network-instance/protocols/protocol/name
For BGP instances this leaf must have the same number of the /network-instances/network-instance/protocols/protocol/bgp/global/config/as.
 
Delete on leaf /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config/as
 
On OpenConfig BGP datamodel the container global do not have any key to identify a single BGP instance, but the BGP AS information is placed under xpath /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config/as.
 
On IPI BGP datamodel the BGP AS information is a key for BGP container, and it does not allow the delete on xpath /ipi-bgp:/bgp/bgp-instances/bgp-instance/config/bgp-as to avoid delete its own instance key.
In this case, when translation framework detects a delete or remove operation on following OpenConfig xpaths:
1. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global
2. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config
3. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config/as
It will trigger an error message to NETCONF client and do not execute the delete operation.
To avoid this issue, when user needs to delete or remove a configuration under OpenConfig xpath /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config, user must add a "delete" or "remove" operation directly on the leaf or leaves desired to be removed, rather than delete the entire container.
Create BGP Global with default VRF
This XML configuration snippet is used to set up BGP Global configuration with default VRF data from the OpenConfig perspective.
Ensure that the AFI-SAFI container is present in the applied configuration to facilitate the configuration of address families.
Release
This configuration was introduced in OcNOS version 6.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to define BGP settings for the default network instance, including global BGP parameters, neighbor configurations, and address family tables.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<add-paths>
<config>
<receive>true</receive>
<send>true</send>
<send-max>2</send-max>
</config>
</add-paths>
<use-multiple-paths>
<ibgp>
<config>
<maximum-paths>7</maximum-paths>
</config>
</ibgp>
</use-multiple-paths>
</afi-safi>
</afi-safis>
<confederation>
<config>
<member-as>48</member-as>
<identifier>600</identifier>
</config>
</confederation>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<route-selection-options>
<config>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</config>
</route-selection-options>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</config>
</graceful-restart>
</global>
<neighbors>
<neighbor>
<neighbor-address>10.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>10.1.1.2</neighbor-address>
<peer-as>100</peer-as>
</config>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to configure BGP settings for a specified AS number on a networking device. They define critical attributes of the BGP process, including the router ID, confederation settings, best path selection criteria, graceful restart behavior, and neighbor configuration. Additionally, the commands enable support for IPv4 unicast address families and specify advanced options like additional path handling and maximum path selection for internal BGP peers. The neighbor statement establishes a BGP neighbor relationship with an adjacent router using the IP address and assigns it to a specified AS number.
router bgp 100
bgp router-id 1.2.3.4
bgp confederation identifier 600
bgp confederation peers 48
bgp bestpath as-path ignore
bgp bestpath aigp ignore
bgp bestpath compare-routerid
bgp graceful-restart restart-time 100
bgp graceful-restart stalepath-time 300
bgp graceful-restart graceful-reset
neighbor 10.1.1.2 remote-as 100
!
address-family ipv4 unicast
bgp additional-paths send-receive
bgp additional-paths select best 2
max-paths ibgp 7
neighbor 10.1.1.2 activate
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for configuring BGP settings on a network device. It defines a BGP instance with AS number and sets its router ID, graceful restart parameters, route selection options, and address family settings. Specifically, it configures BGP to operate with IPv4 unicast address families, allowing for the exchange of IPv4 unicast routing information. Additionally, the payload specifies additional path handling, maximum path selection for internal BGP peers, and establishes a BGP neighbor relationship with an adjacent router using the IP address.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
<router-id>1.2.3.4</router-id>
<ignore-aigp-for-bestpath />
</config>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-path-max-retention-time>300</stale-path-max-retention-time>
<graceful-reset />
</config>
</graceful-restart>
<route-selection>
<config>
<ignore-as-path-length />
<external-compare-router-id />
</config>
</route-selection>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<additional-paths-best-select-count>2</additional-paths-best-select-count>
<additional-paths-mode>receive send</additional-paths-mode>
</config>
<maximum-paths>
<config>
<ibgp-max-path>7</ibgp-max-path>
</config>
</maximum-paths>
</address-family>
</address-families>
<peers>
<peer>
<peer-address>10.1.1.2</peer-address>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
</config>
</address-family>
</address-families>
<config>
<confederation-identifier>600</confederation-identifier>
<peer-address>10.1.1.2</peer-address>
<peer-as>100</peer-as>
<peer-as-number>48</peer-as-number>
</config>
</peer>
</peers>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response indicates the successful validation of a network configuration specified in a NetConf payload. In this specific response, it verifies the correctness of the configuration for a specified network instance with associated protocols and interfaces. The validation ensures that the configuration adheres to the defined network instance types, policy types, and address families. All relevant elements, such as the BGP instance, its parameters, and the associated interfaces, are validated against the specified OpenConfig model.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
<add-paths>
<config>
<receive>true</receive>
<send>true</send>
<send-max>2</send-max>
</config>
<state>
<receive>true</receive>
<send>true</send>
<send-max>2</send-max>
</state>
</add-paths>
<use-multiple-paths>
<ibgp>
<config>
<maximum-paths>7</maximum-paths>
</config>
<state>
<maximum-paths>7</maximum-paths>
</state>
</ibgp>
</use-multiple-paths>
</afi-safi>
</afi-safis>
<confederation>
<config>
<member-as>48</member-as>
<identifier>600</identifier>
</config>
<state>
<member-as>48</member-as>
<identifier>600</identifier>
</state>
</confederation>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<route-selection-options>
<config>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</config>
<state>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</state>
</route-selection-options>
<state>
<as>100</as>
<router-id>1.2.3.4</router-id>
<total-prefixes>0</total-prefixes>
</state>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</config>
<state>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</state>
</graceful-restart>
</global>
<neighbors>
<neighbor>
<neighbor-address>10.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>10.1.1.2</neighbor-address>
<peer-as>100</peer-as>
</config>
<state>
<enabled>true</enabled>
<neighbor-address>10.1.1.2</neighbor-address>
<peer-as>100</peer-as>
</state>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
</tables>
<interfaces>
<interface>
<id>eth0</id>
<config>
<id>eth0</id>
<interface>eth0</interface>
</config>
</interface>
<interface>
<id>eth1</id>
<config>
<id>eth1</id>
<interface>eth1</interface>
</config>
</interface>
<interface>
<id>eth2</id>
<config>
<id>eth2</id>
<interface>eth2</interface>
</config>
</interface>
<interface>
<id>eth3</id>
<config>
<id>eth3</id>
<interface>eth3</interface>
</config>
</interface>
<interface>
<id>eth4</id>
<config>
<id>eth4</id>
<interface>eth4</interface>
</config>
</interface>
<interface>
<id>eth5</id>
<config>
<id>eth5</id>
<interface>eth5</interface>
</config>
</interface>
<interface>
<id>eth6</id>
<config>
<id>eth6</id>
<interface>eth6</interface>
</config>
</interface>
<interface>
<id>eth7</id>
<config>
<id>eth7</id>
<interface>eth7</interface>
</config>
</interface>
<interface>
<id>eth8</id>
<config>
<id>eth8</id>
<interface>eth8</interface>
</config>
</interface>
<interface>
<id>lo</id>
<config>
<id>lo</id>
<interface>lo</interface>
</config>
</interface>
</interfaces>
</network-instance>
</network-instances>
Restrictions
On the first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global paths are configured, those configuration need that respective AFI-SAFI configuration must be present to indicate AFI type:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/afi-safis
This information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global paths are configured on equipment, on the further configurations on those paths the user does not need to indicate the AFI-SAFI, the translation will look for this information on the equipment database.
For multiple paths configuration, the Open Config path /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/use-multiple-paths is not support, all the multiple paths configurations are done on Open Config path /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/use-multiple-paths.This is because the OcNOS datamodel only handle multiple paths is one place.
The containers graceful-restart and route-selection-options are configurable only by network-instance instance named “default”.
The Open Config attributes:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/graceful-restart/state/helper-only
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/route-selection-options/config/enable-aigp
Have their logic inverted, so a "false" value on open-config means a "true" value on OcNOS datamodel.
Create BGP Global with User-defined VRFs
This XML configuration snippet uses the payloads provided in this section to configure BGP Global with user-defined VRF data from the Open Config perspective.
The AFI-SAFI container must be available on the configuration applied to help configure address-families.
Release
This configuration was introduced in OcNOS version 6.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload used to configure network instances with BGP Global settings. This payload includes configuration for both the default network instance and a custom network instance named red.
In the default instance, BGP Global settings such as the AS number, router ID, route selection options, and graceful restart parameters are configured.
In the red network instance, in addition to the common BGP Global settings, specific AFI-SAFI settings are configured, including the number of maximum paths for both eBGP and iBGP. This example demonstrates how the payload can be adapted to configure different network instances with unique BGP configurations.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<route-selection-options>
<config>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</config>
</route-selection-options>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</config>
</graceful-restart>
</global>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>red</name>
<config>
<name>red</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>100:200</route-distinguisher>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<use-multiple-paths>
<ebgp>
<config>
<maximum-paths>10</maximum-paths>
</config>
</ebgp>
<ibgp>
<config>
<maximum-paths>15</maximum-paths>
</config>
</ibgp>
</use-multiple-paths>
</afi-safi>
</afi-safis>
<confederation>
<config>
<member-as>48</member-as>
<identifier>600</identifier>
</config>
</confederation>
</global>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to configure an IP VRF with a route distinguisher. In addition, the router BGP is configured with various BGP settings, including router ID, bestpath options, graceful restart parameters, and confederation settings. Inside the address-family IPv4 VRF context, the maximum paths for eBGP and iBGP are set. The BGP confederation is also configured with an identifier and peers.
ip vrf red
rd 100:200
!
router bgp 100
bgp router-id 1.2.3.4
bgp bestpath as-path ignore
bgp bestpath aigp ignore
bgp bestpath compare-routerid
bgp graceful-restart restart-time 100
bgp graceful-restart stalepath-time 300
bgp graceful-restart graceful-reset
!
address-family ipv4 vrf red
max-paths ebgp 10
max-paths ibgp 15
bgp confederation identifier 600
bgp confederation peers 48
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to configure a BGP instance with AS number, a router ID, and settings to ignore AIGP for bestpath selection. It also includes graceful restart parameters with a restart time and a stale path max retention time. Additionally, the payload configures route selection options to ignore AS path length and perform external comparisons based on router IDs. Inside the address-family VRF context for IPv4 unicast, it sets the confederation identifier and the peer AS number. Maximum path settings are configured for both eBGP and iBGP paths.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
<router-id>1.2.3.4</router-id>
<ignore-aigp-for-bestpath />
</config>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-path-max-retention-time>300</stale-path-max-retention-time>
<graceful-reset />
</config>
</graceful-restart>
<route-selection>
<config>
<ignore-as-path-length />
<external-compare-router-id />
</config>
</route-selection>
<address-family-vrfs>
<address-family-vrf>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>red</vrf-name>
<confederation>
<identifier>600</identifier>
<peer-as-number>48</peer-as-number>
</confederation>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>red</vrf-name>
</config>
<maximum-paths>
<config>
<ebgp-max-path>10</ebgp-max-path>
<ibgp-max-path>15</ibgp-max-path>
</config>
</maximum-paths>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response for configuring settings for the default network instance and a network instance. It also includes configurations for protocols, under network instances. Additionally, there are table configurations for IPv4 and IPv6 address families.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<route-selection-options>
<config>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</config>
<state>
<enable-aigp>false</enable-aigp>
<ignore-as-path-length>true</ignore-as-path-length>
<external-compare-router-id>true</external-compare-router-id>
</state>
</route-selection-options>
<state>
<as>100</as>
<router-id>1.2.3.4</router-id>
<total-prefixes>0</total-prefixes>
</state>
<graceful-restart>
<config>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</config>
<state>
<restart-time>100</restart-time>
<stale-routes-time>300.00</stale-routes-time>
<helper-only>false</helper-only>
</state>
</graceful-restart>
</global>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
<network-instance>
<name>red</name>
<config>
<name>red</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>100:200</route-distinguisher>
</config>
<state>
<name>red</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>100:200</route-distinguisher>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
<router-id>1.2.3.4</router-id>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
</state>
<use-multiple-paths>
<ebgp>
<config>
<maximum-paths>10</maximum-paths>
</config>
<state>
<maximum-paths>10</maximum-paths>
</state>
</ebgp>
<ibgp>
<config>
<maximum-paths>15</maximum-paths>
</config>
<state>
<maximum-paths>15</maximum-paths>
</state>
</ibgp>
</use-multiple-paths>
</afi-safi>
</afi-safis>
<confederation>
<config>
<member-as>48</member-as>
<identifier>600</identifier>
</config>
<state>
<member-as>48</member-as>
<identifier>600</identifier>
</state>
</confederation>
<state>
<as>100</as>
<router-id>1.2.3.4</router-id>
</state>
</global>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
</tables>
</network-instance>
</network-instances>
Restrictions
The /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/add-paths are available only on network-instance instance named “default”.
The container /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/graceful-restart are available only on network-instance instance named “default”.
The container /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/route-selection-options are available only on network-instance instance named “default”.
On the first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global paths are configured, those configuration needs the respective AFI-SAFI configuration that be present to indicate AFI type: /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/afi-safis
The above information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global paths are configured on equipment, on the further configurations on those paths the user does not need to indicate the AFI-SAFI, the translation will look for this information on the equipment database.
Create BGP Neighbors
This XML configuration snippet is used to configure neighbors in non-default VRF of BGP.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to configure network instances, specifically two instances: default and VRF1. It also configures BGP settings within these network instances, including neighbors and address families. Additionally, it configures tables for IPv4 and IPv6 address families within the network instances.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<bgp>
<global>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<as>123</as>
</config>
</global>
<neighbors>
<neighbor>
<neighbor-address>10.1.1.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<config>
<send-default-route>true</send-default-route>
</config>
<prefix-limit>
<config>
<max-prefixes>5</max-prefixes>
<warning-threshold-pct>60</warning-threshold-pct>
</config>
</prefix-limit>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<graceful-restart>
<config>
<enabled>true</enabled>
</config>
</graceful-restart>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<remove-private-as
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:PRIVATE_AS_REMOVE_ALL</remove-private-as>
<neighbor-address>10.1.1.1</neighbor-address>
<peer-as>100</peer-as>
<local-as>300</local-as>
</config>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<transport>
<config>
<local-address>eth1</local-address>
</config>
</transport>
<timers>
<config>
<keepalive-interval>30.00</keepalive-interval>
<hold-time>120.00</hold-time>
</config>
</timers>
<ebgp-multihop>
<config>
<multihop-ttl>5</multihop-ttl>
<enabled>true</enabled>
</config>
</ebgp-multihop>
</neighbor>
<neighbor>
<neighbor-address>11.1.1.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>7</max-prefixes>
<warning-threshold-pct>70</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
</ipv4-unicast>
<apply-policy>
<config>
<import-policy>rmap1</import-policy>
<export-policy>rmap1</export-policy>
</config>
</apply-policy>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<add-paths>
<config>
<receive>true</receive>
<send>true</send>
</config>
</add-paths>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>11.1.1.1</neighbor-address>
<peer-as>123</peer-as>
</config>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
<network-instance>
<name>VRF1</name>
<config>
<name>VRF1</name>
<type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>1.2.3.4:56</route-distinguisher>
</config>
<protocols>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<bgp>
<global>
<config>
<as>123</as>
</config>
</global>
<neighbors>
<neighbor>
<neighbor-address>20.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<apply-policy>
<config>
<import-policy>rmap2</import-policy>
<export-policy>rmap2</export-policy>
</config>
</apply-policy>
<ipv4-unicast>
<config>
<send-default-route>true</send-default-route>
</config>
</ipv4-unicast>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>20.1.1.2</neighbor-address>
<remove-private-as xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:PRIVATE_AS_REMOVE_ALL</remove-private-as>
<description>ebgp_VRF1</description>
<local-as>300</local-as>
<peer-as>200</peer-as>
</config>
</neighbor>
<neighbor>
<neighbor-address>21.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>5</max-prefixes>
<warning-threshold-pct>80</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<graceful-restart>
<config>
<enabled>true</enabled>
</config>
</graceful-restart>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>21.1.1.2</neighbor-address>
<peer-as>123</peer-as>
<enabled>true</enabled>
</config>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to configure a BGP setup with two address families: global ipv4 unicast and ipv4 vrf VRF1. It includes various neighbor configurations, prefix limits, route maps, and other BGP parameters to control BGP behavior in both the global and VRF contexts.
ip vrf VRF1
rd 100:200
exit
router bgp 123
neighbor 10.1.1.1 remote-as 100
neighbor 10.1.1.1 local-as 300
neighbor 10.1.1.1 fall-over bfd
neighbor 11.1.1.1 remote-as 123
neighbor 10.1.1.1 ebgp-multihop 5
neighbor 10.1.1.1 update-source eth1
neighbor 10.1.1.1 timers 30 120
!
address-family ipv4 unicast
neighbor 10.1.1.1 activate
neighbor 10.1.1.1 remove-private-AS
neighbor 10.1.1.1 maximum-prefix 5 60
neighbor 10.1.1.1 capability graceful-restart
neighbor 10.1.1.1 default-originate
neighbor 11.1.1.1 activate
neighbor 11.1.1.1 additional-paths send-receive
neighbor 11.1.1.1 maximum-prefix 7 70 warning-only
neighbor 11.1.1.1 route-map rmap1 in
neighbor 11.1.1.1 route-map rmap1 out
exit-address-family
!
address-family ipv4 vrf VRF1
neighbor 20.1.1.2 remote-as 200
neighbor 20.1.1.2 local-as 300
neighbor 20.1.1.2 activate
neighbor 20.1.1.2 remove-private-AS
neighbor 20.1.1.2 route-map rmap2 in
neighbor 20.1.1.2 route-map rmap2 out
neighbor 20.1.1.2 default-originate
neighbor 21.1.1.2 remote-as 123
neighbor 21.1.1.2 activate
neighbor 21.1.1.2 maximum-prefix 5 80 warning-only
neighbor 21.1.1.2 capability graceful-restart
neighbor 20.1.1.2 description ebgp_VRF1
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to configure BGP settings with VRF support and address-families in an OcNOS network device using the IPI YANG models. It defines BGP peering relationships, specify BGP attributes, and apply route maps within the context of both the global BGP instance and the VRF VRF1.
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>VRF1</instance-name>
<instance-type>vrf</instance-type>
<config>
<instance-name>VRF1</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>VRF1</vrf-name>
</config>
<bgp-vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp-vrf">
<config>
<rd-string>100:200</rd-string>
</config>
</bgp-vrf>
</vrf>
</network-instance>
</network-instances>
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>123</bgp-as>
<config>
<bgp-as>123</bgp-as>
</config>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
</config>
</address-family>
</address-families>
<peers>
<peer>
<peer-address>10.1.1.1</peer-address>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<maximum-prefixes>
<prefix-count>5</prefix-count>
<config>
<prefix-count>5</prefix-count>
<threshold-percentage>60</threshold-percentage>
</config>
</maximum-prefixes>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
<peer-remove-private-as />
<capability-graceful-restart />
<default-peer-route-map-name />
</config>
</address-family>
</address-families>
<config>
<peer-address>10.1.1.1</peer-address>
<peer-as>100</peer-as>
<enable-peer-bfd />
<peer-local-as>300</peer-local-as>
<source-identifier>eth1</source-identifier>
</config>
<timers>
<config>
<keep-alive>30</keep-alive>
<hold-time>120</hold-time>
</config>
</timers>
<ebgp-multihop>
<config>
<maximum-hop-count>5</maximum-hop-count>
<enabled />
</config>
</ebgp-multihop>
</peer>
<peer>
<peer-address>11.1.1.1</peer-address>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>7</prefix-count>
<config>
<prefix-count>7</prefix-count>
<threshold-percentage>70</threshold-percentage>
<warning-only />
</config>
</maximum-prefix>
</maximum-prefixes>
<route-map-filters>
<route-map-filter>
<route-map-direction>in</route-map-direction>
<config>
<route-map-direction>in</route-map-direction>
<route-map-name>rmap1</route-map-name>
</config>
</route-map-filter>
<route-map-filter>
<route-map-direction>out</route-map-direction>
<config>
<route-map-direction>out</route-map-direction>
<route-map-name>rmap1</route-map-name>
</config>
</route-map-filter>
</route-map-filters>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<additional-paths-mode>receive send</additional-paths-mode>
<activate />
</config>
</address-family>
</address-families>
<config>
<peer-address>11.1.1.1</peer-address>
<peer-as>123</peer-as>
</config>
</peer>
</peers>
<address-family-vrfs>
<address-family-vrf>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>VRF1</vrf-name>
<vrf-peers>
<vrf-peer>
<peer-address>20.1.1.2</peer-address>
<route-map-filters>
<route-map-filter>
<route-map-direction>in</route-map-direction>
<config>
<route-map-direction>in</route-map-direction>
<route-map-name>rmap2</route-map-name>
</config>
</route-map-filter>
<route-map-filter>
<route-map-direction>out</route-map-direction>
<config>
<route-map-direction>out</route-map-direction>
<route-map-name>rmap2</route-map-name>
</config>
</route-map-filter>
</route-map-filters>
<config>
<peer-address>20.1.1.2</peer-address>
<peer-as>200</peer-as>
<peer-local-as>300</peer-local-as>
<activate />
<peer-remove-private-as />
<default-peer-route-map-name />
</config>
</vrf-peer>
<vrf-peer>
<peer-address>21.1.1.2</peer-address>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>5</prefix-count>
<config>
<prefix-count>5</prefix-count>
<threshold-percentage>80</threshold-percentage>
<warning-only />
</config>
</maximum-prefix>
</maximum-prefixes>
<config>
<peer-address>21.1.1.2</peer-address>
<peer-as>123</peer-as>
<activate />
<capability-graceful-restart />
</config>
</vrf-peer>
</vrf-peers>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>VRF1</vrf-name>
</config>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response to configure payload for BGP settings in a network instance, including global BGP settings and BGP neighbors.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<bgp>
<global>
<config>
<as>123</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<neighbors>
<neighbor>
<neighbor-address>10.1.1.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<config>
<send-default-route>true</send-default-route>
</config>
<prefix-limit>
<config>
<max-prefixes>5</max-prefixes>
<warning-threshold-pct>60</warning-threshold-pct>
</config>
</prefix-limit>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<graceful-restart>
<config>
<enabled>true</enabled>
</config>
</graceful-restart>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>10.1.1.1</neighbor-address>
<peer-as>100</peer-as>
<local-as>300</local-as>
<remove-private-as
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:PRIVATE_AS_REMOVE_ALL</remove-private-as>
</config>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<ebgp-multihop>
<config>
<enabled>true</enabled>
<multihop-ttl>5</multihop-ttl>
</config>
</ebgp-multihop>
<transport>
<config>
<local-address>eth1</local-address>
</config>
</transport>
<timers>
<config>
<keepalive-interval>30.00</keepalive-interval>
<hold-time>120.00</hold-time>
</config>
</timers>
</neighbor>
<neighbor>
<neighbor-address>11.1.1.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>7</max-prefixes>
<warning-threshold-pct>70</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
</ipv4-unicast>
<apply-policy>
<config>
<import-policy>rmap1</import-policy>
<export-policy>rmap1</export-policy>
</config>
</apply-policy>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<add-paths>
<config>
<receive>true</receive>
<send>true</send>
</config>
</add-paths>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>11.1.1.1</neighbor-address>
<peer-as>123</peer-as>
</config>
</neighbor>
</neighbors>
</bgp>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>management</name>
</network-instance>
<network-instance>
<name>VRF1</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>123</name>
<bgp>
<global>
<config>
<as>123</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<neighbors>
<neighbor>
<neighbor-address>20.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<apply-policy>
<config>
<import-policy>rmap2</import-policy>
<export-policy>rmap2</export-policy>
</config>
</apply-policy>
<ipv4-unicast>
<config>
<send-default-route>true</send-default-route>
</config>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<apply-policy>
<config>
<import-policy>rmap2</import-policy>
<export-policy>rmap2</export-policy>
</config>
</apply-policy>
<config>
<neighbor-address>20.1.1.2</neighbor-address>
<peer-as>200</peer-as>
<local-as>300</local-as>
<enabled>true</enabled>
<remove-private-as
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:PRIVATE_AS_REMOVE_ALL</remove-private-as>
</config>
</neighbor>
<neighbor>
<neighbor-address>21.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>5</max-prefixes>
<warning-threshold-pct>80</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<graceful-restart>
<config>
<enabled>true</enabled>
</config>
</graceful-restart>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>21.1.1.2</neighbor-address>
<peer-as>123</peer-as>
<enabled>true</enabled>
</config>
</neighbor>
</neighbors>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
Restrictions
The leaf /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/remove-private-as must have the OpenConfig value PRIVATE_AS_REMOVE_ALL
The below leaf was not supported by the current implementation, but this feature is supported at the AFI-SAFI level of each neighbor.
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/apply-policy
The below leaf was not supported by the current implementation at the neighbor level, but this feature is supported at the AFI-SAFI level of each neighbor, as well as at the global level (/network-instances/network-instance/protocols/protocol/bgp/global/graceful-restart).
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/graceful-restart
The below leaf was not supported by the current implementation at the neighbor level, but this feature is supported at the global level (/network-instances/network-instance/protocols/protocol/bgp/global/afi-safis/afi-safi/use-multiple-paths).
/network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/use-multiple-paths
The below leaf is limited to 32 characters and must have the format <interface>.<subinterface>, e.g., eth2.10.
/network-instances/network-instance/interfaces/interface/config/id
On the first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbor paths are configured, those configuration needs the respective AFI-SAFI configuration that be present to indicate AFI type:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis
The above information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ip.i-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured on equipment, on the further configurations on those paths the user does not need to indicate the AFI-SAFI, the translation will look for this information on the equipment database.
Configure eBGP Neighbor with TTL
This XML configuration snippet defines the eBGP neighbor with a Time-to-Live (TTL) value.
Release
This configuration was introduced in OcNOS version 4.2.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload that defines a network instance named VRF1 with various configurations, including the route distinguisher, protocols, and tables. Specifically, it sets up BGP protocol with a global AS number and a neighbor with an AS number. The eBGP-multihop feature is enabled for this neighbor with a TTL value.
Additionally, the payload defines three tables, one for directly connected IPv4 routes, one for directly connected IPv6 routes, and one for BGP IPv4 routes.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>VRF1</name>
<config>
<name>VRF1</name>
<type xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>1.2.3.4:56</route-distinguisher>
</config>
<protocols>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
</global>
<neighbors>
<neighbor>
<neighbor-address>1.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>1.1.1.2</neighbor-address>
<peer-as>200</peer-as>
</config>
<ebgp-multihop>
<config>
<enabled>true</enabled>
<multihop-ttl>20</multihop-ttl>
</config>
</ebgp-multihop>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
<table>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
</network-instances>
 
OcNOS CLI Command
The below CLI commands are used to configure a BGP neighbor relationship in the VRF1, allowing the BGP router with AS number 100 to communicate with a neighbor at IP address 1.1.1.2, which has AS number 200, and the configuration ensures that the session can be established even if the TTL is set to a higher value, in this case, 20.
router bgp 100
!
address-family ipv4 vrf VRF1
neighbor 1.1.1.2 remote-as 200
neighbor 1.1.1.2 activate
neighbor 1.1.1.2 ebgp-multihop 20
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload that defines a VRF instance named VRF1 with the associated BGP settings. The VRF is set to use IPv4 unicast address-family. Within this VRF, a BGP peering session is established with a remote neighbor having the IP address 1.1.1.2 and AS number 200. To ensure the BGP session can be established, the ebgp-multihop feature is enabled with a maximum hop count of 20, allowing the BGP router to communicate with a neighbor that might be multiple hops away. The BGP configuration also specifies a route distinguisher (RD) of 1.2.3.4:56 for the VRF. This configuration is essential for routing and forwarding traffic within the VRF while maintaining isolation from other VRFs or the global routing table.
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>VRF1</instance-name>
<instance-type>vrf</instance-type>
<config>
<instance-name>VRF1</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>VRF1</vrf-name>
</config>
<bgp-vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp-vrf">
<config>
<rd-string>1.2.3.4:56</rd-string>
</config>
</bgp-vrf>
</vrf>
</network-instance>
</network-instances>
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
</config>
<address-family-vrfs>
<address-family-vrf>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>VRF1</vrf-name>
<vrf-peers>
<vrf-peer>
<peer-address>1.1.1.2</peer-address>
<config>
<peer-address>1.1.1.2</peer-address>
<peer-as>200</peer-as>
</config>
<ebgp-multihop>
<config>
<maximum-hop-count>20</maximum-hop-count>
</enabled>
</config>
</ebgp-multihop>
</vrf-peer>
</vrf-peers>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>VRF1</vrf-name>
</config>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response for the network instance VRF1 and its associated BGP settings indicates that the provided configuration is compliant with the expected structure and format defined in the YANG data model for network instances and BGP protocols. This validation response affirms that there are no errors or inconsistencies in the configuration, affirming its readiness for application to the network device. It verifies that the specified parameters, such as route distinguisher, autonomous system numbers, and address families, are correctly defined and align with the defined standards, ensuring smooth and accurate operation within the network infrastructure.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>VRF1</name>
<config>
<name>VRF1</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>1.2.3.4:56</route-distinguisher>
</config>
<state>
<name>VRF1</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>1.2.3.4:56</route-distinguisher>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<state>
<as>100</as>
</state>
</global>
<neighbors>
<neighbor>
<neighbor-address>1.1.1.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>1.1.1.2</neighbor-address>
<peer-as>200</peer-as>
<enabled>true</enabled>
</config>
<ebgp-multihop>
<config>
<enabled>true</enabled>
<multihop-ttl>20</multihop-ttl>
</config>
<state>
<enabled>true</enabled>
<multihop-ttl>20</multihop-ttl>
</state>
</ebgp-multihop>
<state>
<neighbor-address>1.1.1.2</neighbor-address>
<peer-as>200</peer-as>
<enabled>true</enabled>
</state>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
</tables>
</network-instance>
</network-instances>
Restrictions
The leaf /network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/config/peer-type is not supported.
On the first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbor paths are configured, those configuration needs the respective AFI-SAFI configuration that be present to indicate AFI type /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis
The above information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured on equipment, on the further config urations on those paths the user does not need to indicate the AFI-SAFI, the translation will look for this information on the equipment database.
Create BGP Peer-groups with Default VRF
This XML configuration snippet is used to specify that BGP peer-groups should be created within the default VRF. Peer groups are configurations that can be used elsewhere without the need to repeat them.
Release
This configuration was introduced in OcNOS version 5.1.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to configure BGP settings within the default network instance. It defines various BGP parameters and peer groups for the specified AFI-SAFI combinations, including IPv4 unicast, IPv4 labeled unicast, IPv6 labeled unicast, and L3VPN IPv6 unicast. This configuration includes authentication passwords, timers, route reflector settings, and more for different peer groups such as ABC, peer1, and peer2.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<route-selection-options>
<config>
<enable-aigp>true</enable-aigp>
</config>
<state>
<enable-aigp>true</enable-aigp>
</state>
</route-selection-options>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<peer-groups>
<peer-group>
<peer-group-name>ABC</peer-group-name>
<config>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>ABC</peer-group-name>
<peer-as>100</peer-as>
<description>Non VRF peer-group configs</description>
</config>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<timers>
<config>
<connect-retry>300.00</connect-retry>
<minimum-advertisement-interval>20.00</minimum-advertisement-interval>
<keepalive-interval>300.00</keepalive-interval>
<hold-time>8200.00</hold-time>
</config>
</timers>
<transport>
<config>
<local-address>10.1.1.1</local-address>
<passive-mode>true</passive-mode>
</config>
</transport>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>4294967295</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<apply-policy>
<config>
<import-policy>in-map</import-policy>
<export-policy>out-map</export-policy>
</config>
</apply-policy>
</afi-safi>
</afi-safis>
<route-reflector>
<config>
<route-reflector-client>true</route-reflector-client>
</config>
</route-reflector>
</peer-group>
<peer-group>
<peer-group-name>peer1</peer-group-name>
<config>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peer1</peer-group-name>
<peer-as>200</peer-as>
</config>
<ebgp-multihop>
<config>
<enabled>true</enabled>
</config>
</ebgp-multihop>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</peer-group>
<peer-group>
<peer-group-name>peer2</peer-group-name>
<config>
<auth-password>0x9603e78694ace534e74f24019f5bfeb5</auth-password>
<peer-group-name>peer2</peer-group-name>
<peer-as>300</peer-as>
</config>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<ebgp-multihop>
<config>
<multihop-ttl>10</multihop-ttl>
<enabled>true</enabled>
</config>
</ebgp-multihop>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<ipv6-labeled-unicast>
<prefix-limit>
<config>
<max-prefixes>1</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
</ipv6-labeled-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<l3vpn-ipv6-unicast>
<prefix-limit>
<config>
<max-prefixes>12345</max-prefixes>
</config>
</prefix-limit>
</l3vpn-ipv6-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands configure various BGP parameters and policies for different neighbors and address families within AS number 100.
!
router bgp 100
neighbor ABC peer-group
neighbor ABC remote-as 100
neighbor ABC fall-over bfd multihop
neighbor peer1 peer-group
neighbor peer1 remote-as 200
neighbor peer2 peer-group
neighbor peer2 remote-as 300
neighbor peer2 fall-over bfd
neighbor ABC description Non VRF peer-group configs
neighbor ABC passive
neighbor ABC update-source 10.1.1.1
neighbor ABC authentication-key 0x9603e78694ace534ea912b9ab53f8a55
neighbor ABC advertisement-interval 20
neighbor ABC timers 300 8200
neighbor ABC timers connect 300
neighbor peer1 ebgp-multihop
neighbor peer1 authentication-key 0x9a20ef22549ad84b
neighbor peer2 ebgp-multihop 10
neighbor peer2 authentication-key 0x9603e78694ace534e74f24019f5bfeb5
!
address-family ipv4 unicast
neighbor ABC activate
neighbor ABC route-reflector-client
neighbor ABC default-originate
neighbor ABC maximum-prefix 4294967295 100 warning-only
neighbor ABC route-map in-map in
neighbor ABC route-map out-map out
exit-address-family
!
address-family ipv4 labeled-unicast
neighbor peer1 activate
exit-address-family
!
address-family vpnv6 unicast
neighbor peer2 allow-ebgp-vpn
neighbor peer2 activate
neighbor peer2 maximum-prefix 12345
exit-address-family
!
address-family ipv6 labeled-unicast
neighbor peer2 activate
neighbor peer2 maximum-prefix 1 warning-only
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to set up BGP peering and routing policies within the given AS number (100) and defines parameters for various address families and peer groups.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
</config>
<state>
<bgp-as>100</bgp-as>
<version>4</version>
<table-version>1</table-version>
<total-prefixes>0</total-prefixes>
<router-run-time-ip-address>0.0.0.0</router-run-time-ip-address>
<scan-remain-time>49</scan-remain-time>
</state>
<rib>
<address-family>
<safi>link-state</safi>
<afi>link-state</afi>
<state>
<safi>link-state</safi>
<afi>link-state</afi>
</state>
</address-family>
</rib>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
</config>
<state>
<afi>ipv4</afi>
<safi>unicast</safi>
</state>
</address-family>
<address-family>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
<config>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
</config>
<state>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
</state>
</address-family>
<address-family>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
<config>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
</config>
<state>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
</state>
</address-family>
<address-family>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
<config>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
</config>
<state>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
</state>
</address-family>
</address-families>
<peer-groups>
<peer-group>
<peer-group-tag>ABC</peer-group-tag>
<bgp-passwords>
<bgp-password>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<config>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<auth-key-encrypt>1</auth-key-encrypt>
</config>
<state>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<auth-key-encrypt>1</auth-key-encrypt>
</state>
</bgp-password>
</bgp-passwords>
<config>
<peer-group-tag>ABC</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>100</peer-as>
<enable-peer-bfd />
<enable-peer-bfd-multihop />
<peer-description>Non VRF peer-group configs</peer-description>
<peer-connect-interval>300</peer-connect-interval>
<min-route-advertisement-interval>20</min-route-advertisement-interval>
<source-identifier>10.1.1.1</source-identifier>
<neighbor-passive />
</config>
<state>
<peer-group-tag>ABC</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>100</peer-as>
<enable-peer-bfd />
<enable-peer-bfd-multihop />
<peer-description>Non VRF peer-group configs</peer-description>
<peer-connect-interval>300</peer-connect-interval>
<min-route-advertisement-interval>20</min-route-advertisement-interval>
<source-identifier>10.1.1.1</source-identifier>
<neighbor-passive />
</state>
<timers>
<config>
<keep-alive>300</keep-alive>
<hold-time>8200</hold-time>
</config>
<state>
<keep-alive>300</keep-alive>
<hold-time>8200</hold-time>
</state>
</timers>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>4294967295</prefix-count>
<config>
<prefix-count>4294967295</prefix-count>
<threshold-percentage>100</threshold-percentage>
<warning-only />
</config>
<state>
<prefix-count>4294967295</prefix-count>
<threshold-percentage>100</threshold-percentage>
<warning-only />
</state>
</maximum-prefix>
</maximum-prefixes>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
<default-peer-route-map-name />
<peer-route-reflector />
</config>
<state>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
<default-peer-route-map-name />
<peer-route-reflector />
</state>
<route-map-filters>
<route-map-filter>
<route-map-direction>in</route-map-direction>
<config>
<route-map-direction>in</route-map-direction>
<route-map-name>in-map</route-map-name>
</config>
<state>
<route-map-direction>in</route-map-direction>
<route-map-name>in-map</route-map-name>
</state>
</route-map-filter>
<route-map-filter>
<route-map-direction>out</route-map-direction>
<config>
<route-map-direction>out</route-map-direction>
<route-map-name>out-map</route-map-name>
</config>
<state>
<route-map-direction>out</route-map-direction>
<route-map-name>out-map</route-map-name>
</state>
</route-map-filter>
</route-map-filters>
</address-family>
</address-families>
</peer-group>
<peer-group>
<peer-group-tag>peer1</peer-group-tag>
<bgp-passwords>
<bgp-password>
<password>0x9a20ef22549ad84b</password>
<config>
<password>0x9a20ef22549ad84b</password>
<auth-key-encrypt>1</auth-key-encrypt>
</config>
<state>
<password>0x9a20ef22549ad84b</password>
<auth-key-encrypt>1</auth-key-encrypt>
</state>
</bgp-password>
</bgp-passwords>
<config>
<peer-group-tag>peer1</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>200</peer-as>
</config>
<state>
<peer-group-tag>peer1</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>200</peer-as>
</state>
<ebgp-multihop>
<config>
<enabled />
</config>
<state>
<enabled />
</state>
</ebgp-multihop>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
<config>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
<activate />
</config>
<state>
<afi>ipv4</afi>
<safi>labeled-unicast</safi>
<activate />
</state>
</address-family>
</address-families>
</peer-group>
<peer-group>
<peer-group-tag>peer2</peer-group-tag>
<bgp-passwords>
<bgp-password>
<password>0x9603e78694ace534e74f24019f5bfeb5</password>
<config>
<password>0x9603e78694ace534e74f24019f5bfeb5</password>
<auth-key-encrypt>1</auth-key-encrypt>
</config>
<state>
<password>0x9603e78694ace534e74f24019f5bfeb5</password>
<auth-key-encrypt>1</auth-key-encrypt>
</state>
</bgp-password>
</bgp-passwords>
<config>
<peer-group-tag>peer2</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>300</peer-as>
<enable-peer-bfd />
</config>
<state>
<peer-group-tag>peer2</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>300</peer-as>
<enable-peer-bfd />
</state>
<ebgp-multihop>
<config>
<maximum-hop-count>10</maximum-hop-count>
<enabled />
</config>
<state>
<maximum-hop-count>10</maximum-hop-count>
<enabled />
</state>
</ebgp-multihop>
<address-families>
<address-family>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>1</prefix-count>
<config>
<prefix-count>1</prefix-count>
<maximum-prefix-warning />
</config>
<state>
<prefix-count>1</prefix-count>
<maximum-prefix-warning />
</state>
</maximum-prefix>
</maximum-prefixes>
<config>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
<activate />
</config>
<state>
<afi>ipv6</afi>
<safi>labeled-unicast</safi>
<activate />
</state>
</address-family>
<address-family>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>12345</prefix-count>
<config>
<prefix-count>12345</prefix-count>
</config>
<state>
<prefix-count>12345</prefix-count>
</state>
</maximum-prefix>
</maximum-prefixes>
<config>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
<activate />
<peer-allow-ebgp-vpn />
</config>
<state>
<afi>ipv6</afi>
<safi>vpn-unicast</safi>
<activate />
<peer-allow-ebgp-vpn />
</state>
</address-family>
</address-families>
</peer-group>
</peer-groups>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response that defines several aspects of BGP, including global BGP configuration, peer groups, and AFI-SAFIs for different address families. The configuration also includes authentication settings, timers, transport settings, and route reflection.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<route-selection-options>
<config>
<enable-aigp>true</enable-aigp>
</config>
<state>
<enable-aigp>true</enable-aigp>
</state>
</route-selection-options>
<state>
<as>100</as>
<total-prefixes>0</total-prefixes>
</state>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<peer-groups>
<peer-group>
<peer-group-name>ABC</peer-group-name>
<config>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>ABC</peer-group-name>
<peer-as>100</peer-as>
<description>Non VRF peer-group configs</description>
</config>
<state>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>ABC</peer-group-name>
<peer-as>100</peer-as>
<description>Non VRF peer-group configs</description>
</state>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
</state>
</enable-bfd>
<timers>
<config>
<connect-retry>300.00</connect-retry>
<minimum-advertisement-interval>20.00</minimum-advertisement-interval>
<keepalive-interval>300.00</keepalive-interval>
<hold-time>8200.00</hold-time>
</config>
<state>
<connect-retry>300.00</connect-retry>
<minimum-advertisement-interval>20.00</minimum-advertisement-interval>
<keepalive-interval>300.00</keepalive-interval>
<hold-time>8200.00</hold-time>
</state>
</timers>
<transport>
<config>
<local-address>10.1.1.1</local-address>
<passive-mode>true</passive-mode>
</config>
<state>
<local-address>10.1.1.1</local-address>
<passive-mode>true</passive-mode>
</state>
</transport>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>4294967295</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
<state>
<max-prefixes>4294967295</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</state>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
<state>
<send-default-route>true</send-default-route>
</state>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
<apply-policy>
<config>
<import-policy>in-map</import-policy>
<export-policy>out-map</export-policy>
</config>
<state>
<import-policy>in-map</import-policy>
<export-policy>out-map</export-policy>
</state>
</apply-policy>
</afi-safi>
</afi-safis>
<route-reflector>
<config>
<route-reflector-client>true</route-reflector-client>
</config>
<state>
<route-reflector-client>true</route-reflector-client>
</state>
</route-reflector>
</peer-group>
<peer-group>
<peer-group-name>peer1</peer-group-name>
<config>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peer1</peer-group-name>
<peer-as>200</peer-as>
</config>
<state>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peer1</peer-group-name>
<peer-as>200</peer-as>
</state>
<ebgp-multihop>
<config>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
</state>
</ebgp-multihop>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
</peer-group>
<peer-group>
<peer-group-name>peer2</peer-group-name>
<config>
<auth-password>0x9603e78694ace534e74f24019f5bfeb5</auth-password>
<peer-group-name>peer2</peer-group-name>
<peer-as>300</peer-as>
</config>
<state>
<auth-password>0x9603e78694ace534e74f24019f5bfeb5</auth-password>
<peer-group-name>peer2</peer-group-name>
<peer-as>300</peer-as>
</state>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
</state>
</enable-bfd>
<ebgp-multihop>
<config>
<multihop-ttl>10</multihop-ttl>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<multihop-ttl>10</multihop-ttl>
</state>
</ebgp-multihop>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<ipv6-labeled-unicast>
<prefix-limit>
<config>
<max-prefixes>1</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</config>
<state>
<max-prefixes>1</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</state>
</prefix-limit>
</ipv6-labeled-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_LABELED_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<l3vpn-ipv6-unicast>
<prefix-limit>
<config>
<max-prefixes>12345</max-prefixes>
</config>
<state>
<max-prefixes>12345</max-prefixes>
</state>
</prefix-limit>
</l3vpn-ipv6-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:L3VPN_IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
Restrictions
The first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured, those configuration needs the respective AFI-SAFI configuration that is present to indicate AFI type:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis
The above information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured on equipment, on the further configurations on those paths the user does not need to indicate the AFI-SAFI, the translation will look for this information on the equipment database.
Create BGP Peer-groups with User-defined VRFs
This XML configuration snippet is used to configure BGP Peer-groups with user-defined VRFs. Peer groups are configurations that can be used elsewhere without the need to repeat them.
Release
This configuration was introduced in OcNOS version 5.1.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload that provides a structured representation of the settings for various BGP configurations, such as Autonomous System (AS) numbers, Address Family Identifier and Subsequent Address Family Identifier (AFI-SAFI) settings, authentication, timers, and more.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<route-selection-options>
<config>
<enable-aigp>true</enable-aigp>
</config>
<state>
<enable-aigp>true</enable-aigp>
</state>
</route-selection-options>
</global>
</bgp>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>management</name>
</network-instance>
<network-instance>
<name>vrfA</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<peer-groups>
<peer-group>
<peer-group-name>peerA</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>2331</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>peerA</peer-group-name>
<peer-as>100</peer-as>
<description>VRFA peer-group configs</description>
</config>
<transport>
<config>
<local-address>2.2.2.2</local-address>
<passive-mode>true</passive-mode>
</config>
</transport>
<timers>
<config>
<connect-retry>900.00</connect-retry>
<minimum-advertisement-interval>65535.00</minimum-advertisement-interval>
<keepalive-interval>100.00</keepalive-interval>
<hold-time>300.00</hold-time>
</config>
</timers>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<route-reflector>
<config>
<route-reflector-client>true</route-reflector-client>
</config>
</route-reflector>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>vrfB</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
</global>
<peer-groups>
<peer-group>
<peer-group-name>peerB</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<ipv6-unicast>
<prefix-limit>
<config>
<max-prefixes>3123</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</config>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
</ipv6-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peerB</peer-group-name>
<peer-as>200</peer-as>
<local-as>300</local-as>
<description>VRFB peer-group configs</description>
</config>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
</enable-bfd>
<ebgp-multihop>
<config>
<multihop-ttl>100</multihop-ttl>
<enabled>true</enabled>
</config>
</ebgp-multihop>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to setup the VRF instances and BGP settings within a network infrastructure. VRFs allow for the segmentation of the network, enabling the isolation of routing domains. In this configuration, two VRFs, named vrfA and vrfB, are defined with unique Route Distinguisher (RD) values, indicating their separation.
Within the BGP configuration, specific address families for IPv4 and IPv6 are defined, each associated with a corresponding VRF. Peer-groups, neighbors, authentication keys, timers, and various other BGP parameters are configured to facilitate routing and peering relationships in the network.
!
ip vrf vrfA
rd 1:1
!
ip vrf vrfB
rd 1:2
!
!
router bgp 100
!
address-family ipv4 vrf vrfA
neighbor peerA peer-group
neighbor peerA remote-as 100
neighbor peerA fall-over bfd
neighbor peerA activate
neighbor peerA authentication-key 0x9603e78694ace534ea912b9ab53f8a55
neighbor peerA route-reflector-client
neighbor peerA default-originate
neighbor peerA maximum-prefix 2331 100 warning-only
neighbor peerA description VRFA peer-group configs
neighbor peerA passive
neighbor peerA update-source 2.2.2.2
neighbor peerA advertisement-interval 65535
neighbor peerA timers 100 300
neighbor peerA timers connect 900
exit-address-family
!
address-family ipv6 vrf vrfB
neighbor peerB peer-group
neighbor peerB remote-as 200
neighbor peerB local-as 300
neighbor peerB fall-over bfd multihop
neighbor peerB activate
neighbor peerB authentication-key 0x9a20ef22549ad84b
neighbor peerB default-originate
neighbor peerB maximum-prefix 3123 warning-only
neighbor peerB description VRFB peer-group configs
neighbor peerB ebgp-multihop 100
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload that illustrates a comprehensive BGP configuration. The configuration is divided into specific sections, each addressing different aspects of BGP operation, security, and peering.
Within this payload, two distinct AFI and SAFI contexts are defined for IPv4 and IPv6 in separate VRF instances named vrfA and vrfB. Each VRF is associated with specific BGP peer groups, peers, and a range of configurations that dictate the behavior of BGP in these contexts.
The configuration also includes authentication keys, prefix limits, timers, route reflection settings, BFD configuration, and other essential parameters that ensure the proper functioning of BGP in the specified VRFs.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
</config>
<state>
<bgp-as>100</bgp-as>
<version>4</version>
<table-version>1</table-version>
<total-prefixes>0</total-prefixes>
<router-run-time-ip-address>0.0.0.0</router-run-time-ip-address>
<scan-remain-time>36</scan-remain-time>
</state>
<rib>
<address-family>
<safi>link-state</safi>
<afi>link-state</afi>
<state>
<safi>link-state</safi>
<afi>link-state</afi>
</state>
</address-family>
</rib>
<address-family-vrfs>
<address-family-vrf>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>vrfA</vrf-name>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>vrfA</vrf-name>
</config>
<state>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>vrfA</vrf-name>
</state>
<peer-groups>
<peer-group>
<peer-group-tag>peerA</peer-group-tag>
<bgp-passwords>
<bgp-password>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<config>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<auth-key-encrypt>1</auth-key-encrypt>
</config>
<state>
<password>0x9603e78694ace534ea912b9ab53f8a55</password>
<auth-key-encrypt>1</auth-key-encrypt>
</state>
</bgp-password>
</bgp-passwords>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>2331</prefix-count>
<config>
<prefix-count>2331</prefix-count>
<threshold-percentage>100</threshold-percentage>
<warning-only />
</config>
<state>
<prefix-count>2331</prefix-count>
<threshold-percentage>100</threshold-percentage>
<warning-only />
</state>
</maximum-prefix>
</maximum-prefixes>
<config>
<peer-group-tag>peerA</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>100</peer-as>
<source-identifier>2.2.2.2</source-identifier>
<peer-connection-interval>900</peer-connection-interval>
<neighbor-passive />
<min-route-advertisement-interval>65535</min-route-advertisement-interval>
<peer-description>VRFA peer-group configs</peer-description>
<enable-peer-bfd />
<activate />
<default-peer-route-map-name />
<peer-route-reflector />
</config>
<state>
<peer-group-tag>peerA</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>100</peer-as>
<source-identifier>2.2.2.2</source-identifier>
<peer-connection-interval>900</peer-connection-interval>
<neighbor-passive />
<min-route-advertisement-interval>65535</min-route-advertisement-interval>
<peer-description>VRFA peer-group configs</peer-description>
<enable-peer-bfd />
<activate />
<default-peer-route-map-name />
<peer-route-reflector />
</state>
<timers>
<config>
<keep-alive>100</keep-alive>
<hold-time>300</hold-time>
</config>
<state>
<keep-alive>100</keep-alive>
<hold-time>300</hold-time>
</state>
</timers>
</peer-group>
</peer-groups>
</address-family-vrf>
<address-family-vrf>
<afi>ipv6</afi>
<safi>unicast</safi>
<vrf-name>vrfB</vrf-name>
<config>
<afi>ipv6</afi>
<safi>unicast</safi>
<vrf-name>vrfB</vrf-name>
</config>
<state>
<afi>ipv6</afi>
<safi>unicast</safi>
<vrf-name>vrfB</vrf-name>
</state>
<peer-groups>
<peer-group>
<peer-group-tag>peerB</peer-group-tag>
<bgp-passwords>
<bgp-password>
<password>0x9a20ef22549ad84b</password>
<config>
<password>0x9a20ef22549ad84b</password>
<auth-key-encrypt>1</auth-key-encrypt>
</config>
<state>
<password>0x9a20ef22549ad84b</password>
<auth-key-encrypt>1</auth-key-encrypt>
</state>
</bgp-password>
</bgp-passwords>
<maximum-prefixes>
<maximum-prefix>
<prefix-count>3123</prefix-count>
<config>
<prefix-count>3123</prefix-count>
<maximum-prefix-warning />
</config>
<state>
<prefix-count>3123</prefix-count>
<maximum-prefix-warning />
</state>
</maximum-prefix>
</maximum-prefixes>
<config>
<peer-group-tag>peerB</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>200</peer-as>
<peer-local-as>300</peer-local-as>
<peer-description>VRFB peer-group configs</peer-description>
<enable-peer-bfd />
<enable-peer-bfd-multihop />
<activate />
<default-peer-route-map-name />
</config>
<state>
<peer-group-tag>peerB</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>200</peer-as>
<peer-local-as>300</peer-local-as>
<peer-description>VRFB peer-group configs</peer-description>
<enable-peer-bfd />
<enable-peer-bfd-multihop />
<activate />
<default-peer-route-map-name />
</state>
<ebgp-multihop>
<config>
<maximum-hop-count>100</maximum-hop-count>
<enabled />
</config>
<state>
<maximum-hop-count>100</maximum-hop-count>
<enabled />
</state>
</ebgp-multihop>
</peer-group>
</peer-groups>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response that specifies different network instances, including the default, management, vrfA, and vrfB instances.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<route-selection-options>
<config>
<enable-aigp>true</enable-aigp>
</config>
<state>
<enable-aigp>true</enable-aigp>
</state>
</route-selection-options>
<state>
<as>100</as>
<total-prefixes>0</total-prefixes>
</state>
</global>
</bgp>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>management</name>
</network-instance>
<network-instance>
<name>vrfA</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
</state>
</afi-safi>
</afi-safis>
<state>
<as>100</as>
</state>
</global>
<peer-groups>
<peer-group>
<peer-group-name>peerA</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<prefix-limit>
<config>
<max-prefixes>2331</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</config>
<state>
<max-prefixes>2331</max-prefixes>
<warning-threshold-pct>100</warning-threshold-pct>
<prevent-teardown>true</prevent-teardown>
</state>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
<state>
<send-default-route>true</send-default-route>
</state>
</ipv4-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>peerA</peer-group-name>
<peer-as>100</peer-as>
<description>VRFA peer-group configs</description>
</config>
<state>
<auth-password>0x9603e78694ace534ea912b9ab53f8a55</auth-password>
<peer-group-name>peerA</peer-group-name>
<peer-as>100</peer-as>
<description>VRFA peer-group configs</description>
</state>
<transport>
<config>
<local-address>2.2.2.2</local-address>
<passive-mode>true</passive-mode>
</config>
<state>
<local-address>2.2.2.2</local-address>
<passive-mode>true</passive-mode>
</state>
</transport>
<timers>
<config>
<connect-retry>900.00</connect-retry>
<minimum-advertisement-interval>65535.00</minimum-advertisement-interval>
<keepalive-interval>100.00</keepalive-interval>
<hold-time>300.00</hold-time>
</config>
<state>
<connect-retry>900.00</connect-retry>
<minimum-advertisement-interval>65535.00</minimum-advertisement-interval>
<keepalive-interval>100.00</keepalive-interval>
<hold-time>300.00</hold-time>
</state>
</timers>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
</state>
</enable-bfd>
<route-reflector>
<config>
<route-reflector-client>true</route-reflector-client>
</config>
<state>
<route-reflector-client>true</route-reflector-client>
</state>
</route-reflector>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
<network-instance>
<name>vrfB</name>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<bgp>
<global>
<config>
<as>100</as>
</config>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
</state>
</afi-safi>
</afi-safis>
<state>
<as>100</as>
</state>
</global>
<peer-groups>
<peer-group>
<peer-group-name>peerB</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<ipv6-unicast>
<prefix-limit>
<config>
<max-prefixes>3123</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</config>
<state>
<max-prefixes>3123</max-prefixes>
<prevent-teardown>true</prevent-teardown>
</state>
</prefix-limit>
<config>
<send-default-route>true</send-default-route>
</config>
<state>
<send-default-route>true</send-default-route>
</state>
</ipv6-unicast>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peerB</peer-group-name>
<peer-as>200</peer-as>
<local-as>300</local-as>
<description>VRFB peer-group configs</description>
</config>
<state>
<auth-password>0x9a20ef22549ad84b</auth-password>
<peer-group-name>peerB</peer-group-name>
<peer-as>200</peer-as>
<local-as>300</local-as>
<description>VRFB peer-group configs</description>
</state>
<enable-bfd>
<config>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
</state>
</enable-bfd>
<ebgp-multihop>
<config>
<multihop-ttl>100</multihop-ttl>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<multihop-ttl>100</multihop-ttl>
</state>
</ebgp-multihop>
</peer-group>
</peer-groups>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
Restrictions
The first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured, those configuration needs the respective AFI-SAFI configuration that is present to indicate AFI type:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis
The above information is necessary for the OcNOS model to generate the following paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured on equipment, on the further configurations on those paths the user need not indicate the AFI-SAFI as the translation will look for this information on the equipment database.
Configure Update-source on Neighbor
This XML configuration snippet is used to specify the configuration of the update-source parameter on a neighbor in the context of a network device configuration. This XML configuration allows internal BGP sessions to use any operating interface for TCP connections.
Release
This configuration was introduced in OcNOS version 5.0.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload that specifies the configuration of a network instance named default with BGP. Within this network instance, a BGP peer or neighbor is configured to establish a connection with the IP address 1.1.1.1 and share IPv4 unicast routing information.
In this payload, various parameters such as the local address, peer AS, and AFI-SAFI are configured to enable communication and routing between BGP neighbors.
This XML configuration allows internal BGP sessions to use any available operating interface for establishing TCP connections.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">
<identifier>oc-pol-types:BGP</identifier>
<name>100</name>
<config>
<identifier>oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<bgp>
<global>
<config>
<as>100</as>
</config>
</global>
<neighbors>
<neighbor>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<neighbor-address>1.1.1.1</neighbor-address>
<config>
<neighbor-address>1.1.1.1</neighbor-address>
<peer-as>100</peer-as>
</config>
<transport>
<config>
<local-address>2.2.2.2</local-address>
</config>
</transport>
</neighbor>
</neighbors>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are to configure a BGP neighbor relationship within the BGP process running on a router with AS number 100. Specifically, it configures a BGP neighbor with the IP address 1.1.1.1, assigns it the same AS number (AS 100), and specifies that the local address for establishing the BGP connection should be 2.2.2.2. This update-source parameter ensures that the BGP sessions between the local router and the neighbor use the specified source IP address (2.2.2.2) for their TCP connections.
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source 2.2.2.2
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload for a BGP instance with AS number 100 is defined. Within this instance, a BGP peer relationship is established with a neighbor having the IP address 1.1.1.1. The payload further specifies that the local router should use the source IP address 2.2.2.2 when communicating with this BGP peer, ensuring proper BGP session establishment and communication.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<config>
<bgp-as>100</bgp-as>
</config>
<peers>
<peer>
<peer-address>1.1.1.1</peer-address>
<config>
<peer-address>1.1.1.1</peer-address>
<source-identifier>2.2.2.2</source-identifier>
<peer-as>100</peer-as>
</config>
</peer>
</peers>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response describing the default network instance, along with its associated protocols. Notably, the response includes information about a BGP instance with an AS number of 100, illustrating its global and neighbor-specific settings. The BGP neighbor relationship is established with an IP address of 1.1.1.1 and is configured to use a local address of 2.2.2.2 for communication.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
<enabled>true</enabled>
</config>
<bgp>
<global>
<config>
<as>100</as>
</config>
<state>
<as>100</as>
</state>
</global>
<neighbors>
<neighbor>
<neighbor-address>1.1.1.1</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<neighbor-address>1.1.1.1</neighbor-address>
<peer-as>100</peer-as>
</config>
<transport>
<config>
<local-address>2.2.2.2</local-address>
</config>
<state>
<local-address>2.2.2.2</local-address>
</state>
</transport>
<state>
<neighbor-address>1.1.1.1</neighbor-address>
<peer-as>100</peer-as>
</state>
</neighbor>
</neighbors>
</bgp>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</state>
</protocol>
</protocols>
</network-instance>
</network-instances>
Restrictions
None
Double Link in Load Balance
In this XML configuration snippet, two links are used to ensure service availability, and all traffic is routed through both links simultaneously. If either of these links experiences a failure, all traffic is automatically redirected to the remaining available link.
Release
This configuration was introduced in OcNOS version 5.1.
OpenConfig NetConf Payload
Here is the sample OpenConfig NetConf Payload to indicate the configuration of a network instance named TEST_A9 with associated BGP protocols and peer groups. In this scenario, two peer groups, PPAL_BGP_L3 and BCK_BGP_L3, are defined within BGP, each with its specific settings. The configuration also specifies the use of multiple paths for external BGP (eBGP) sessions and enables IPv4 unicast address families for these peer groups. Furthermore, it outlines neighbor configurations, including their addresses, peer group associations, and additional parameters like local and peer AS numbers.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>TEST_A9</name>
<config>
<name>TEST_A9</name>
<type>L3VRF</type>
<route-distinguisher>65000:100</route-distinguisher>
</config>
<protocols>
<protocol>
<identifier>BGP</identifier>
<name>65000</name>
<config>
<identifier>BGP</identifier>
<name>65000</name>
<enabled>true</enabled>
</config>
<bgp>
<peer-groups>
<peer-group>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<peer-group-name>PPAL_BGP_L3</peer-group-name>
<config>
<peer-group-name>PPAL_BGP_L3</peer-group-name>
<peer-as>18746</peer-as>
</config>
</peer-group>
<peer-group>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<peer-group-name>BCK_BGP_L3</peer-group-name>
<config>
<peer-group-name>BCK_BGP_L3</peer-group-name>
<peer-as>18010</peer-as>
</config>
</peer-group>
</peer-groups>
<global>
<config>
<as>65000</as>
</config>
<use-multiple-paths>
<config>
<enabled>true</enabled>
</config>
<ebgp>
<config>
<maximum-paths>2</maximum-paths>
</config>
</ebgp>
</use-multiple-paths>
</global>
<neighbors>
<neighbor>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<neighbor-address>172.17.30.2</neighbor-address>
<config>
<peer-group>PPAL_BGP_L3</peer-group>
<neighbor-address>172.17.30.2</neighbor-address>
<peer-as>18747</peer-as>
<local-as>65001</local-as>
<description>PPAL_SESSION</description>
</config>
</neighbor>
<neighbor>
<afi-safis>
<afi-safi>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<neighbor-address>172.17.40.2</neighbor-address>
<config>
<peer-group>BCK_BGP_L3</peer-group>
<neighbor-address>172.17.40.2</neighbor-address>
<peer-as>18010</peer-as>
<local-as>65002</local-as>
<description>BCK_SESSION</description>
</config>
</neighbor>
</neighbors>
</bgp>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS CLI Command
The below CLI commands are used to create a specific VRF instance named TEST_A9 with a unique route distinguisher (RD) of 65000:100. Within the BGP configuration for AS number 65000, two address families, IPv4 and IPv6, are defined for the TEST_A9 VRF, each allowing up to two paths for eBGP (external BGP) sessions.
The configuration also includes the setup of neighbor relationships, with peers grouped into PPAL_BGP_L3 and BCK_BGP_L3 peer groups. Each neighbor is associated with the appropriate peer group, and their remote AS numbers and descriptions are specified.
!
ip vrf TEST_A9
rd 65000:100
!
router bgp 65000
!
address-family ipv4 vrf TEST_A9
max-paths ebgp 2
neighbor BCK_BGP_L3 peer-group
neighbor BCK_BGP_L3 remote-as 18010
neighbor BCK_BGP_L3 activate
neighbor PPAL_BGP_L3 peer-group
neighbor PPAL_BGP_L3 remote-as 18746
neighbor PPAL_BGP_L3 activate
neighbor 172.17.30.2 remote-as 18747
neighbor 172.17.30.2 peer-group PPAL_BGP_L3
neighbor 172.17.40.2 remote-as 18010
neighbor 172.17.40.2 peer-group BCK_BGP_L3
neighbor 172.17.30.2 description PPAL_SESSION
neighbor 172.17.40.2 description BCK_SESSION
exit-address-family
!
address-family ipv6 vrf TEST_A9
max-paths ebgp 2
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload illustrating the configuration of a network instance with associated BGP settings. This configuration is designed to establish BGP sessions within the specified VRF instance and configure BGP-related parameters.
In this payload, the VRF instance type, BGP AS, BGP peering configurations for both IPv4 and IPv6 address families, and the maximum number of paths allowed for eBGP (external BGP) sessions are configured.
<network-instances xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-network-instance">
<network-instance>
<instance-name>TEST_A9</instance-name>
<instance-type>vrf</instance-type>
<config>
<instance-name>TEST_A9</instance-name>
<instance-type>vrf</instance-type>
</config>
<vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-vrf">
<config>
<vrf-name>TEST_A9</vrf-name>
</config>
<bgp-vrf xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp-vrf">
<config>
<rd-string>65000:100</rd-string>
</config>
</bgp-vrf>
</vrf>
</network-instance>
</network-instances>
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>65000</bgp-as>
<config>
<bgp-as>65000</bgp-as>
</config>
<address-family-vrfs>
<address-family-vrf>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>TEST_A9</vrf-name>
<vrf-peers>
<vrf-peer>
<peer-address>172.17.30.2</peer-address>
<config>
<peer-address>172.17.30.2</peer-address>
<peer-as>18747</peer-as>
<peer-description>PPAL_SESSION</peer-description>
<mapped-peer-group-tag-af>PPAL_BGP_L3</mapped-peer-group-tag-af>
</config>
</vrf-peer>
<vrf-peer>
<peer-address>172.17.40.2</peer-address>
<config>
<peer-address>172.17.40.2</peer-address>
<peer-as>18010</peer-as>
<peer-description>BCK_SESSION</peer-description>
<mapped-peer-group-tag-af>BCK_BGP_L3</mapped-peer-group-tag-af>
</config>
</vrf-peer>
</vrf-peers>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>TEST_A9</vrf-name>
</config>
<maximum-paths>
<config>
<ebgp-max-path>2</ebgp-max-path>
</config>
</maximum-paths>
<peer-groups>
<peer-group>
<peer-group-tag>BCK_BGP_L3</peer-group-tag>
<config>
<peer-group-tag>BCK_BGP_L3</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>18010</peer-as>
<activate />
</config>
</peer-group>
<peer-group>
<peer-group-tag>PPAL_BGP_L3</peer-group-tag>
<config>
<peer-group-tag>PPAL_BGP_L3</peer-group-tag>
<peer-group-range>static</peer-group-range>
<peer-as>18746</peer-as>
<activate />
</config>
</peer-group>
</peer-groups>
</address-family-vrf>
<address-family-vrf>
<afi>ipv6</afi>
<safi>unicast</safi>
<vrf-name>TEST_A9</vrf-name>
<config>
<afi>ipv6</afi>
<safi>unicast</safi>
<vrf-name>TEST_A9</vrf-name>
</config>
<maximum-paths>
<config>
<ebgp-max-path>2</ebgp-max-path>
</config>
</maximum-paths>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
Here is a NetConf validation response about the network instance's configuration, the BGP AS number, BGP peering details, and protocol tables for both IPv4 and IPv6 address families.
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>TEST_A9</name>
<config>
<name>TEST_A9</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
<route-distinguisher>65000:100</route-distinguisher>
</config>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>65000</name>
<bgp>
<global>
<config>
<as>65000</as>
</config>
<use-multiple-paths>
<config>
<enabled>true</enabled>
</config>
<ebgp>
<config>
<maximum-paths>2</maximum-paths>
</config>
</ebgp>
</use-multiple-paths>
</global>
<neighbors>
<neighbor>
<neighbor-address>172.17.30.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>false</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<enabled>false</enabled>
<neighbor-address>172.17.30.2</neighbor-address>
<peer-as>18747</peer-as>
<description>PPAL_SESSION</description>
<peer-group>PPAL_BGP_L3</peer-group>
</config>
</neighbor>
<neighbor>
<neighbor-address>172.17.40.2</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>false</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<enabled>false</enabled>
<neighbor-address>172.17.40.2</neighbor-address>
<peer-as>18010</peer-as>
<description>BCK_SESSION</description>
<peer-group>BCK_BGP_L3</peer-group>
</config>
</neighbor>
</neighbors>
<peer-groups>
<peer-group>
<peer-group-name>BCK_BGP_L3</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<peer-group-name>BCK_BGP_L3</peer-group-name>
<peer-as>18010</peer-as>
</config>
</peer-group>
<peer-group>
<peer-group-name>PPAL_BGP_L3</peer-group-name>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
</afi-safi>
</afi-safis>
<config>
<peer-group-name>PPAL_BGP_L3</peer-group-name>
<peer-as>18746</peer-as>
</config>
</peer-group>
</peer-groups>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>65000</name>
<enabled>true</enabled>
</config>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
</table>
</tables>
</network-instance>
</network-instances>
Restrictions
On the first time /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured, those configuration needs the respective AFI-SAFI configuration that be present to indicate AFI type:
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors/neighbor/afi-safis
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups/peer-group/afi-safis
The above information is necessary on OcNOS model to generate the follow paths:
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/peer-groups/peer-group/address-families
/ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs
After the /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/peer-groups and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/neighbors paths are configured on equipment, on the further configurations on those paths the user do not need to indicate the AFI-SAFE, the translation will look for this information on equipment database.
Delete BGP Instance
In this XML configuration snippet, BGP instances are configured on network-instance on OpenConfig and on container BGP on OcNos side. Due this difference the delete process need to handle if the operation is trying to delete one VRF instance or the entire BGP instance.
When using OpenConfig, the BGP object on OcNOS database is only deleted by the delete on "default" network-instance. When the delete is execute on VRF network-instance it only deletes the given VRF instance.
If there are VRF instances configured and a delete operation is executed on "default" network-instance, it going to clean only entries configured on "default" network-instance. To remove VRF instances, the user needs to apply a operation delete on VRF instances.
Release
This configuration was introduced in OcNOS version 5.1.
OpenConfig NetConf Payload
Here is a sample NetConf Payload to delete BGP instance.
Delete VRF instance:
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>VRF1</name>
<protocols>
<protocol operation="delete">
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</protocol>
</protocols>
</network-instance>
</network-instances>
 
Delete default instance:
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<protocols>
<protocol operation="delete">
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>100</name>
</protocol>
</protocols>
</network-instance>
</network-instances>
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to delete BGP instance.
Delete VRF instance:
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>100</bgp-as>
<address-family-vrfs>
<address-family-vrf operation="delete">
<afi>ipv4</afi>
<safi>unicast</safi>
<vrf-name>VRF1</vrf-name>
</address-family-vrf>
</address-family-vrfs>
</bgp-instance>
</bgp-instances>
</bgp>
 
Delete default instance:
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance operation="delete">
<bgp-as>100</bgp-as>
</bgp-instance>
</bgp-instances>
</bgp>
Restrictions
On OpenConfig BGP datamodel the container global do not have any key to identify a single BGP instance, but the BGP AS information is placed under xpath /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config/as.
On IPI BGP datamodel, the BGP AS information is a key for BGP container, and it does not allow the delete on xpath /ipi-bgp:/bgp/bgp-instances/bgp-instance/config/bgp-as to avoid delete its own instance key.
In this case, when translation framework detects a delete or remove operation on following OpenConfig xpaths:
1. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global
2. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config
3. /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config/as
It will trigger an error message to NETCONF client and do not execute the delete operation.
To avoid this issue, when user needs to delete or remove a configuration under OpenConfig xpath /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/global/config, user must adds a "delete" or "remove" operation directly on the leaf or leaves desired to be removed, rather than delete the entire container.
BGP RIB Counters IPv4
The BGP RIB (Routing information base) is a set of counters to retrieve information about routes from neighbors. This section gives details on BGP RIB IPv4.
The containers related to RIB are only the status on both Open Config and OcNOS datamodels, and there are no configuration related to this.
On OcNOS, the containers are available only after the BGP negotiate routers, the tables are empty before and cannot be retrieved.
The table below displays each table information:.
OcNOS CLI
OcNOS XPath
Open Config XPath
show ip bgp neighbors <IP-address> routes
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
show ip bgp neighbors <IP-address> received-routes
For default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
For non-default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/peers/peer/address-families/address-family/peer-adj-in-route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-in-post/routes/route
show ip bgp neighbors <IP-address> advertised-routes
For default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs/address-family-vrf/vrf-peers/peer-adj-out-route/next-hop
For non-default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/peers/peer/address-families/address-family/peer-adj-out-route/next-ho
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/neighbors/neighbor/adj-rib-out-post/routes/route
To get “last update” information:
show ip bgp <IP-address>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
show ip bgp ipv4 unicast <IP-address>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
When have user-defined VRF:
show ip bgp vrf <VRF name>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
When have user-defined VRF:
show ip bgp vpnv4 vrf <VRF name>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
When have user-defined VRF:
show ip bgp vpnv4 vrf <VRF name> <IP-address>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv4-unicast/loc-rib/routes/route
Release
This configuration was introduced in OcNOS version 6.2.
OpenConfig NetConf Payload
N/A
OcNOS CLI Command
The below CLI command is an example to illustrate the indicated counters.
To have a complete BGP RIB scenario, it needs more than one equipment configured to work with BGP.
router bgp 200
neighbor 10.10.10.11 remote-as 300
!
address-family ipv4 unicast
redistribute connected
redistribute static
neighbor 10.10.10.11 activate
neighbor 10.10.10.11 soft-reconfiguration inbound
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to illustrate the BGP RIB Counters IPv4.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>200</bgp-as>
<config>
<bgp-as>200</bgp-as>
</config>
<state>
<bgp-as>200</bgp-as>
<version>4</version>
<table-version>1</table-version>
<total-prefixes>2</total-prefixes>
<router-run-time-ip-address>192.168.122.61</router-run-time-ip-address>
<scan-remain-time>16</scan-remain-time>
</state>
<rib>
<address-family>
<safi>unicast</safi>
<afi>ipv4</afi>
<state>
<safi>unicast</safi>
<afi>ipv4</afi>
</state>
<routes>
<route>
<route-distinguisher>0</route-distinguisher>
<network-address>10.10.10.0/24</network-address>
<next-hop>
<next-hop-address>0.0.0.0</next-hop-address>
<state>
<next-hop-address>0.0.0.0</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<next-hop>
<next-hop-address>10.10.10.11</next-hop-address>
<state>
<next-hop-address>10.10.10.11</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<route-distinguisher>0</route-distinguisher>
<network-address>10.10.10.0/24</network-address>
</state>
</route>
<route>
<route-distinguisher>0</route-distinguisher>
<network-address>192.168.122.0</network-address>
<next-hop>
<next-hop-address>0.0.0.0</next-hop-address>
<state>
<next-hop-address>0.0.0.0</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<next-hop>
<next-hop-address>10.10.10.11</next-hop-address>
<state>
<next-hop-address>10.10.10.11</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<route-distinguisher>0</route-distinguisher>
<network-address>192.168.122.0</network-address>
</state>
</route>
</routes>
</address-family>
<address-family>
<safi>link-state</safi>
<afi>link-state</afi>
<state>
<safi>link-state</safi>
<afi>link-state</afi>
</state>
</address-family>
</rib>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
</config>
<state>
<afi>ipv4</afi>
<safi>unicast</safi>
</state>
<route-redistribute-lists>
<route-redistribute-list>
<protocol-type>connected</protocol-type>
<config>
<protocol-type>connected</protocol-type>
</config>
<state>
<protocol-type>connected</protocol-type>
</state>
</route-redistribute-list>
<route-redistribute-list>
<protocol-type>static</protocol-type>
<config>
<protocol-type>static</protocol-type>
</config>
<state>
<protocol-type>static</protocol-type>
</state>
</route-redistribute-list>
</route-redistribute-lists>
</address-family>
</address-families>
<peers>
<peer>
<peer-address>10.10.10.11</peer-address>
<address-families>
<address-family>
<afi>ipv4</afi>
<safi>unicast</safi>
<peer-adj-out-route>
<network-address>10.10.10.0/24</network-address>
<next-hop>
<next-hop-address>10.10.10.10</next-hop-address>
<state>
<next-hop-address>10.10.10.10</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>10.10.10.0/24</network-address>
</state>
</peer-adj-out-route>
<peer-adj-out-route>
<network-address>192.168.122.0</network-address>
<next-hop>
<next-hop-address>10.10.10.10</next-hop-address>
<state>
<next-hop-address>10.10.10.10</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-12-04T17:50:28Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>192.168.122.0</network-address>
</state>
</peer-adj-out-route>
<peer-adj-in-route>
<network-address>10.10.10.0/24</network-address>
<next-hop>
<next-hop-address>10.10.10.11</next-hop-address>
<state>
<next-hop-address>10.10.10.11</next-hop-address>
<peer-network-weight>0</peer-network-weight>
<bgp-as-path-string>300</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<network-remote-address-route>192.168.122.60</network-remote-address-route>
<route-peer-address>10.10.10.11</route-peer-address>
<route-local-preference>100</route-local-preference>
<last-update-route>1970-01-01T00:00:00Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>false</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>external</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>0</bgp-tx-path-id>
<bgp-rx-path-id>0</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>10.10.10.0/24</network-address>
</state>
</peer-adj-in-route>
<peer-adj-in-route>
<network-address>192.168.122.0</network-address>
<next-hop>
<next-hop-address>10.10.10.11</next-hop-address>
<state>
<next-hop-address>10.10.10.11</next-hop-address>
<peer-network-weight>0</peer-network-weight>
<bgp-as-path-string>300</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<network-remote-address-route>192.168.122.60</network-remote-address-route>
<route-peer-address>10.10.10.11</route-peer-address>
<route-local-preference>100</route-local-preference>
<last-update-route>1970-01-01T00:00:00Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>false</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>external</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>0</bgp-tx-path-id>
<bgp-rx-path-id>0</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>192.168.122.0</network-address>
</state>
</peer-adj-in-route>
<config>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
<soft-reconfig-inbound />
</config>
<state>
<afi>ipv4</afi>
<safi>unicast</safi>
<activate />
<soft-reconfig-inbound />
<community-count>0</community-count>
<address-family-capability>advertise-receive</address-family-capability>
<ipv6-next-hop-global>::</ipv6-next-hop-global>
<ipv6-next-hop-local>::</ipv6-next-hop-local>
<remote-port>179</remote-port>
<remote-address>10.10.10.11</remote-address>
<local-host>10.10.10.10</local-host>
<ipv4-next-hop>10.10.10.10</ipv4-next-hop>
<local-port>40394</local-port>
<peer-address-family-table-version>1</peer-address-family-table-version>
<address-family-table-version>1</address-family-table-version>
<prefix-count>2</prefix-count>
<send-prefix-count>2</send-prefix-count>
<count>1</count>
<connection-type>non_shared</connection-type>
<connection-established-count>1</connection-established-count>
<graceful-restart-time>0</graceful-restart-time>
<bgp-established-up-time>00:02:24</bgp-established-up-time>
<last-read-time>00:00:23</last-read-time>
<bgp-peer-state>established</bgp-peer-state>
<link-type>external</link-type>
<router-id>192.168.122.60</router-id>
<advertisement-interval>30</advertisement-interval>
<calculated-hold-time>90</calculated-hold-time>
<calculated-keepalive>30</calculated-keepalive>
<route-refresh-capability>advertised-and-received-old-and-new</route-refresh-capability>
<counters>
<keepalive-in-messages>6</keepalive-in-messages>
<keepalive-out-messages>6</keepalive-out-messages>
<open-messages-in>1</open-messages-in>
<open-messages-out>1</open-messages-out>
<as-path-count>2</as-path-count>
<update-message-in>1</update-message-in>
<update-message-out>1</update-message-out>
<received-packet-count>8</received-packet-count>
<notification-in>0</notification-in>
<notification-out>0</notification-out>
<packet-in-queue>0</packet-in-queue>
<packet-out-queue>0</packet-out-queue>
<sent-packet-count>8</sent-packet-count>
<refresh-received-packet-count>0</refresh-received-packet-count>
<refresh-sent-packet-count>0</refresh-sent-packet-count>
</counters>
</state>
<peer-index>
<state>
<peer-index>1</peer-index>
<offset>0</offset>
<mask>0x2</mask>
</state>
</peer-index>
</address-family>
</address-families>
<config>
<peer-address>10.10.10.11</peer-address>
<peer-as>300</peer-as>
</config>
<state>
<peer-address>10.10.10.11</peer-address>
<peer-as>300</peer-as>
</state>
</peer>
</peers>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
<bgp>
<global>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<as>200</as>
</config>
<state>
<as>200</as>
<total-prefixes>2</total-prefixes>
</state>
</global>
<rib>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<ipv4-unicast>
<loc-rib>
<routes>
<route>
<prefix>10.10.10.0/24</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<state>
<prefix>10.10.10.0/24</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<last-modified>1670176228</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>192.168.122.0</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<state>
<prefix>192.168.122.0</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<last-modified>1670176228</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</loc-rib>
<neighbors>
<neighbor>
<neighbor-address>10.10.10.11</neighbor-address>
<state>
<neighbor-address>10.10.10.11</neighbor-address>
</state>
<adj-rib-out-post>
<routes>
<route>
<prefix>10.10.10.0/24</prefix>
<path-id>0</path-id>
<state>
<prefix>10.10.10.0/24</prefix>
<path-id>0</path-id>
<last-modified>1670176228</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>192.168.122.0</prefix>
<path-id>0</path-id>
<state>
<prefix>192.168.122.0</prefix>
<path-id>0</path-id>
<last-modified>1670176228</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</adj-rib-out-post>
<adj-rib-in-post>
<routes>
<route>
<prefix>10.10.10.0/24</prefix>
<path-id>0</path-id>
<state>
<prefix>10.10.10.0/24</prefix>
<path-id>0</path-id>
<last-modified>0</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>192.168.122.0</prefix>
<path-id>0</path-id>
<state>
<prefix>192.168.122.0</prefix>
<path-id>0</path-id>
<last-modified>0</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</adj-rib-in-post>
</neighbor>
</neighbors>
</ipv4-unicast>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
</state>
</afi-safi>
</afi-safis>
</rib>
<neighbors>
<neighbor>
<neighbor-address>10.10.10.11</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV4_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>10.10.10.11</neighbor-address>
<peer-as>300</peer-as>
</config>
<state>
<enabled>true</enabled>
<neighbor-address>10.10.10.11</neighbor-address>
<peer-as>300</peer-as>
</state>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
</tables>
<table-connections>
<table-connection>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</src-protocol>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">200</dst-instance>
<default-import-policy>ACCEPT_ROUTE</default-import-policy>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</src-protocol>
</config>
</table-connection>
<table-connection>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</src-protocol>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">200</dst-instance>
<default-import-policy>ACCEPT_ROUTE</default-import-policy>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</src-protocol>
</config>
</table-connection>
</table-connections>
</network-instance>
</network-instances>
Restrictions
The containers related to RIB are status only on both Open Config and OcNOS datamodels, and there are no configuration related to this.
On OcNOS the containers are available only after the BGP negotiate routers, before it this tables are empty and could not be retrieved.
The paths /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safi/afi-safi/ipv4-unicast/loc-rib/routes/route and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safi/afi-safi/ipv6-unicast/loc-rib/routes/route have some keys with fixed values, the table below show the values. Note the “X” indicate that is valid for IPv4 and IPv6 containers.
 
OpenConfig XPath
OcNOS XPath
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/origin
Use fixed value:
IPV4: “0.0.0.0”
IPV6: “0::0”
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/path-id
Fixed value “0”
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/prefix
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/network-address
BGP RIB Counters IPv6
The BGP RIB (Routing information base) is a set of counters to retrieve information about routes from neighbors. This section gives details on BGP RIB IPv6.
The containers related to RIB are only the status on both Open Config and OcNOS datamodels, and there are no configuration related to this.
On OcNOS, the containers are available only after the BGP negotiate routers, the tables are empty before and cannot be retrieved.
The table below displays each table information:.
 
OcNOS CLI
OcNOS XPath
OpenConfig XPath
show bgp ipv6 neighbors <IP-address IPv6> routes
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
show bgp ipv6 neighbors <IP-address IPv6> received-routes
For default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs/address-family-vrf/vrf-peers/vrf-peer/peer-adj-in-route/next-hop
For non-default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/peers/peer/address-families/address-family/peer-adj-in-route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-in-post/routes/route
show bgp ipv6 neighbors <IP-address IPv6> advertised-routes
For default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/address-family-vrfs/address-family-vrf/vrf-peers/vrf-peer/peer-adj-out-route/next-hopp
For non-default VRF instances: /ipi-bgp:bgp/bgp-instances/bgp-instance/peers/peer/address-families/address-family/peer-adj-out-route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/neighbors/neighbor/adj-rib-out-post/routes/route
To get “last update” information:
show bgp ipv6 <IP-address IPv6>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
show bgp ipv6 unicast <IP-address IPv6>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
When have user-defined VRF, to get “last update” information:
show ip bgp vpnv6 vrf <VRF name>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
When have user-defined VRF, to get “last update” information:
show ip bgp vpnv6 vrf <VRF name> <IP-address IPv6>
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
show bgp ipv6 summary
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/next-hop
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipv6-unicast/loc-rib/routes/route
Release
This configuration was introduced in OcNOS version 6.2.
OpenConfig NetConf Payload
N/A
OcNOS CLI Command
The below CLI command is an example to illustrate the indicated counters.
To have a complete BGP RIB scenario, it needs more than one equipment configured to work with BGP.
interface eth1
ipv6 address f0ca::11/48
!
router bgp 200
neighbor f0ca::10 remote-as 300
!
address-family ipv6 unicast
redistribute connected
redistribute static
neighbor f0ca::10 activate
neighbor f0ca::10 soft-reconfiguration inbound
exit-address-family
!
OcNOS NetConf Payload
Here is a sample OcNOS NetConf Payload to illustrate the BGP RIB Counters IPv6.
<bgp xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-bgp">
<bgp-instances>
<bgp-instance>
<bgp-as>200</bgp-as>
<config>
<bgp-as>200</bgp-as>
</config>
<state>
<bgp-as>200</bgp-as>
<version>4</version>
<table-version>1</table-version>
<total-prefixes>0</total-prefixes>
<router-run-time-ip-address>192.168.122.60</router-run-time-ip-address>
<scan-remain-time>38</scan-remain-time>
</state>
<rib>
<address-family>
<safi>unicast</safi>
<afi>ipv6</afi>
<state>
<safi>unicast</safi>
<afi>ipv6</afi>
</state>
<routes>
<route>
<route-distinguisher>0</route-distinguisher>
<network-address>b0b0::/64</network-address>
<next-hop>
<next-hop-address>::</next-hop-address>
<state>
<next-hop-address>::</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:42:24Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<next-hop>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<state>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:42:24Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<route-distinguisher>0</route-distinguisher>
<network-address>b0b0::/64</network-address>
</state>
</route>
<route>
<route-distinguisher>0</route-distinguisher>
<network-address>f0ca::/24</network-address>
<next-hop>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<state>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<peer-network-weight>0</peer-network-weight>
<bgp-med-value>0</bgp-med-value>
<bgp-as-path-string>300</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<network-remote-address-route>192.168.122.52</network-remote-address-route>
<originator-id-route>192.168.122.52</originator-id-route>
<route-peer-address>f0ca::10</route-peer-address>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:43:26Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>external</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<route-distinguisher>0</route-distinguisher>
<network-address>f0ca::/24</network-address>
</state>
</route>
<route>
<route-distinguisher>0</route-distinguisher>
<network-address>f0ca::/48</network-address>
<next-hop>
<next-hop-address>::</next-hop-address>
<state>
<next-hop-address>::</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:42:24Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>true</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<route-distinguisher>0</route-distinguisher>
<network-address>f0ca::/48</network-address>
</state>
</route>
</routes>
</address-family>
<address-family>
<safi>link-state</safi>
<afi>link-state</afi>
<state>
<safi>link-state</safi>
<afi>link-state</afi>
</state>
</address-family>
</rib>
<address-families>
<address-family>
<afi>ipv6</afi>
<safi>unicast</safi>
<config>
<afi>ipv6</afi>
<safi>unicast</safi>
</config>
<state>
<afi>ipv6</afi>
<safi>unicast</safi>
</state>
<route-redistribute-lists>
<route-redistribute-list>
<protocol-type>connected</protocol-type>
<config>
<protocol-type>connected</protocol-type>
</config>
<state>
<protocol-type>connected</protocol-type>
</state>
</route-redistribute-list>
<route-redistribute-list>
<protocol-type>static</protocol-type>
<config>
<protocol-type>static</protocol-type>
</config>
<state>
<protocol-type>static</protocol-type>
</state>
</route-redistribute-list>
</route-redistribute-lists>
</address-family>
</address-families>
<peers>
<peer>
<peer-address>f0ca::10</peer-address>
<address-families>
<address-family>
<afi>ipv6</afi>
<safi>unicast</safi>
<peer-adj-out-route>
<network-address>b0b0::/64</network-address>
<next-hop>
<next-hop-address>f0ca::11(fe80::5054:ff:fed0:8295)</next-hop-address>
<state>
<next-hop-address>f0ca::11(fe80::5054:ff:fed0:8295)</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:42:24Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>b0b0::/64</network-address>
</state>
</peer-adj-out-route>
<peer-adj-out-route>
<network-address>f0ca::/48</network-address>
<next-hop>
<next-hop-address>f0ca::11(fe80::5054:ff:fed0:8295)</next-hop-address>
<state>
<next-hop-address>f0ca::11(fe80::5054:ff:fed0:8295)</next-hop-address>
<peer-network-weight>32768</peer-network-weight>
<bgp-as-path-string>Local</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<route-local-preference>100</route-local-preference>
<last-update-route>2022-11-20T22:42:24Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>sourced</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>-1</bgp-tx-path-id>
<bgp-rx-path-id>-1</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>f0ca::/48</network-address>
</state>
</peer-adj-out-route>
<peer-adj-in-route>
<network-address>b0b0::/64</network-address>
<next-hop>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<state>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<peer-network-weight>0</peer-network-weight>
<bgp-as-path-string>300</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<network-remote-address-route>192.168.122.52</network-remote-address-route>
<route-peer-address>f0ca::10</route-peer-address>
<route-local-preference>100</route-local-preference>
<last-update-route>1970-01-01T00:00:00Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>false</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>external</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>0</bgp-tx-path-id>
<bgp-rx-path-id>0</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>b0b0::/64</network-address>
</state>
</peer-adj-in-route>
<peer-adj-in-route>
<network-address>f0ca::/24</network-address>
<next-hop>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<state>
<next-hop-address>f0ca::10(fe80::5054:ff:fe78:1f3)</next-hop-address>
<peer-network-weight>0</peer-network-weight>
<bgp-as-path-string>300</bgp-as-path-string>
<bgp-as-path-4-byte-origin>incomplete</bgp-as-path-4-byte-origin>
<ibgp-metric-route>0</ibgp-metric-route>
<network-remote-address-route>192.168.122.52</network-remote-address-route>
<route-peer-address>f0ca::10</route-peer-address>
<route-local-preference>100</route-local-preference>
<last-update-route>1970-01-01T00:00:00Z</last-update-route>
<reflector-client-route>false</reflector-client-route>
<route-dampening-active>false</route-dampening-active>
<history-route>false</history-route>
<nexthop-valid-route>false</nexthop-valid-route>
<med-flag-type-route>false</med-flag-type-route>
<valid-route>true</valid-route>
<stale-route>false</stale-route>
<route-type>external</route-type>
<ecmp-multi-candidate-route>false</ecmp-multi-candidate-route>
<multi-installed-route>false</multi-installed-route>
<atomic-aggregate-route>false</atomic-aggregate-route>
<selected-route>true</selected-route>
<bgp-tx-path-id>0</bgp-tx-path-id>
<bgp-rx-path-id>0</bgp-rx-path-id>
</state>
</next-hop>
<state>
<network-address>f0ca::/24</network-address>
</state>
</peer-adj-in-route>
<config>
<afi>ipv6</afi>
<safi>unicast</safi>
<activate />
<soft-reconfig-inbound />
</config>
<state>
<afi>ipv6</afi>
<safi>unicast</safi>
<activate />
<soft-reconfig-inbound />
<community-count>0</community-count>
<ipv6-next-hop-global>f0ca::11</ipv6-next-hop-global>
<ipv6-next-hop-local>fe80::5054:ff:fed0:8295</ipv6-next-hop-local>
<remote-port>54786</remote-port>
<remote-address>f0ca::10</remote-address>
<local-host>f0ca::11</local-host>
<ipv4-next-hop>192.168.122.60</ipv4-next-hop>
<local-port>179</local-port>
<peer-address-family-table-version>2</peer-address-family-table-version>
<address-family-table-version>2</address-family-table-version>
<prefix-count>2</prefix-count>
<send-prefix-count>2</send-prefix-count>
<count>1</count>
<connection-type>shared</connection-type>
<connection-established-count>1</connection-established-count>
<graceful-restart-time>0</graceful-restart-time>
<bgp-established-up-time>00:00:33</bgp-established-up-time>
<last-read-time>00:00:05</last-read-time>
<bgp-peer-state>established</bgp-peer-state>
<link-type>external</link-type>
<router-id>192.168.122.52</router-id>
<advertisement-interval>30</advertisement-interval>
<calculated-hold-time>90</calculated-hold-time>
<calculated-keepalive>30</calculated-keepalive>
<route-refresh-capability>advertised-and-received-old-and-new</route-refresh-capability>
<capability-ipv6-unicast>advertised-and-received</capability-ipv6-unicast>
<counters>
<keepalive-in-messages>2</keepalive-in-messages>
<keepalive-out-messages>2</keepalive-out-messages>
<open-messages-in>1</open-messages-in>
<open-messages-out>2</open-messages-out>
<as-path-count>2</as-path-count>
<update-message-in>1</update-message-in>
<update-message-out>1</update-message-out>
<received-packet-count>4</received-packet-count>
<notification-in>0</notification-in>
<notification-out>0</notification-out>
<packet-in-queue>0</packet-in-queue>
<packet-out-queue>0</packet-out-queue>
<sent-packet-count>5</sent-packet-count>
<refresh-received-packet-count>0</refresh-received-packet-count>
<refresh-sent-packet-count>0</refresh-sent-packet-count>
</counters>
</state>
<peer-index>
<state>
<peer-index>1</peer-index>
<offset>0</offset>
<mask>0x2</mask>
</state>
</peer-index>
</address-family>
</address-families>
<config>
<peer-address>f0ca::10</peer-address>
<peer-as>300</peer-as>
</config>
<state>
<peer-address>f0ca::10</peer-address>
<peer-as>300</peer-as>
</state>
</peer>
</peers>
</bgp-instance>
</bgp-instances>
</bgp>
Validation with NetConf get
<network-instances xmlns="http://openconfig.net/yang/network-instance">
<network-instance>
<name>default</name>
<config>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</config>
<state>
<name>default</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:DEFAULT_INSTANCE</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
<bgp>
<global>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<as>200</as>
</config>
<state>
<as>200</as>
<total-prefixes>0</total-prefixes>
</state>
</global>
<rib>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<ipv6-unicast>
<loc-rib>
<routes>
<route>
<prefix>b0b0::/64</prefix>
<origin>0::0</origin>
<path-id>0</path-id>
<state>
<prefix>b0b0::/64</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<last-modified>1668984144</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>f0ca::/24</prefix>
<origin>0::0</origin>
<path-id>0</path-id>
<state>
<prefix>f0ca::/24</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<last-modified>1668984206</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>f0ca::/48</prefix>
<origin>0::0</origin>
<path-id>0</path-id>
<state>
<prefix>f0ca::/48</prefix>
<origin>0.0.0.0</origin>
<path-id>0</path-id>
<last-modified>1668984144</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</loc-rib>
<neighbors>
<neighbor>
<neighbor-address>f0ca::10</neighbor-address>
<state>
<neighbor-address>f0ca::10</neighbor-address>
</state>
<adj-rib-out-post>
<routes>
<route>
<prefix>b0b0::/64</prefix>
<path-id>0</path-id>
<state>
<prefix>b0b0::/64</prefix>
<path-id>0</path-id>
<last-modified>1668984144</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>f0ca::/48</prefix>
<path-id>0</path-id>
<state>
<prefix>f0ca::/48</prefix>
<path-id>0</path-id>
<last-modified>1668984144</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</adj-rib-out-post>
<adj-rib-in-post>
<routes>
<route>
<prefix>b0b0::/64</prefix>
<path-id>0</path-id>
<state>
<prefix>b0b0::/64</prefix>
<path-id>0</path-id>
<last-modified>0</last-modified>
<valid-route>true</valid-route>
</state>
</route>
<route>
<prefix>f0ca::/24</prefix>
<path-id>0</path-id>
<state>
<prefix>f0ca::/24</prefix>
<path-id>0</path-id>
<last-modified>0</last-modified>
<valid-route>true</valid-route>
</state>
</route>
</routes>
</adj-rib-in-post>
</neighbor>
</neighbors>
</ipv6-unicast>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
</state>
</afi-safi>
</afi-safis>
</rib>
<neighbors>
<neighbor>
<neighbor-address>f0ca::10</neighbor-address>
<afi-safis>
<afi-safi>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<config>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</config>
<state>
<afi-safi-name
xmlns:oc-bgp-types="http://openconfig.net/yang/bgp-types">oc-bgp-types:IPV6_UNICAST</afi-safi-name>
<enabled>true</enabled>
</state>
</afi-safi>
</afi-safis>
<config>
<enabled>true</enabled>
<neighbor-address>f0ca::10</neighbor-address>
<peer-as>300</peer-as>
</config>
<state>
<enabled>true</enabled>
<neighbor-address>f0ca::10</neighbor-address>
<peer-as>300</peer-as>
</state>
</neighbor>
</neighbors>
</bgp>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
<enabled>true</enabled>
</config>
<state>
<enabled>true</enabled>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</identifier>
<name>200</name>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
</tables>
<interfaces>
<interface>
<id>eth0</id>
<config>
<id>eth0</id>
<interface>eth0</interface>
</config>
</interface>
<interface>
<id>eth1</id>
<config>
<id>eth1</id>
<interface>eth1</interface>
</config>
</interface>
<interface>
<id>eth2</id>
<config>
<id>eth2</id>
<interface>eth2</interface>
</config>
</interface>
<interface>
<id>eth3</id>
<config>
<id>eth3</id>
<interface>eth3</interface>
</config>
</interface>
<interface>
<id>eth4</id>
<config>
<id>eth4</id>
<interface>eth4</interface>
</config>
</interface>
<interface>
<id>eth5</id>
<config>
<id>eth5</id>
<interface>eth5</interface>
</config>
</interface>
<interface>
<id>eth6</id>
<config>
<id>eth6</id>
<interface>eth6</interface>
</config>
</interface>
<interface>
<id>eth7</id>
<config>
<id>eth7</id>
<interface>eth7</interface>
</config>
</interface>
<interface>
<id>eth8</id>
<config>
<id>eth8</id>
<interface>eth8</interface>
</config>
</interface>
<interface>
<id>lo</id>
<config>
<id>lo</id>
<interface>lo</interface>
</config>
</interface>
</interfaces>
<table-connections>
<table-connection>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</src-protocol>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">200</dst-instance>
<default-import-policy>ACCEPT_ROUTE</default-import-policy>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</src-protocol>
</config>
</table-connection>
<table-connection>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</src-protocol>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<dst-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:BGP</dst-protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<dst-instance xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-oc-ni-augments">200</dst-instance>
<default-import-policy>ACCEPT_ROUTE</default-import-policy>
<src-protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:STATIC</src-protocol>
</config>
</table-connection>
</table-connections>
</network-instance>
<network-instance>
<name>management</name>
<config>
<name>management</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</config>
<state>
<name>management</name>
<type
xmlns:oc-ni-types="http://openconfig.net/yang/network-instance-types">oc-ni-types:L3VRF</type>
</state>
<protocols>
<protocol>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<config>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</config>
<state>
<identifier
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</identifier>
<name>DIRECTLY_CONNECTED</name>
<enabled>true</enabled>
</state>
</protocol>
</protocols>
<tables>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV4</address-family>
</state>
</table>
<table>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
<config>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</config>
<state>
<protocol
xmlns:oc-pol-types="http://openconfig.net/yang/policy-types">oc-pol-types:DIRECTLY_CONNECTED</protocol>
<address-family
xmlns:oc-types="http://openconfig.net/yang/openconfig-types">oc-types:IPV6</address-family>
</state>
</table>
</tables>
</network-instance>
</network-instances>
Restrictions
The containers related to RIB are status only on both Open Config and OcNOS datamodels, and there are no configuration related to this.
On OcNOS the containers are available only after the BGP negotiate routers, before it this tables are empty and could not be retrived.
The paths /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safi/afi-safi/ipv4-unicast/loc-rib/routes/route and /oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safi/afi-safi/ipv6-unicast/loc-rib/routes/route have some keys with fixed values, the table below show the values. Note the “X” indicate that is valid for IPv4 and IPv6 containers.
OpenConfig XPath
OcNOS XPath
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/origin
Use fixed value:
IPV4: “0.0.0.0”
IPV6: “0::0”
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/path-id
Fixed value “0”
/oc-netinst:network-instances/network-instance/protocols/protocol/bgp/rib/afi-safis/afi-safi/ipvX-unicast/loc-rib/routes/route/path-id
/ipi-bgp:bgp/bgp-instances/bgp-instance/rib/address-family/routes/route/network-address