bgpd is a Border Gateway Protocol 4 (BGP-4) protocol daemon. BGP-4 is described in RFC1771. bgpd also supports Multiprotocol Extension for BGP-4 (sometimes known as BGP-4+ or MBGP) which is described in RFC2283.
BGP-4 is one of the EGPs (Exterior Gateway Protocols) and is used for inter-domain routing.
Default configuration file of bgpd is bgpd.conf. bgpd search current directory first the search /usr/local/etc/bgpd.conf. All of bgpd's command must be configured in bgpd.conf.
bgpd specific invocation options are described below. Common options may also be specified (See also Common Invocation Options.).
First of all you must configure BGP router with router bgp command. To configure BGP router, you need AS number. AS number is an identification of autonomous system. BGP protocol uses the AS number for detecting the BGP connection is internal one or external one.
AS number is a digit between 1 and 65535. How to use AS number is described in RFC1930. AS number 64512 through 65535 are defined as private AS number. Private AS number must not to be advertised on the global Internet.
router bgp 1 neighbor 10.0.0.1 remote-as 2In this case my router, in AS-1, is trying to peer with AS-2 at 10.0.0.1.
This command must be the first command used when configuring a neighbor. If the remote-as is not specified, bgpd will complain like this:
can't find neighbor 10.0.0.1
router bgp 1 network 10.0.0.0/8This configuration example says that network 10.0.0.0/8 will be announced to all neighbors. Some vendor's routers don't advertise routes if they aren't present in its IGP routing tables; bgp doesn't care about IGP routes when announcing its routes.
Shutdown the peer. We can delete the neighbor's configuration by no neighbor PEER remote-as AS-NUMBER but all configuration of the neighbor will be deleted. When you want to preserve the configuration, but want to drop the BGP peer, use this syntax.
Set description of the peer.
Set up the neighbor's BGP version. VERSION can be:
When you connect to a BGP peer over an IPv6 link-local address, you have to specify the ifname of the interface used for the connection.
This command specifies an announced route's nexthop as being equivalent to the address of the bgp beast.
bgpd's default is to not announce the default route (0.0.0.0/0) even it is in routing table. When you want to announce default routes to the peer, use this command.
BGPd outputs logging information to a terminal or to the specified file. It includes routing updates and peer status change information. It also includes date, time, packet type, the peer's IP address, and other routing information.
1999/03/29 17:42:18 Update:[202.216.226.1] 130.58.0.0/16 med: 0 lpref: 0 nexthop: 202.216.226.1 aspath: 4691 3561 5119 3576 3782 i
When adding IPv6 routing information exchange feature to BGP. There was some proposals. IETF IDR working group finally take a proposal called Multiprotocol Extension for BGP. The specification is described in RFC2283. The protocol does not define new protocol. It defines new attribute to existing BGP. When it is used exchanging IPv6 routing information it is called BGP-4+. When it is used exchanging multicast routing information it is called MBGP.
bgpd supports Multiprotocol Extension for BGP. So if remote peer support the protocol, bgpd can exchange IPv6 and/or multicast routing information.
Traditional BGP does not have a feature to detect remote peer's capability whether it can handle other than IPv4 unicast routes. This is a big problem using Multiprotocol Extension for BGP to operational network. `draft-ietf-idr-bgp4-cap-neg-04.txt' is proposing a feature called Capability Negotiation. bgpd use this Capability Negotiation to detect remote peer's capability. If the peer is only configured as IPv4 unicast neighbor. bgpd does not send this Capability Negotiation packet.
By default, Zebra will bring up peering with minimal common capability of both sides. For example, local router have capability of unicast and multicast and remote router have capability of unicast. In this case, local router will establish the connection with unicast only capability. When there is no common capability Zebra send Unsupported Capability error then reset connection.
If you want to completely match capability with remote peer. Please use strict-capability-match command.
You may want to disable sending Capability Negotiation OPEN message optional parameter to the peer when remote peer does not implement Capability Negotiation. Please use dont-capability-negotiate command to disable the feature.
When remote peer does not have capability negotiation feature, remote peer will not send any capability at all. In that case, bgp configure the peer with configured capability.
You may prefer locally configured capability more than negotiated capability even though remote peer send capability. If the peer is congiured by override-capability, bgpd ignore received capability then override negotiated capability with configured value.
At the Internet Exchange point many ISPs are connected each other by external BGP peering. Normally these external BGP connection is done by full mesh method. As same as internal BGP full mesh formation, this method has a scaling problem.
This scaling problem is well known. Route Server is a method to resolve the problem. Each ISP's BGP router only peer to Route Server. Route Server serves BGP information exchange to other BGP routers. By applying this method, numbers of BGP connections is reduced from O(n*(n-1)/2) to O(n).
Unlike normal BGP router, Route Server must have several routing table for managing different routing policy of each BGP speaker. We call the routing tables as different view. bgpd can work as normal BGP router or Route Server or both at the same time.
Menu |
---|
Multiple instance |
BGP instance and view |
Routing policy |
Viewing the view |
To enable multiple view function of bgpd, you must turn on multiple instance feature beforehand.
BGP instance is a normal BGP process. The result of route selection goes to the kernel routing table. You can setup different AS at the same time when BGP multiple instance feature is enabled.
bgp multiple-instance ! router bgp 1 neighbor 10.0.0.1 remote-as 2 neighbor 10.0.0.2 remote-as 3 ! router bgp 2 neighbor 10.0.0.3 remote-as 4 neighbor 10.0.0.4 remote-as 5
BGP view is almost same as normal BGP process without the result of route selection does not go to the kernel routing table. BGP view is only for exchanging BGP routing information.
With this command, you can setup Route Server like below.
bgp multiple-instance ! router bgp 1 view 1 neighbor 10.0.0.1 remote-as 2 neighbor 10.0.0.2 remote-as 3 ! router bgp 2 view 2 neighbor 10.0.0.3 remote-as 4 neighbor 10.0.0.4 remote-as 5
You can set different routing policy for a peer. For example, you can set different filter for a peer.
bgp multiple-instance ! router bgp 1 view 1 neighbor 10.0.0.1 remote-as 2 neighbor 10.0.0.1 distribute-list 1 in ! router bgp 1 view 2 neighbor 10.0.0.1 remote-as 2 neighbor 10.0.0.1 distribute-list 2 in
This means BGP update from a peer 10.0.0.1 goes both BGP view 1 and view 2.
When the update is inserted into view 1 distribute-list 1 is applied. The
other hand, the update is inserted into view 2 distribute-list 2 is applied.
To display routing table of BGP view, you must specify view name.
This file documents the GNU Zebra software which manages common
TCP/IP routing protocols.
This is Edition 0.1, last updated 5 July 2000 of `The GNU Zebra
Manual', for Zebra Version 0.88.
Copyright (C) 1999, 2000 Kunihiro Ishiguro
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by Kunihiro Ishiguro.
Display routing table of BGP view NAME.
zebra configuration
===================
!
! Actually there is no need to configure zebra
!
bgpd configuration
==================
!
! This means that routes go through zebra and into the kernel.
!
router zebra
!
! BGP-4+ configuration
!
router bgp 7675
bgp router-id 10.0.0.1
!
ipv6 bgp network 3ffe:506::/32
ipv6 bgp neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 remote-as AS-NUMBER
ipv6 bgp neighbor 3ffe:1cfa:0:2:2a0:c9ff:fe9e:f56 route-map set-nexthop out
ipv6 bgp neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 remote-as AS-NUMBER
ipv6 bgp neighbor 3ffe:1cfa:0:2:2c0:4fff:fe68:a231 route-map set-nexthop out
!
ipv6 access-list all permit any
!
! Set output nexthop address.
!
route-map set-nexthop permit 10
match ipv6 address all
set ipv6 nexthop global 3ffe:1cfa:0:2:2c0:4fff:fe68:a225
set ipv6 nexthop local fe80::2c0:4fff:fe68:a225
!
! logfile FILENAME is obsolete. Please use log file FILENAME
!
log file bgpd.log
!
Dump all BGP packet and events to PATH file.
Dump BGP updates to PATH file.
Dump whole BGP routing table to PATH. This is heavy process.