Protocol Configuration

As a first step, a new protocol instance needs to be configured. It is a very basic configuration conforming with RFC4271.

Note

RIB policy must already be configured and present before configuring the protocol.

URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/protocols

Method: POST

Content-Type: application/xml

Request Body:

 1<protocol xmlns="http://openconfig.net/yang/network-instance">
 2    <name>bgp-example</name>
 3    <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
 4    <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 5        <global>
 6            <config>
 7                <router-id>192.0.2.2</router-id>
 8                <as>65000</as>
 9            </config>
10            <apply-policy>
11                <config>
12                   <default-export-policy>REJECT-ROUTE</default-export-policy>
13                   <default-import-policy>REJECT-ROUTE</default-import-policy>
14                   <import-policy>default-odl-import-policy</import-policy>
15                   <export-policy>default-odl-export-policy</export-policy>
16                </config>
17            </apply-policy>
18        </global>
19    </bgp>
20</protocol>

@line 2: The unique protocol instance identifier.

@line 7: BGP Identifier of the speaker.

@line 8: Local autonomous system number of the speaker. Note that, OpenDaylight BGP implementation supports four-octet AS numbers only.

@line 14: Default ODL Import Policy.

@line 15: Default ODL Export Policy.


The new instance presence can be verified via REST:

URL: /rests/data/bgp-rib:bgp-rib/rib=bgp-example?content=nonconfig

Method: GET

Response Body:

 1<rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
 2    <id>bgp-example</id>
 3    <loc-rib>
 4        <tables>
 5            <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
 6            <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
 7            <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
 8            <attributes>
 9                <uptodate>true</uptodate>
10            </attributes>
11        </tables>
12    </loc-rib>
13</rib>

@line 3: Loc-RIB - Per-protocol instance RIB, which contains the routes that have been selected by local BGP speaker’s decision process.

@line 4: The BGP-4 supports carrying IPv4 prefixes, such routes are stored in ipv4-address-family/unicast-subsequent-address-family table.