WikiMiNET

La documentation technique et administrative

Outils pour utilisateurs

Outils du site


wiki:sdn:opendaylight:bgpcepls

BGP-PCEP LS

OpenDayLight provides a plugin for BGP which features:

  • inter/intra-AS peering
  • routes advertising
  • routes originating
  • routes storage

Installation

This is a short tutorial to build a BGP-LS tunnel communication.

  • Install the feature:
     feature:install odl-bgpcep-bgp 

Configuration

1. Debugging

a. Get network topology:

curl -u "admin:admin" -X GET  http://192.168.103.144:8181/restconf/operational/network-topology:network-topology/
{"network-topology":{"topology":[{"topology-id":"example-ipv4-topology","server-provided":true,"topology-types":
{"odl-bgp-topology-types:bgp-ipv4-reachability-topology":{}}},{"topology-id":"flow:1"},{"topology-id":"example-
ipv6-topology","server-provided":true,"topology-types":{"odl-bgp-topology-types:bgp-ipv6-reachability-topology":
{}}},{"topology-id":"example-linkstate-topology","server-provided":true,"topology-types":{"odl-bgp-topology-
types:bgp-linkstate-topology":{}}}]}}

b. Debug

  • Check that BGP speaker is listenning on TCP port 1790 (BGP port of ODL):
     netstat -lapute | grep 1790 
  • Check that BGP peer is listening for BGP connection :
     telnet <peer-ip-address> <bgp-port> 

2. First attempt

  • Create bgp-rib.xml file
<config xmlns="http://openconfig.net/yang/bgp">
    <router-id>192.168.103.144</router-id>
    <as>64514</as>
</config>
  • Add BGP RIB
curl -u "admin:admin" -H "Content-Type: text/xml"  -d @bgp-rib.xml -X PUT  http://192.168.103.144:8181/restconf/config/openconfig-bgp:bgp/global/config
  • Check values are right
curl -u "admin:admin" -X GET  http://192.168.103.144:8181/restconf/config/openconfig-bgp:bgp/global/config

3. Second Attempt

a. Configure BGP Speaker - Local BGP

curl -u "admin:admin" -X GET   http://192.168.103.144:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols | python -m json.tool
<protocol xmlns="http://openconfig.net/yang/network-instance">
    <name>bgp-example</name>
    <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
    <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
        <global>
            <config>
                <router-id>192.168.103.144</router-id>
                <as>64514</as>
            </config>
            <afi-safis>
                <afi-safi>
                    <afi-safi-name>LINKSTATE</afi-safi-name>
                </afi-safi>
            </afi-safis>
        </global>
    </bgp>
</protocol>
 curl -u "admin:admin" -X POST -H "Content-Type: text/xml" -d @bgp-config.xml http://192.168.103.144:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols

b. Check the RIB

curl -u "admin:admin" -X GET http://192.168.103.144:8181/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example | python -m json.tool

c. Configure BGP server listening port

“BGP uses TCP as its transport protocol, by default listens on port 179. OpenDaylight BGP plugin is configured to listen on port 1790, due to privileged ports restriction for non-root users. One of the workarounds is to use port redirection. In case other port is desired to be used instead, we can reconfigure it.” [1]

<bgp-peer-acceptor-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-peer-acceptor-config">
    <config-name>default</config-name>
    <binding-address>192.168.103.144</binding-address>
    <binding-port>179</binding-port>
</bgp-peer-acceptor-config>
curl -u "admin:admin" -d @bgp-port.xml -X PUT http://192.168.103.144:8181/restconf/config/odl-bgp-peer-acceptor-config:bgp-peer-acceptor-config/default

It does not work. Please refer to the following

Edit 41-bgp-example.xml file

<module>
 <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-acceptor</type>
 <name>bgp-peer-server</name>
 <binding-address>0.0.0.0</binding-address>
 <binding-port>1790</binding-port>
</module>

d. Configure peer BGP

<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
    <neighbor-address>192.168.103.143</neighbor-address>
    <afi-safis>
        <afi-safi>
            <afi-safi-name>LINKSTATE</afi-safi-name>
        </afi-safi>
        <afi-safi>
            <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
            <receive>false</receive>
            <send-max>0</send-max> <!-- Npath again for this peer -->
        </afi-safi>
    </afi-safis>
    <timers>
        <config>
            <hold-time>90</hold-time>
            <connect-retry>10</connect-retry>
        </config>
    </timers>
    <transport>
        <config>
            <remote-port>179</remote-port>
            <passive-mode>false</passive-mode>
        </config>
    </transport>
    <config>
        <peer-type>EXTERNAL</peer-type>
     <peer-as>64513</peer-as>
    </config>
</neighbor>
curl -u "admin:admin" -X POST -H "Content-Type: text/xml" -d @bgp-peer.xml http://192.168.103.144:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors

Check peer configuration :

curl -u "admin:admin" -X GET http://192.168.103.144:8181/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors | python -m json.tool

Sources

wiki/sdn/opendaylight/bgpcepls.txt · Dernière modification: 2020/06/27 18:16 (modification externe)