Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

BGP Attributes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 54

NAME: DANIEL RICARDO

LAST NAME: RODRIGUEZ LOPEZ


FIRST QUARTER PRACTICE

PROF.: NELSON MIESES

BGP ATTRIBUTES

Contents

CONTENTS
BGP............................................................................................................................. 4
How does it works?.................................................................................................. 4
BGP attributes............................................................................................................ 5
Practice example........................................................................................................ 7
The topology........................................................................................................... 7
R1 configuration...................................................................................................... 8
R2 configuration...................................................................................................... 8
R3 configuration.................................................................................................... 10
R5 configuration.................................................................................................... 10
R6 configuration.................................................................................................... 12

Contents
ISP configuartion................................................................................................... 14
Show Commands...................................................................................................... 16
R1.......................................................................................................................... 16
Show BGP........................................................................................................... 16
Show BGP summary........................................................................................... 16
SHow ip BGP neighbor........................................................................................ 17
R2.......................................................................................................................... 19
show ip BGP....................................................................................................... 19
Show BGP summary........................................................................................... 19
Show IP BGP neighbor........................................................................................ 20
R3.......................................................................................................................... 27
show ip BGP....................................................................................................... 27
Show BGP summary........................................................................................... 27
Show IP BGP neighbor........................................................................................ 27
R5.......................................................................................................................... 30
show ip BGP....................................................................................................... 30
Show BGP summary........................................................................................... 30
Show IP BGP neighbor........................................................................................ 31
R6.......................................................................................................................... 35
show ip BGP....................................................................................................... 35
Show BGP summary........................................................................................... 36
Show IP BGP neighbor........................................................................................ 36
ISP......................................................................................................................... 40
SHow ip bgp....................................................................................................... 40
Show BGP summary........................................................................................... 41
Show IP BGP neighbor........................................................................................ 42
Conclusion................................................................................................................ 49
Bibliography............................................................................................................. 50

Introduction

In this document Ill be talking about BGP, the basic knowledge to comprehend what
is BGP how does it works and also how to configure. Also Ill mention some
examples of how to use BGP command with route maps in order to modify BGP
attributes. Ill show how this practice was configured and how does it works, and
why it works like it does.
Ill speak about the best path selection process and the steps that BGP makes to
take a decision.

BGP

BGP
First we must understand what BGP is, also known as Border Gateway Protocol is
used among the Enterprises to connect to their Internet service Providers. BGP is
defined by RFC 1771 as is an inter-Autonomous System routing protocol. It is built
on experience gained with EGP as defined in RFC 904
BGP permits to create inter-domain routing without loops between autonomous
systems (AS). An autonomous system is a group of routers under a single tech
administration. Routers between a single autonomous system can use multiple IGP
or Interior Gateway Protocols to exchange routing information within the
autonomous system. Routers can also use Exterior Gateway Protocols (EGP) to
communicate outside the autonomous systems.
HOW DOES IT WORKS?
BGP uses TCP as a transport protocol in the port 179, two routers make a TCP
connection between them. This two routers are now partners or neighbors that
exchange messages to open and confirm connection parameters. BGP neighbors
initially exchange their complete BGP routing table, after that they send updates
messages every time this table changes. To maintain active the connection between
them, they send a maintenance signal so it grants the connection between BGP
neighbors.

As seen on the image above, the AS 5042 is serving as a highway between AS


6310 and AS 100 also from this image we can tell that two routers are in the same
autonomous system so they are forming an iBGP or internal BGP, in case of AS 100
and AS 6310 they are forming a eBGP or exterior BGP topology.

BGP
Enabling BGP is simple as typing: router bgp 100 where the 100 is the BGP
autonomous system. To make a link between Neighbors we use this command
within the BGP routing configuration command prompt: neighbor { neighbor ipaddress} remote-as {neighbor AS number}

BGP Attributes

