Border Gateway Protocol (BGP) |
|
BGP for Beginners
Introduction
Here we start a bgp instance for AS 100, set router-id to the network address we announce (to easily find it in show listing), announce two networks wich are directly attached, describe our neighbors with their ip addresses and AS's, set distance (metric) for routes, learned from bgp to 150. In fact, this is the local network, with private ip and AS ranges, and bgp is running to backup ospf, which is described below. So, this bgp instance lets ospf routes dominate over bgp.
Network Diagram ![]()
Configuration Okapi(config)# router bgp 100
Peering with Internet Exchange Point
Introduction In this example we want to peer with Internet eXchange point (IX). An Internet exchange point (IX or IXP) is a physical infrastructure that allows different Internet service providers (ISPs) to exchange Internet traffic between their networks (autonomous systems) by means of mutual peering agreements, which allow traffic to be exchanged without cost.
Configuration Okapi(config)# router bgp 111 Announce our networks to the peer: Okapi(config-router)# network 1.2.3.0/19 Send only aggregated prefixes: Okapi(config-router)# aggregate-address 1.2.3.0/19 summary-only Set IX point as neighbor: Okapi(config-router)# neighbor a.b.c.100 remote-as 666 Obey to IX rules that make us leave AS-path untouched: Okapi(config-router)# neighbor a.d.c.100 attribute-unchanged as-path
Simple Routing Desicion
Introduction We have one BGP router (Router A), two upstreams. We want to prefer routes received from peer Router B no matter what (means AS-patch, better route exists, etc.)
Network Diagram ![]()
Configuration Okapi(config)# router bgp 100 The configuration above has its bad sides too. Only routes that HAVE NOT been announced by peer Router B and HAVE been announced by peer Router C will get into the routing table. So the following configuration has no sense when accepting full feeds from both peers, as only routes coming from peer Router B will be installed. It is useful when only partial feed is received from peer Router B.
BGP Routes Filtering
Introduction
Sometimes we don't want to send or receive BGP routes updates of a particular network to one of its peer. This can be achieve by using BGP routes filtering. In this example, Router C sends the BGP updates of network 50.10.0.0/16 to Router A. But we don't want to send BGP updates of network 50.10.0.0/16 to Router B, so we define an access-list and apply it to the out going updates to peer Router B.
Network Diagram
![]()
Configuration
Router A Okapi(config)# access-list 1 deny 50.10.0.0 0.0.255.255
AS-Path Filtering
Introduction Just like Route Filtering, BGP Filtering can be done on the basis of AS Number called Path Filtering. In this example, we don't want to send BGP updates of network 50.10.0.0/16 to Router B, in order to prevent the transmission of any updates originated from AS300 to AS200 define an access-list and apply it to the out going updates to AS 200.
Network Diagram
![]()
Configuration
Router A Okapi(config)# router bgp 100 Configure as-path access-list: Okapi(config)# ip as-path access-list BLAH deny ^200$ Prepending Scenario We want to apply different prepending to different prefixes.
Configuration Okapi(config)# router bgp 123 Okapi(config)# ip prefix-list PL1 seq 10 permit 192.168.1.0/24 Okapi(config)# route-map ADVERTS permit 10 Okapi(config)# route-map ADVERTS permit 20 In the above example, we apply the ADVERTS route-map to prefixes we announce to the neighbor. The ADVERTS route-map has 2 sections. Anything matching prefix-list PL1 will be padded twice, and anything matching PL2 will be padded 3 times.
Simple Router Reflector
Introduction The route reflector (RR) offers an alternative to the logical full-mesh requirement of internal border gateway protocol (iBGP). A RR acts as a focal point for iBGP sessions. The purpose of the RR is concentration. Multiple BGP routers can peer with a central point, the RR - acting as a route reflector server - rather than peer with every other router in a full mesh. All the other iBGP routers become route reflector clients. This example show a simple route reflector configuration for IPv4.
Network Diagram ![]()
Configuration Okapi(config)# bgp multiple-instance
Accepting only default route from BGP peer
Network Diagram
![]()
Configuration
Router A Configure Prefix-list for default route Okapi(config)# ip prefix-list DEFGWONLY seq 5 permit 0.0.0.0/0 Apply the Prefix-list: Okapi(config)# router bgp 100 |