Professional Documents
Culture Documents
Boarder Gateway Protocol: Protocol that runs inside an Enterprise(inside an AS ) is called IGP. While the
protocol that runs between the AS is called EGP. BGP is an example of EGP. BGP is the routing protocol of the
Internet.
Here we deal with BGP that runs on co-operate customer.
Autonomous System:
is a group of routers that fall inside a technical administration domain using ICP to exchange updates within that
domain.
1- 65535 (1-65411 public, 65412-65535 private)
Two types of AS:
1. Single home AS-----> Having only one exit point
2. Multi home AS ----> Two exit point (a Transit AS
Place of BGP:
a. Used for redundancy: Most of the person think about outgoing direction when they implement BGP, but its
the incoming connection when they implement BGP. Most of the org. are concerned with their web presence.
Company wants redundancy to the ISP. If one org. goes down or link down, they have redundancy to the other
ISP, so the co-operate Web-Server doesn't goes down.
Both ISP see the public IP of the org. and are advertised to the other ISP.
b. use of shortest path: Another uses of the BGP is to identify the shortest path. For eg. ISP1 may be the
1
shortest path to reach the Telecoummuter1.
BGP Facts:
1. BGP runs over on the top of TCP(port 179). OSPF and other IGP have their own layer 4 protocol.
2. TCP uses for reliability.
3. Updates are of course incremental and triggered.
4. Metric is the biggest you've ever seen. (It checks the a list of attribute and choose the path)
5. Slowest routing protocol on the planet to converge. (By design BGP is slow)
The org. will not receive the BGP tables from the ISP1 and ISP2 . They will configure the default route. Here you
can advertise to both ISP assigned IP block. So that you provide a redundant link to your ISP.
2. Partial Routes:
2
3. Full updates
Receives the full updates.
● BGP is technically a distance vector routing alog. But most call it a path vector protocol.
● Without tuning BGP behaves just like RIP.
Your router will determine the destination network based on the Hop count. Hop is ISP (As) not router.
Packets:
1. open --- Starts the session
2. keepalive ---DUH
3. Update--- Network reachability exchange
4. Notification—sth bad has happened, close session.
Tables:
1. Neighbor Table: the connected BGP friends (Manual configuration)
2. BGP tables : a list of all BGP routes, can be big.
List of all networks learned from each neighbor.
Can contain multiple paths to the destination network.
Contains BGP attributes for each paths.
3. Routing Tables: A list of the best routes.
3
BGP Implementation and Tuning:
IBGP VS EBGP
AS represents all of network under Authority. For IBGP neighborship formation the router should not be directly
connected.
4
BGP neighbor configuration:
5
the only difference is that IBGP has same AS no. in the neighbor command. The IBGP neighbor can be formed
between the routers that are not directly connected.
Which IP should be used for forming IBGP neighbor-ship between R1 and R4. So in order to maintain the proper
redundancy we use loopback addresses to form the neighborship.
R1(config)#router ospf 1
R1(config-router)# network 1.1.1.1 0.0.0.0 area 0
neighborship will never form, since R1 receives the packet from source IP 10.1.24.2 or 10.1.34.2. But R1 doesn't
recognise it as neighbor, as neighbor is formed with another loopback IP.
So change the source with update-source command. Update-source command is normally used only in IBGP.
To form EBGP relationship with loopback address use the ebgp-multihop command. For forming EBGP
neighbor relationship routers must be directly connected. For loopback it doesn't see as directly connected it
sees one Hop way.
6
R5(config-)# neighbor 4.4.4.4 egbp-multihop 2
R5(config)# neighbor 4.4.4.4 update-source lo5
two ways:
1. network command
2. redistribution
network command:
when you are talking about network command you'll realize two things
a. what network to advertise
b. what interface to from relationship on
In BGP there is no 2nd phase. Neighbor relationship should be formed statically.
7
R5(config-router)# network 50.0.0.0
OR
R5(config-router)# network 50.1.1.0 mask 255.255.255.0
Either you advertise the whole class block or type the exact subnet mask.
R#show ip bgp
Through redistribution:
(Here we put the filter that means you want to advertise only other network except those)
R5(config)#route-map FILTER
R5(config-route-map)#match ip address 50
R#show ip bgp
It will shows the bgp table. Those route with *> symbol (The best route) will only be entered into the routing table
of the router.
Note in R1 we can't see the routing table entries, i.e in BGP table we don't see the * symbol infront of the >
carate.
Two reasons:
1. BGP synchronization
2. BGP next hop processing
BGP Synchronization:
Do not use or advertise a route learned via IBGP until the same route has been learned from the internal routing
protocol.
8
Configuration:
R1(config)# router bgp 6500
R1(config-router)# no synchronization
Still we don't see the best route symbol in the BGP table.
Router(config-router)# no synchronization
Disables BGP synchronization so that a router will advertise routes in BGP without learning them via an IGP.
For BGP peers: Change next hop address on the advertised routes.
For IBGP peers: Don't change the Next hop address on the advertised routes.
Next-hop-self----> whatever the address It uses to form neighborship, advertise itself as next hop.
R4(confg)router bgp 5500
R4(config)# neighbor 1.1.1.1 next-hop-self
9
next-hop-self
This command forces all updates for this neighbor to be advertised with this router as next-hop.
The IP address used for next-hop-self will be the same as the source IP address of the BGP packet.
BGP States:
BGP cycles thru five states as it runs:
1. Idle--->searching for neigbors
2. Connect ---> TCP 3 way Handshake complete with neighbor
3. Open Sent--> BGP open message has been sent
4. Open Confirm---> Response received
5. Established----> BGP neighborship is established
10
If the router is in the active state, it has found the IP address in the neighbor statement and has created and sent
out a BGP open packet. However, the router has not received a response (open confirm packet) back.
11
BGP peer group allows you to assign configuration in groups, rather than to each individual neighbor.
12
Verify the o/p in each router. R1 gets the IBGP routes from both R2 and R3. R2 and R3 can't see the updates of
each others LAN in their routing table. This is because of Split Horizon.
Verifying BGP:
show ip bgp summary
show ip bgp--->bgp table
show ip bgp rib-failure
13
BGP Turing Attributes:
Optional Attributes:
– aggregator
– Multi-exit-descriminator (MED)
– weight
14
LAB:
15
AS Path Attributes:
The AS path is a well-known mandatory attribute. Whenever a route update passes through an autonomous
system, the autonomous system number is prepended (added) to that update when it is advertised to the next
EBGP neighbor.
The BGP next-hop attribute is a well-known mandatory attribute that indicates the next-hop IP address that is to
be used to reach a destination.
BGP routes autonomous system by autonomous system, not router by router. The next-hop attribute defines the
IP address of the border router that should be used as the next hop to the destination.
16
router B can change the next-hop attribute to itself if you use the neighbor next-hop-self command.
Origin Attribute:
Local Preference:
Local preference is a well-known discretionary attribute that provides an indication to routers in the autonomous
system about which path is preferred to exit the autonomous system. A path with a higher local preference is
preferred.
17
MED Attribute:
18
19
20
the router B MED attribute is set to 150, and the router C MED attribute is set to 200. When router A receives
updates from routers B and C, it chooses router B as the best next hop because its MED of 150 is less than
router C.
Unlike local preference, the MED is exchanged between autonomous systems. MED influences inbound traffic to
an autonomous system, and local preference influences outbound traffic.
21
The weight attribute is a Cisco attribute for path selection. The weight is configured locally on a router and is not
propagated to any other routers. This attribute applies when you are using one router with multiple exit points in
autonomous system, as opposed to the local preference attribute, which is used when two or more routers
provide multiple exit points.
The weight can have a value from 0 to 65535. By default, paths that the router originates have a weight of
32768, and other paths have a weight of 0.
In the example, router A sets the weight of updates coming from router B to 200 and the weight of those coming
from router C to 150. Because the weight for router B is higher than router C, router A uses router B as a next
hop to reach 172.20.0.0.
22
changing the attributes
weight:
weight: 0
per neighbor basis:
Local preference:
MED:
Default Value: 0
Lower MED is preferred.
23
24