Border Gateway Protocol (BGP) Routing Protocol

Draft

Document revision 5-Sep-2002
This document applies to the MikroTik RouterOS 2.6

Overview

The Border Gateway Protocol (BGP) is an Exterior Gateway Protocol (EGP). It allows setting up an interdomain routing system that automatically guarantees the loop-free exchange of routing information between autonomous systems.

MikroTik RouterOS supports BGP Version 4, as defined in RFC1771.

The MikroTik RouterOS implementation of the BGP has the following features:

Contents of the Manual

The following topics are covered in this manual:

Installation

The BGP feature is included in the bgp package. The package file bgp-2.6.y.npk can be downloaded from MikroTik’s web page www.mikrotik.com. To install the package, please upload it to the router with ftp and reboot. You may check to see if the routing package is installed with the command:

[admin@MikroTik] > system package print
Flags: I - invalid
  #   NAME                  VERSION              BUILD-TIME           UNINSTALL
  0   system                2.6beta4             aug/09/2002 20:22:14 no
  1   rip                   2.6beta4             aug/09/2002 20:33:41 no
  2   ppp                   2.6beta4             aug/09/2002 20:28:01 no
  3   plist                 2.6beta4             aug/09/2002 20:32:58 no
  4   pppoe                 2.6beta4             aug/09/2002 20:29:18 no
  5   pptp                  2.6beta4             aug/09/2002 20:28:43 no
  6   ssh                   2.6beta4             aug/09/2002 20:25:31 no
  7   advanced-tools        2.6beta4             aug/09/2002 20:53:37 no
  7   bgp                   2.6beta4             aug/09/2002 20:34:22 no
  9   ipsec                 2.6beta4             aug/09/2002 20:24:51 no
 10   ospf                  2.6beta4             aug/09/2002 20:34:08 no
[admin@MikroTik] >

Hardware Resource Usage

The BGP requires additional RAM for storing the routing information. It is recommended to have 128MB or more RAM.

BGP Description

For BGP description and implementation guidelines please refer to the readings mentioned in the list of Additional Resources. Current document discusses BGP configuration for MikroTik RouterOS.

BGP Setup

The BGP management can be accessed under the /routing bgp submenu.

Setting the Basic BGP Configuration

To enable the BGP and set the AS number, use the /routing bgp set command, for example:

[admin@MikroTik] routing bgp> print
                   enabled: no
                        as: 0
                 router-id: 0.0.0.0
       redistribute-static: no
    redistribute-connected: no
          redistribute-rip: no
         redistribute-ospf: no
                     state: disabled
[admin@MikroTik] routing bgp> set as=65002 router-id=159.148.147.206 enabled=yes \
\... redistribute-connected=yes
[admin@MikroTik] routing bgp> print
                   enabled: yes
                        as: 65002
                 router-id: 159.148.147.206
       redistribute-static: no
    redistribute-connected: yes
          redistribute-rip: no
         redistribute-ospf: no
                     state: running
[admin@MikroTik] routing bgp>

Argument description:

enabled - enable or disable the BGP
as - autonomous system number
router-id – the Router ID
redistribute-connected – if set to yes, then the router will redistribute the information about all connected routes, i.e., routes to networks, that can be directly reached from the router
redistribute-static – if set to yes, then the router will redistribute the information about all static routes added to its routing database, i.e., routes, that have been created using the /ip route add command of the router
redistribute-rip – if set to yes, then the router will redistribute the information about all routes learned by the RIP protocol
state - status of the BGP:

Usually you want to redistribute connected and static routes, if any. Therefore change the settings for these arguments and proceed to the BGP networks.

BGP Network

To tell the BGP router which networks to advertise, use the /routing bgp network add command:

[admin@MikroTik] routing bgp network> add network=159.148.150.192/27
[admin@MikroTik] routing bgp network> print
  # NETWORK
  0 159.148.150.192/27
[admin@MikroTik] routing bgp network>

Here, the network argument is used to specify the network/mask to advertise. You can add to the list as many networks as required. Also, you can use 0.0.0.0/0 to advertise all networks.

Note, that the OSPF uses network list for different purpose - to determine where to send updates.

BGP Peers

You need to specify the BGP peer with whom you want to exchange the routing information. The BGP exchanges routing information only if it can establish a TCP connection to its peer. You can add as many peers as required, for example:

[admin@MikroTik] routing bgp peer> add remote-address=192.168.0.254 remote-as=217
[admin@MikroTik] routing bgp peer> print
  # REMOTE-ADDRESS  REMOTE-AS MULTIHOP ROUTE-REFLECT PREFIX-LIS... PREFIX-LI...
  0 192.168.0.254   217       no       no            none          none
[admin@MikroTik] routing bgp> peer print status
  # REMOTE-ADDRESS  REMOTE-AS STATE          ROUTES-RECEIVED
  0 192.168.0.254   217       connected      1
[admin@MikroTik] routing bgp>

Argument description:

remote-address - address of the remote peer
remote-as - AS number of the remote peer
multihop - if set to yes, allows BGP sessions, even when the neighbor is not on a directly connected segment. The multihop session is not established if the only route to the multi-hop peer's address is the default route (0.0.0.0).
route-reflect - defines whether to further redistribute routes learned from the router of the same AS or not. If enabled, can significantly reduce traffic between routers in the same AS
prefix-list-in - Name of the filtering prefix list for receiving routes
prefix-list-out - Name of the filtering prefix list for advertising routes
state - Shows the status of the BGP connection to the peer. Can be not-connected or connected
routes-received - Shows the number of received routes from this peer

The prefix lists should be defined under the /routing prefix-list. See corresponding manual for the details on using prefix lists.

Troubleshooting

Additional Resources

Recommended readings for guidelines on building BGP networks:

BGP Application Examples

(Not complete yet)


© Copyright 1999-2002, MikroTik