BGP ATTRIBUTES
Now that we got the basics of BGP, Im going to explain what are the BGP attributes:
Basically BGP uses this algorithm to choose the best path to a route, this can be
modified manually so we can manipulate which path its best for BGP in what is
called policy-based routing; in order to do this we must understand how this
selection process works, thats where it comes the attributes.

These are ten most common BGP attributes. BGP only choose one best route to
traffic toward the destination.
An attribute is either well-known or optional, mandatory or discretionary, and
tran- sitive or nontransitive. An attribute might also be partial.
Not all combinations of these characteristics are valid; path attributes fall into
four separate categories:
Well-known mandatory
Well-known discretionary
Optional transitive
Optional nontransitive
Only optional transitive attributes might be marked as partial
The BGP path decision process is based on BGP attributes; these are discussed in
the upcoming BGP Attributes section. When faced with multiple routes to the
same destination, BGP chooses the best route for routing traffic toward the

BGP Attributes
destination. To choose the best route, BGP considers only routes with no
autonomous system loops and a valid, reachable next-hop address. The following
process summarizes how BGP chooses the best route on a Cisco router:
Step 1. Prefer the route with the highest weight. (The weight is Cisco proprietary
and is local to the router only.)
Step 2. If multiple routes have the same weight, prefer the route with the highest
local preference. (The local preference is used within an autonomous system.)
Step 3. If multiple routes have the same local preference, prefer the route that was
originated by the local router. (A locally originated route has a next hop of 0.0.0.0 in
the BGP table.)
Step 4. If the local router originated none of the routes, prefer the route with the
shortest AS-path.
Step 5. If the AS-path length is the same, prefer the lowest-origin code (IGP < EGP
< incomplete).
Step 6. If all origin codes are the same, prefer the path with the lowest MED. (The
MED is exchanged between autonomous systems.) The MED comparison is done
only if the neighboring autonomous system is the same for all routes considered,
unless the BGP always-compare-med router configuration command is enabled.
Step 7. If the routes have the same MED, prefer external paths (eBGP) over internal
paths (iBGP).
Step 8. If only internal paths remain, prefer the path through the closest IGP neighbor. This means that the router prefers the shortest internal path within the
autonomous system to reach the destination (the shortest path to the BGP next
hop).
Step 9. For eBGP paths, select the oldest route, to minimize the effect of routes
going up and down (flapping).
Step 10. Prefer the route with the lowest neighbor BGP router ID value.
Step 11. If the BGP router IDs are the same, prefer the route with the lowest
neighbor IP address.

Configuration

PRACTICE EXAMPLE
Now Ill give an example of a configuration, using iBGP, eBGP and EIGRP scenario.
Well in this scenario, the ISP is using BGP to exchange routing information to
communicate Site A and Site B, in Site A we got 3 routers of an international
company and its partners, R2 its the central an it connects the other 2 company
associates, in site B we got an extension of this company, with 2 buildings this
buildings use EIGRP to communicate internally. We need to connect all buildings
through BGP. Site B has been given with the BGP-AS 64512 meanwhile in site A
central router (R2) AS is 300, R1 is AS 742 and R3 use AS 200. You were asked to
connect both sites using BGP, in addition you were tasked to prevent associated
networks (R1, R3) in site A from receiving route information from R2. In site B you
were tasked to configure both eBGP and iBGP to allow redundancy. Also the link
between R5 and R6 must be used only in case that the primary link to the ISP fails.
TASKS:

Communicate both sites with BGP.


Use AS_Path attribute in site A to prevent R1 and R3 from receiving routing
information form R2.
Site B use MED and Local Preference in order to R5 and R6 exchange
information.
Link between R5 and R6 will be only used as a backup in case the primal link
to ISP fails.

THE TOPOLOGY

Configuration

R1 CONFIGURATION
en
conf t
host R1
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 10.3.3.1 255.255.255.0
exit
interface Serial1/1
ip address 172.24.1.18 255.255.255.252
no shutdown

