Internet Routing Architectures (CISCO):Configuring Basic BGP Functions and Attributes
Previous Table of Contents Next
In RTF's configuration, you can see the ebgp-multihop 2 command being used as part of the neighbor configuration. This is an indication that the exterior BGP peer is not directly connected and can be reached at maximum two hops away. Remember that ebgp-multihop is only applicable with EBGP and not IBGP. RTC configuration:
ip subnet-zero
interface Serial2/1 ip address 172.16.20.1 255.255.255.0
router bgp 1 neighbor 172.16.20.2 remote-as 3 no auto-summary
ip classless
RTD configuration:
ip subnet-zero
interface Serial0/0 ip address 192.68.12.1 255.255.255.0
router ospf 10 network 192.68.0.0 0.0.255.255 area 0
The following is an example of how the peer connection will look after the neighbors are in an established state. From RTF's point of view, neighbor 172.16.2.254 is an internal neighbor that belongs to AS3. The neighbor connection is running BGP version 4 with a table version of 2. The table version changes every time the BGP table gets updated. A table version that increments rapidly is an indication of an unstable BGP neighbor session.
RTF's other neighbor 192.68.12.1 is also in an established state. This is an external neighbor that belongs to AS2. Note that the display indicates that this neighbor is two hops away (as configured in the ebgp-multihop).
RTF#show ip bgp neighbor BGP neighbor is 172.16.2.254, remote AS 3, internal link BGP version 4, remote router ID 172.16.2.254 BGP state = Established, table version = 2, up for 22:36:09 Last read 00:00:10, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 5 seconds Received 1362 messages, 0 notifications, 0 in queue Sent 1362 messages, 0 notifications, 0 in queue Connections established 2; dropped 1 Connection state is ESTAB, I/O status: 1, unread input bytes: 0 Local host: 172.16.1.2, Local port: 11008 Foreign host: 172.16.2.254, Foreign port: 179
BGP neighbor is 192.68.12.1, remote AS 2, external link BGP version 4, remote router ID 192.68.5.2 BGP state = Established, table version = 2, up for 22:13:01 Last read 00:00:00, hold time is 180, keepalive interval is 60 seconds Minimum time between advertisement runs is 30 seconds Received 1336 messages, 0 notifications, 0 in queue Sent 1336 messages, 0 notifications, 0 in queue Connections established 1; dropped 0 External BGP neighbor may be up to 2 hops away. Connection state is ESTAB, I/O status: 1, unread input bytes: 0 Local host: 192.68.5.1, Local port: 11016 Foreign host: 192.68.12.1, Foreign port: 179
Route Filtering and Attribute Manipulation Route filtering and attribute manipulation are the basis of setting BGP policies. This section will describe the following:
BGP route maps Identifying and filtering routes based on the NLRI Identifying and filtering routes based on the AS_path
For new BGP configuration, such as attribute manipulation or filtering, to take place, you should reset the BGP session by using the following command:
clear ip bgp [* | address | peer-group][soft [in|out]]
Refer to Chapter 11, "Configuring Effective Internet Routing Policies," for more details.
BGP Route Maps Route maps are used with BGP to control and modify routing information and to define the conditions by which routes are redistributed between routing domains.
The map tag is a name that identifies the route map, and the sequence number indicates the position that an instance of the route map is to have in relation to other instances of the same route map. (Instances are ordered sequentially.) You might, for example, use the following commands to define a route map named MYMAP:
route-map MYMAP permit 10 ! First set of conditions goes here. route-map MYMAP permit 20 ! Second set of conditions goes here.
When BGP applies MYMAP to routing updates, it applies the lowest instance first (in this case, instance 10). If the first set of conditions is not met, the second instance is applied, and so on, until either a set of conditions has been met, or there are no more sets of conditions to apply.
The condition portion of a route map is set by using the match and set commands. The match command specifies criteria that must be matched, and the set command specifies an action that is to be taken if the routing update meets the conditions defined by the match command. Following is an example of a simple route map:
route-map MYMAP permit 10 match ip address 1 set metric 5
access-list 1 permit 1.1.1.0 0.0.0.255
The access list is a way to identify routes. There are two types of access lists, standard and extended; the main difference is that a standard access list is applied to the source IP address, whereas an extended access list is applied to source and destination or source and network mask. The following global command defines a standard access list; the extended access list will be covered in this chapter at the point it is used in context.
A standard access list is used to match on a particular source IP network or host, to permit or deny a specific routing update. The access list number falls between 1 and 99.
In this example, access-list 1 identifies all routes of the form 1.1.1.X (note the inverse mask notation 0.0.0.255). A routing update of the form 1.1.1.X will match the access list and will be propagated (because of the permit keyword) with a metric set to 5. The logic will then break out of the list of route map instances because a match has occurred. When an update does not meet the criteria of a route map instance, BGP applies the next instance, and so on, until an action is taken, or there are no more routemap instances to apply. If the update does not meet any criteria, the update is not redistributed or controlled. The route map can be applied on the incoming (in) or the outgoing (out) BGP updates. The following is an example of the route map MYMAP applied on the outgoing updates toward BGP neighbor 172.16.20.2: