Encode with Base64 Linkstate route key
[bgpcep.git] / docs / bgp / bgp-user-guide-protocol-configuration.rst
1 .. _bgp-user-guide-protocol-configuration:
2
3 Protocol Configuration
4 ======================
5 As a first step, a new protocol instance needs to be configured.
6 It is a very basic configuration conforming with RFC4271.
7
8 .. note:: RIB policy must already be configured and present before configuring the protocol.
9
10 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
11
12 **Method:** ``POST``
13
14 **Content-Type:** ``application/xml``
15
16 **Request Body:**
17
18 .. code-block:: xml
19    :linenos:
20    :emphasize-lines: 2,7,8
21
22    <protocol xmlns="http://openconfig.net/yang/network-instance">
23        <name>bgp-example</name>
24        <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
25        <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
26            <global>
27                <config>
28                    <router-id>192.0.2.2</router-id>
29                    <as>65000</as>
30                </config>
31                 <apply-policy>
32                     <config>
33                         <default-export-policy>REJECT-ROUTE</default-export-policy>
34                         <default-import-policy>REJECT-ROUTE</default-import-policy>
35                         <import-policy>default-odl-import-policy</import-policy>
36                         <export-policy>default-odl-export-policy</export-policy>
37                     </config>
38                 </apply-policy>
39            </global>
40        </bgp>
41    </protocol>
42
43 @line 2: The unique protocol instance identifier.
44
45 @line 7: BGP Identifier of the speaker.
46
47 @line 8: Local autonomous system number of the speaker. Note that, OpenDaylight BGP implementation supports four-octet AS numbers only.
48
49 @line 14: Default ODL Import Policy.
50
51 @line 15: Default ODL Export Policy.
52
53 -----
54
55 The new instance presence can be verified via REST:
56
57 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example``
58
59 **Method:** ``GET``
60
61 **Response Body:**
62
63 .. code-block:: xml
64    :linenos:
65    :emphasize-lines: 3,4
66
67    <rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
68        <id>bgp-example</id>
69        <loc-rib>
70            <tables>
71                <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
72                <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
73                <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
74                <attributes>
75                    <uptodate>true</uptodate>
76                </attributes>
77            </tables>
78        </loc-rib>
79    </rib>
80
81 @line 3: Loc-RIB - Per-protocol instance RIB, which contains the routes that have been selected by local BGP speaker's decision process.
82
83 @line 4: The BGP-4 supports carrying IPv4 prefixes, such routes are stored in *ipv4-address-family*/*unicast-subsequent-address-family* table.