Configuration
exit
router bgp 742
neighbor 172.24.1.17 remote-as 400
network 10.3.3.0 mask 255.255.255.0
do wr
R2 CONFIGURATION
en
conf t
host R2
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 10.2.2.1 255.255.255.0
interface Serial1/0
ip address 192.168.2.6 255.255.255.252
no shutdown
exit
interface Serial1/1
ip address 172.24.1.17 255.255.255.252
clock rate 128000
no shutdown
exit
interface Serial1/2
ip address 192.168.1.10 255.255.255.252
no shutdown

Configuration
exit
router bgp 400
neighbor 192.168.2.5 remote-as 200
neighbor 172.24.1.18 remote-as 742
neighbor 192.168.1.9 remote-as 159
network 10.2.2.0 mask 255.255.255.0
do clear ip bgp *
ip as-path access-list 1 deny ^200$ To deny R2 BGP routing information to be
advertised, the carat (^) starts the input string and designates. The $ character
matches the end of an input string.
ip as-path access-list 1 permit .* This allow permits all other networks
router bgp 400
neighbor 172.24.1.18 filter-list 1 out In this case is out because we are denying any
outbound routing information from R2
do clear ip bgp *
ip route 0.0.0.0 0.0.0.0 s1/2
do wr
R3 CONFIGURATION
en
conf t
host R3
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 10.1.1.1 255.255.255.0
exit

Configuration
interface Serial1/0
ip address 192.168.2.5 255.255.255.252
clock rate 128000
no shutdown
exit
router bgp 200
neighbor 192.168.2.6 remote-as 400
network 10.1.1.0 mask 255.255.255.0
do wr
R5 CONFIGURATION
en
conf t
host R5
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 172.16.64.1 255.255.255.0
exit
interface Serial1/0
ip address 192.168.1.6 255.255.255.252
no shutdown
exit
interface Serial1/2
ip address 172.16.1.1 255.255.255.0
clock rate 128000

Configuration
no shutdown
exit
router eigrp 1
network 172.16.0.0
router bgp 64512
neighbor 172.16.32.1 remote-as 64512
neighbor 172.16.32.1 update-source lo0 I use the "update-source" command, for
example, in a case where you may have multiple paths to the peer and wish to use
the loopback address as the source so that the loss of the physical link does not
affect your peering.
ip route 172.16.0.0 255.255.0.0 null0 The Null0 "interface" is a virtual bit-bucket.
Meaning it's a trash can to route things to. There's automatically a Null0 route
(called a Discard Route) created when you do a summary-address or area-range or
things like that with routing protocols.
router bgp 64512
neighbor 192.168.1.5 remote-as 159
network 172.16.0.0
router bgp 64512
neighbor 172.16.32.1 next-hop-self The next-hop-self command allows you to force
BGP to use a specific IP address as the next hop.
do clear ip bgp *
route-map PRIMARY_T1_IN permit 10 I used a route map in order to manipulate BGP
local preference attribute
set local-preference 159
exit
router bgp 64512
neighbor 192.168.1.5 route-map PRIMARY_T1_IN in Here we apply the route map
for the local-preference attribute to be preferred on the inbound traffic
do clear ip bgp * soft A soft reboot is required sometimes in order to apply some
changes to the BGP

Configuration
route-map PRIMARY_T1_MED_OUT permit 10 Here same as local preference but in
this case for MED and outbound traffic
set Metric 50
exit
router bgp 64512
neighbor 192.168.1.5 route-map PRIMARY_T1_MED_OUT out
do clear ip bgp * soft
do wr
R6 CONFIGURATION
en
conf t
host R6
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 172.16.32.1 255.255.255.0
exit
interface Serial1/1
ip address 192.168.1.2 255.255.255.252
clock rate 128000
no shutdown
exit
interface Serial1/2
ip address 172.16.1.2 255.255.255.0
no shutdown

