BGP Flashcards
What is BGP
BGP is a dynamic routing protocol that exchanges routes based on a variety of attributes. It is an EGP. Its purpose is to route different AS’s together.
Why does BGP not advertise incremental updates or refresh network advertisements
BGP prefers stability and was designed for neighbours not to change very often. if there was a link flap it would cause recomputation of thousands of routes which would be chaotic.
What is a BGP AS
The autonomous system (AS) within BGP is a collection of network devices under the same network administration. there are 4,294,967,295 ASNs are available.
What is a private BGP AS and what are the range
A private BGP AS is an AS that is not routable on the internet, similar to private addresses.
64,512 - 65,535
4,200,000,000 - 4,294,967,294
Who provides the AS to a company and what should you do if you can’t get one
IANA provides the AS, if they can’t provide one use the same one as your ISP.
What would happen if you use another companies AS on the internet
It would cause packet loss and cause chaos on the internet.
What is a BGP path attribute (PA)
BGP PA’s are associated with each route path, they allow BGP with more control and granularity.
What are the different types of BGP PA’s
Well known mandatory
Well known discretionary
Optional transitive
Optional Non-transitive
What is: well known mandatory PA
a PA that is recognised by all BGP implementations and is required for BGP to work.
What is: well known discretionary PA
A PA that may or may not be included in BGP process.
What is a optional PA and what is the difference between transitive and non-transitive
Optional PA’s are optional in the BGP implementation.
Transitive PA’s stay with the NLRI from AS to AS. Non-transitive are dropped between AS’s.
What is NLRI
Network Layer Reachability Information: Is the BGP routing update that specifies:
Network prefix
prefix length
Any PA’s
How does BGP prevent loops
BGP uses a well known mandatory PA called PA_Path this records all AS numbers the route passes through.
When a BGP router receives a NLRI routing update with their own AS number already listed within the PA_Path the router knows that this is in a loop and therefore drops the packet.
What is multi-protocol BGP
MP BGP adds granularity to the NLRI to define an address family and a sub address family.
What is an AF and SAF in BGP
AFI: address family is IPv4/IPv6
SAFI: sub AF unicast or multicast traffic
Each AF + SAF has its own configuration and respective database.
BGP uses hello packets to discover neighbours dynamically.
True or False
False - BGP can not discover neighbours dynamically it uses IP addresses to define neighbours.
What port does BGP use and does it use TCP/UDP mechanism
TCP port 179.
BGP neighbours connected to the same network use ARP tables to ID IP addresses.
True or False
True.
What is multi-hop BGP
Forming a neighbour relationship with a BGP router more than 1 hop away.
What is the requirement for multi-hop BGP to work
There must be a route installed in the RIB to the remote BGP router.
Either statically or dynamically.
What are the 2 BGP session types
iBGP - internal BGP neighbours established within the same AS (AD200)
eBGP - External BGP, neighbours established within different AS (AD20)
What is the use for iBGP
When transit connectivity is required within an organisation between ISPs etc.. also with multiple routing policies are used.
What is transit connectivity
When all BGP routers in the AS allow inbound traffic on the one side of the AS and output on the other side of the network.
Best case is full neighbour relationships making it a full-mesh.
What is eBGP used for
Connectivity between AS’s. Most commonly used to exchange routes on the internet.
What is the difference in TTL between iBGP and eBGP
iBGP - TTL default is 255 (to allow multi hop)
eBGP - TTL is 1 by default
How many message types does BGP use to communicate and what are they
- OPEN
- UPDATE
- NOTIFICATION
- KEEPALIVE
What is the purpose of each BGP message type
OPEN - Establishes neighbour adjacencies.
UPDATE - Advertises, updates and withdraws routes from RIB.
NOTIFICATION - indicates an error to BGP neighbour.
KEEPALIVE - used to maintain neighbour adjacency. default every 60 seconds.
What is the Hold timer used for
BGP uses the hold timer to maintain the adjacencies if the timer reaches zero the route is removed. default value 180 seconds.
resets from receiving a KEEPALIVE or NOTIFICATION.
what is the BGP ID
It is used as a identifier in BGP process it is either assigned statically or dynamically (same process as OSPF).
BGP uses a TCP session to form a relationship with a peer.
What are the states of the session.
Idle - Listening for BGP sessions to initiate.
Connect - 3 way hand shakes is initiating, peer with higher IP manages session. if success - moved to open sent.
Active - if the connect retry timer reaches zero before handshake complete states moves to active then idle to restart.
Open Sent - Open message has been sent and waiting for Open message from peer.
Open Confirm - on receipt of a KEEPALIVE or NOTFICATION. KEEPALIVE > Established if NOTIFICATION > Idle.
Established - BGP TCP session established, routes exchanged via UPDATE message.
How to configure basic BGP
- initialise BGP process
router bgp 65000 - Under bgp process form neighbours
neighbour 10.1.1.1 remote-as 65100 - Activate AF (IPv4 unicast is up by default)
address family IPv4 neighbour 10.1.1.1 activate - advertise routes to BGP process under AF
network 192.168.1.0 mask 255.255.255.0
What are the different BGP tables
Loc-RIB table- contains all NLRI following validity check
Adj-RIB-IN - contains NLRI before it is processed by routing polices
Adj-RIB-OUT- contains all NLRI after it has been processed by routing polices.
What command is used to view BGP table and BGP routes
show bgp [afi] [safi]
show ip bgp route
Which routes from the Loc-RIB are installed into the global RIB
the best paths.
What is the warning with redistributing routes in BGP
Be careful when redistributing internet BGP routes into IGP as there is millions of routes and this could cause chaos and damage to resources.
What is the benefit of summarising routes in BGP
Conserves resources and improves path calculation as the size of the routing tables are significantly smaller with summarisation.
What is the 2 ways to configure BGP summarisation
Static - static route to null0 interface and summary prefix advertised.
dynamic - use a aggregate network prefix that summarises the networks.
What is the command and optional PAs for configuring BGP summarisation
under the AF:
aggregate-address 10.10.10.0 mask 255.255.254.0 [summary-only][as-set]
What does the summary-only PA do
suppresses the prefixes within the summary prefix from been shown in the routing table.
The prefixes are still available to view in the BGP table (Loc-RIB).
What does the AS_SET PA do
Used to keep the AS path history for the aggregate history
IPv6 BGP configuration is the same as IPv4, with the exception of a different address family
True or False.
True
What is BGP multihoming
It is a method of providing resilience in BGP sessions.
What is the most resilient method of bgp multihoming
2 BGP router connected via iBGP, which are connected to 2 separate SP routers via eBGP
What is internet transit routing
When an enterprise connects to 2 different service providers it runs the risk of there AS becoming a transit connecting for internet traffic.
How do you avoid internet transit routing
Apply outbound BGP route policy that only allows for local BGP routes to be advertised to other AS’s.
What is symmetric and asymmetric traffic flow?
symmetric: traffic flows the same path in both directions
asymmetric: traffic flows in different routes on the out and in directions.
What is branch transit routing and what is the issue with it
When a link failure occurs and instead of the traffic flowing from router to MPLS SP router the traffic traverses another MPLS branch router then to the MPLS SP.
this causes extra usage on the branch router.
What is conditional matching in BGP
Is a method of matching network prefixes
ACLs react differently when matching against IGP compared to BGP.
True or False
True.
What is prefix matching
It allows the selection of multiple networks with a variety of prefix lengths that can be specified.
192.168.0.0/16 ge 24
the following prefix’s do or don’t match:
- 192.168.0.0/16
- 192.168.7.0/24
- 192.168.4.0/26
- No match
- Match
- Match
in prefix matching what does (le) and (ge) refer to
less than equal to
greater than equal to
what is a prefix list
Contains multiple prefix matching statements with either a permit or deny
What is the sequence increment default value for a prefix list
5
the logic for IPv6 prefix lists are the same as Ipv4 prefix lists.
True or False
True
What is regex commonly used for with regards to BGP
Parse through BGP tables
What is the regex expression for:
Local originating routes
only routes from neighbour AS200
^$
permit ^200_
What is a route map and what is the benefit of route maps over ACLs
Can filter networks similar to ACLs.
As well as that they can add/modify/remove network attributes to influence routing path decisions.
What is the components of a route map
Sequence number - incremented by 10
Conditional matching criteria
permit or deny - default is permit
optional action - allows for addition/modification/removal of characteristics
in a route map following a permit statement with multiple match statements what happens if both statements are not matched
it is not permitted as both need to match
What are the 2 methods of clearing a BGP connection
Hard reset - tears down BGP session, this removes the BGP routes from the peer and is the most disruptive.
Soft reset - invalidates the BGP cache and requests a full advertisement from its BGP peer.
What is the purpose of BGP communities
provides additional capability for tagging/modifying GP routing polices on upstream and downstream routers.
BGP communities are optional non transitive PA
True or False
False BGP communities are an optional transitive PA
What are the 3 well known BGP communities
Internet - standard community for identifying routes that should be advertised to the internet.
No advertise - routes should not be advertised to the internet.
No export - iBGP peers only.
Are BGP communities advertised by default
No
what does the additive keyword do in BGP community config
prevents overwriting of the BGP community
After the longest prefix match and AD of the routing protocol what does BGP prefer for install a route.
- Weight
- Local preference
- Local originated
- AIGP
- Shortest AS_Path
- Origin type
- Lowest MED
- eBGP over iBGP
- Lowest IGP next hop address
- if both eBGP use oldest neighbour
- Route that comes from BGP peer with lowest RID
- minimum cluster list length
- neighbour with lowest address.