Skip to main content.

BGP Module

BGP (Border Gateway Protocol) is a routing protocol which allows inter-AS (Autonomous System) route advertisements. The BGP module is bound to the "urn:loria:madynes:ensuite:yencap:module:BGP:1.0" namespace.

The BGP extension module for YencaP is available for download. Documents concerning a technical overview and user manual of the Toolkit are also widely available.

You can start from the following configuration file /etc/quagga/bgpd.conf. The password must be the same as in /etc/ensuite/yencap/modules.xml in the BGP module section.

!
! Zebra configuration saved from vty
!   2006/04/18 18:25:48
!
hostname localhost.localdomain
password zebra
log stdout
!
router bgp 7675
bgp router-id 10.0.0.1
network 10.0.0.0/8
network 10.0.0.0/10
!
line vty
!

Here is a sample of /etc/ensuite/yencap/modules.xml :

<module>
  <name>BGP</name>
  <xpath>/ycp:netconf/ycp:routing/bgp:bgp</xpath>
  <namespace>urn:loria:madynes:ensuite:yencap:module:BGP:1.0</namespace>
  <cache-lifetime>1000000</cache-lifetime>
  <parameters>
  	<host>127.0.0.1</host>
	<port>2605</port>
	<password>zebra</password>
	<allowxpath>true</allowxpath>
	<enable_pass></enable_pass>
  </parameters>
</module>

Before starting YencaP, zebra and bgpd must be started:

/etc/init.d/zebra start
/etc/init.d/bgpd start

Here is an example of a BGP configuration:

<bgp xmlns="urn:loria:madynes:ensuite:yencap:module:BGP:1.0">
  <bgprouter>
    <as-number>3</as-number>
    <neighbors>
      <neighbor>
        <ip-address>172.32.20.2</ip-address>
        <remote-as>1</remote-as>
      </neighbor>
      <neighbor>
        <ip-address>192.68.80.1</ip-address>
        <remote-as>2</remote-as>
      </neighbor>
    </neighbors>
    <address-families>
      <ipv4-address-family>
        <type>unicast</type>
        <neighbors>
          <neighbor>
            <ip-address>172.32.20.2</ip-address>
            <bind-filters>
              <route-map>
                <name>ROUTEMAP3</name>
                <direct>out</direct>
              </route-map>
            </bind-filters>
          </neighbor>
          <neighbor>
            <ip-address>192.68.80.1</ip-address>
            <bind-filters>
              <route-map>
                <name>ROUTEMAP3</name>
                <direct>out</direct>
              </route-map>
            </bind-filters>
          </neighbor>
        </neighbors>
      </ipv4-address-family>
    </address-families>
  </bgprouter>
  <filters>
    <as-path>
      <name>ALLOWED_AS</name>
      <state>permit</state>
      <regexp>^3_$</regexp>
    </as-path>
    <route-map>
      <map-tag>ROUTEMAP1</map-tag>
      <sequences>
        <seq-number>10</seq-number>
        <state>permit</state>
        <set>
          <weight>50</weight>
        </set>
      </sequences>
    </route-map>
    <route-map>
      <map-tag>ROUTEMAP2</map-tag>
      <sequences>
        <seq-number>10</seq-number>
        <state>permit</state>
        <set>
          <weight>100</weight>
        </set>
      </sequences>
    </route-map>
    <route-map>
      <map-tag>ROUTEMAP3</map-tag>
      <sequences>
        <seq-number>10</seq-number>
        <state>permit</state>
        <match>
          <as-path>
            <as-path-name>ALLOWED_AS</as-path-name>
          </as-path>
        </match>
      </sequences>
    </route-map>
  </filters>
</bgp>