Configuration
exit
router eigrp 1
network 172.16.0.0
router bgp 64512
neighbor 172.16.64.1 remote-as 64512
neighbor 172.16.64.1 update-source lo0
ip route 172.16.0.0 255.255.0.0 null0
router bgp 64512
neighbor 192.168.1.1 remote-as 159
network 172.16.0.0
router bgp 64512
neighbor 172.16.64.1 next-hop-self
do clear ip bgp *
route-map SECONDARY_T1_IN permit 10
set local-preference 125
exit
router bgp 64512
neighbor 192.168.1.1 route-map SECONDARY_T1_IN in
do clear ip bgp * soft
route-map SECONDARY_T1_MED_OUT permit 10
set Metric 75
exit
router bgp 64512
neighbor 192.168.1.1 route-map SECONDARY_T1_MED_OUT out
do clear ip bgp * soft
do wr
ISP CONFIGUARTION

Configuration

en
conf t
host ISP
no ip domain-lookup
line con 0
logging synchronous
exec-timeout 0 0
interface Loopback0
ip address 192.168.100.1 255.255.255.0
exit
interface Serial1/0
ip address 192.168.1.5 255.255.255.252
clock rate 128000
no shutdown
exit
interface Serial1/1
ip address 192.168.1.1 255.255.255.252
no shutdown
exit
interface Serial1/2
ip address 192.168.1.9 255.255.255.252
no shutdown
exit
router bgp 159
neighbor 192.168.1.6 remote-as 64512
neighbor 192.168.1.2 remote-as 64512

Configuration
neighbor 192.168.1.10 remote-as 400
network 192.168.100.0
do clear ip bgp *
router bgp 159
neighbor 192.168.1.6 default-originate default-information originate causes the
default route to be artificially generated and injected into the BGP RIB, regardless of
whether it is present in the routing table.
neighbor 192.168.1.2 default-originate

Show commands

neighbor 192.168.1.10 default-originate


exit
interface loopback 10
ip address 10.0.0.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 ser 1/2
do wr
SHOW COMMANDS
R1
SHOW BGP

SHOW BGP SUMMARY

SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

R2
SHOW IP BGP

SHOW BGP SUMMARY

Show commands
SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

Show commands

Show commands

Show commands

Show commands

R3
SHOW IP BGP

SHOW BGP SUMMARY

SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

R5
SHOW IP BGP

SHOW BGP SUMMARY

Show commands

SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

Show commands

R6
SHOW IP BGP

Show commands
SHOW BGP SUMMARY

SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

Show commands

ISP
SHOW IP BGP

Show commands

SHOW BGP SUMMARY

Show commands
SHOW IP BGP NEIGHBOR

Show commands

Show commands

Show commands

Show commands

Show commands

Show commands

Conclusion

CONCLUSION
BGP is a very robust and complex routing protocol, and thats why is so important to
learn about it, this is not even the 5% of what this protocol is capable of but at least
we got the basics of how it works, and how it select a best path to a route.

Bibliography

BIBLIOGRAPHY
http://networkengineering.stackexchange.com/questions/14639/how-looking-glassserver-output-should-be-decoded
http://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/1375325.html
https://en.wikipedia.org/wiki/Border_Gateway_Protocol
https://supportforums.cisco.com/discussion/11303951/difference-between-defaultoriginate-and-network-0000-bgp
http://www.cisco.com/cisco/web/support/LA/7/76/76167_bgp-toc.html
http://www.powerfast.net/bgp/Routing_Pol9.html
https://learningnetwork.cisco.com/thread/3985
http://www.ietf.org/rfc/rfc1771.txt?number=1771
Teare, Diane, Vachon, Bob and Graziani, Rick. 2015. Implementing Cisco IP
Routing (ROUTE) Foundation Learning Guide. Indianapolis, IN 46240 USA Published
by Cisco Press , 2015. ISBN-13: 978-1-58720-456-2 ISBN-10: 1-58720-456-8 .

You might also like