Create
Learn
Share

BGP

rename
beef410's version from 2018-04-17 15:52

General

Question Answer
Full updatesOnly sent when a router initially becomes neighbors, only partials after
NeighborsNeighbor relationship is formed before routes are exchanged and are maintained with keep alives.
(config)#router bgp <as>Enter BGP config mode for the listed AS
(config-router)#neighbor <ip> remote-as <AS>All neighbors must be manually configured with IP and the AS of the neighbor
sh ip bgp neighborNeighbor IP's internal/external/rid/BGP state/TCP state
sh ip bgp summarylocal info and basic neighbor info AS/IP/up/down/table versions
sh ip bgpStatus codes, networks, tables version, RID, weight. Use a specific IP to see next hop info/(inaccessible)
LoopbackLoopbacks are often used for BGP adjacencies. Loopback adjacency will require ebgp-multihop and update-source loopback commands. May also need a static route that points the loopback.
(config-router)#ebgp-multihop <hopcount>Allows eBGP neighbors not on directly connected networks. Best practice is to use lowest possible hopcount
(config-router)#neighbor <ip> update-source loopback#Allows BGP to peer with a loopback
*>Valid* and Best> route, what BGP is using.
(config-router)#network <ip> mask <mask>Network to be advertised, works like EIGRP
(config-router)#neighbor <ip> next-hop-selfNeeded for situations when an out-of-local AS route is in the iBGP table. In this case the remote AS source will remain next-hop for IP instead of updating to the actual destination IP within the remote AS.
memorize

States

Question Answer
IdleInitial state, if connection is staying here check IP addr, make sure local router has a route to the IP
ConnectA TCP connection request has been sent but a response has not yet been received.
OpenSentThe TCP connection has completed by receiving an Open from the peer.
ActiveBGP speaker is continuing to attempt to create a peering, has sent a connection request but isn't receiving an Open back
OpenConfirmBGP speaker is waiting for a keepalive, once one is received moves to established
Establishedyay, we're peers
memorize

Best Practices for use

Question Answer
UseCompany is connect to more than one AS or ISP
UseThe routing policy of your org and ISP differ
UseYour company is an ISP and other AS's use yours as a transit domain
UseIf your AS has more than one connection to other AS's
Don'tWhen path determination through your AS as one foreign AS reaches another is unimportant
Don'tRouter resources are limited
Don'tLow bandwidth connection between multiple AS, use static/default for low bw links
memorize

Peering

Question Answer
Connection orientedTCP port 179, BGP establishes its connection before routing updates occurs
ASBGP neighbors do not need to be in the same AS to peer and exchange tables
Internal BGPBGP peer in the same AS
External BGPBGP peer in a different AS, should ideally be directly connected
memorize

Advertising

Question Answer
Network statementsMasks are not required but recommended, defaults to classful addressing without
(config-router)#network <ip> mask <mask>Advertise the listed network address
(config-router)#bgp router-id <ip>manually set RID, BGP will try to use highest IP loopback automatically at startup though.
memorize

Path Attributes

Question Answer
MandatoryAppear in all BGP update messages sent to neighbors. Only set of attributes that all BGP speakers must know.
Optional transitiveA BGP speaker who doesn't understand the attribute will still pass it along.
Optional nontransitiveA BGP speak who doesn't understand the attribute will not pass the attribute along.
AS_PATHWell-known mandatory, list of AS's a BGP path passes through. Intended to prevent routing loops. If a router sees its own AS listed in a BGP route it knows its a loop and discards it.
originWell-known mandatory. i - EGP, e - EGP, ? - incomplete/unknown learned by route-redistribution
next-hopWell-known mandatory
Local prefWell-known discretionary
atomic aggregateWell-known discretionary
AggregatorOptional-transitive
CommunityOptional-transitive
MEDOption-nontransitive Multi-Exit Discriminator
memorize

Route Determination

 

Question Answer
Highest Weight(Cisco)1
TienoC/LocalPref2
locally derived path3
shortest AS_PATH4
Best origin code i>e>?5
Lowest MED6
eBGP>iBGP7
memorize
Lowest IGP metric to next BGP,
Oldest path,
Path from BGP router with lowest BGP RID