BGP Command Reference
Document revision: | 1.5 (Thu Sep 22 12:50:17 GMT 2005) |
Applies to: | V2.9 |
General Information
Summary
The Border Gateway Protocol (BGP) allows setting up an interdomain dynamic routing system that automatically updates routing tables of devices running BGP in case of network topology changes.
MikroTik RouterOS supports BGP Version 4, as defined in RFC1771.
Starting from version v2.9 MikroTik RouterOS has a brand new BGP implementation, which provides advanced functionality not available in the previous versions.
Quick Setup Guide
To configure a BGP instance with AS number of 200 and establish a BGP session to the 10.0.11.11 peer from the AS 100, redistributing connected and static routes only, you should do the following:
-
Configure default BGP instance:
[admin@rb12] > /routing bgp instance set default as=200 redistribute-static=yes redistribute-connected=yes [admin@rb12] > /routing bgp instance print Flags: X - disabled 0 as=200 router-id=0.0.0.0 redistribute-static=yes redistribute-connected=yes redistribute-rip=no redistribute-ospf=no redistribute-other-bgp=no name="default" out-filter="" [admin@rb12] >
-
Add BGP peer:
[admin@rb12] > /routing bgp peer add remote-address=10.0.11.11 remote-as=100 instance=default [admin@rb12] > /routing bgp peer print Flags: X - disabled 0 remote-address=10.0.11.11 remote-as=100 multihop=no in-filter="" out-filter="" keepalive-time=0s hold-time=0s ttl=1 [admin@rb12] >
Note, that the peer should be configured accordingly in order BGP to work.
Attention! In this scenario the router has no input or output filters configured. This means that it can redistribute lots of unnecessary or harmful information to its peers. Always consider configuring proper routing filters before you configure BGP peering.
Specifications
Packages required: routing-testLicense required: Level3
Submenu level: /routing bgp
Standards and Technologies: RFC1771
Hardware usage: requires additional RAM for storing routing information (128MB recommended)
Related Documents
Description
The Border Gateway Protocol (BGP) is the core routing protocol of the Internet. It maintains a table of routes 'prefixes', which specify network layer reachability information (NLRI) between autonomous systems (AS). BGP is described as path vector protocol or policy routing protocol, referring to the way it chooses the best route towards destination. Unlike many other routing protocols, BGP does not use technical metrics to select the best path but rather administrative policies. The current version of BGP, Border Gateway Protocol 4, is specified in RFC 1771.
The routes learned by BGP protocol are installed in the route list with the distance of 200 for iBGP (Internal BGP) routes and of 20 for eBGP (External BGP) routes.
Additional Resources
Instances
Description
Submenu level: /routing bgp instanceProperty Description
as (integer: 0..65535) - BGP autonomous system numbername (name; default: "") - BGP instance nameout-filter (name; default: "") - output routing filter used by this BGP instanceredistribute-connected (yes | no; default: no) - if enabled, the router will redistribute the information about all connected routes, i.e., routes to the networks that can be directly reachedredistribute-ospf (yes | no; default: no) - if enabled, the router will redistribute the information about all routes learned by the OSPF protocolredistribute-other-bgp (yes | no; default: no) - specifies whether this BGP instance should redistribute to its peers routes learned by other BGP instancesredistribute-rip (yes | no; default: no) - if enabled, the router will redistribute the information about all routes learned by RIP protocolredistribute-static (yes | no; default: no) - if enabled, 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 on the routerrouter-id (IP address; default: 0.0.0.0) - the router identification string in form of an IP address. If no router-id is specified, it will be selected automatically based on the routing informationPeers
Submenu level: /routing bgp peerDescription
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.