BGP Routing Protocol.

BGP Description 

  • BGP Stand For – Border Gateway Protocol
  • Path Vector Routing Protocol
  • Classless Routing Protocol
  • By-Defauelt Auto-Summary is Disabled
  • Maximum Path – By-Defauelt-1
  • Layer 7 Protocol
  • It uses TCP port No – 179
  • It is on EGP Protocol
  • Open Standard
  • /Internel-200
  • It Send Messages as a Unicas
  • Completely Reliable Routing Protocol
  • A.D Valu – Externel-20t
  • Dosent Support Dynamic Nebrship

Where We Use BGP 

  • When our Network is Enterprise Network
  • IGP Protocol Does’nt Handle 1000 Of Prefixes
  • When We are Service Provider
  • Between 2 Sevice Provider
  • Advertise Your Public Servers Acces Over Internet
  • Control Incoming Or Outgoing Traffic

Tyepe Of BGP Customar 

  • Single Home Customar
  • Duel Home Customar
  • Single Multi-Home Customar
  • Duel Multi-Home Customar

Tyepe Of Messages In BGP Packet Type Of BGP

  • Open –  It is used to Establish Nbrship –  Router Will Share Open Msg Only Once                                                                     Contents Of Open MSG                                   

 Bgp Virson + Router id + Own As + Hold Down Timer+Type-1+Length

  • Keepalive – 60sec Hold Down Timer – 180 Bgp Paring
  • Update – Path Atributus/NLRI – 10.10.10.0/24 – Prefex
  • Notification
  • Route Refresh

How Many Table OF BGP

  • Nbr Table
  • BGP Table
  • Routing Table

How Many BGP Attributes

  • Next Hope
  • Weight
  • Local-Prefrance
  • Self-Advesment
  • As-Path
  • Origin-Code
  • Med -Metric
  • External > Internal
  • Shortest IGP path to BGP next hop
  • Oldest path
  • Lower Neighbor Router ID
  • Lower Neighbor IP address

Well known

Mandatory : AS-Path, Nex-hop and Origin
Discretionary : Local-pref and atomic-aggregate

Optional

Transitive : Community and agreggator
Non-Transitive : Cluster-id, originator-ID, MED

Route Reflector Type

  • Server
  • Client <Comnication – C To C <Y> >
  • Non-Client <Comnication – Nc To Nc <X> > <Comnication – NC To C <Y> >

BGP Split horizon Rule

Any Update sent by one ibgp neighbor should not be forwarded to another IBGP neighbor.

Prevent the routing loops within the same AS.

Delhi – R2 sends an update to Mumbai-R3, so Mumbai-R3 will not forward the update to banglore-R5.
Any Update sent by one ibgp neighbor should not be forwarded to another IBGP neighbor.

Prevent the routing loops within the same AS.

Delhi – R2 sends an update to Mumbai-R3, so Mumbai-R3 will not forward the update to banglore-R5.

neighbor 13.13.13.1 ttl-security hops 4

BGP – well known / Optional attribute

  • Full mesh Neighborship – A lot neighborships have to built.
  • Use Route-Reflector
  • Confedrations

 

BGP Description
01 BGP Stand For – Border Gateway Protocol
02 Path Vector Routing Protocol
03 Classless Routing Protocol
04 By-Defauelt Auto-Summary is Disabled
05 Maximum Path – By-Defauelt-1
06 Layer 7 Protocol
07 It uses TCP port No – 179
08 It is on EGP Protocol
09 Open Standard
10 Completely Reliable Routing Protocol
11 A.D Valu – Externel-20/Internel-200
12 It Send Messages as a Unicast
13 Dosent Support Dynamic Nebrship

Where We Use BGP
#01 When our Network is Enterprise Network
#02 IGP Protocol Doesnt Handle 1000 Of Prefixes
#03 When We are Service Provider
#04 Between 2 Sevice Provider
#05 Advertise Your Public Servers Acces Over Internet

Tyepe Of BGP Customar
#01 Single Home Customar
#02 Duel Home Customar
#03 Single Multi-Home Customar
#04 Duel Multi-Home Customar

Tyepe Of Messages In BGP Packet Type Of BGP
01 Open –
*It is used to Establish Nbrship
*Router Will Share Open Msg Only Once
————Contents Of Open MSG—————
Bgp Virson + Router id + Own As + Hold Down Timer+Type-1+Length
02 Keepalive – 60sec Hold Down Timer – 180 Bgp Paring
03 Update – Path Atributus/NLRI – 10.10.10.0/24 – Prefex
04 Notification –
05 Route Refresh

How Many Table OF BGP
#01 Nbr Table
#02 BGP Table
#03 Routing Table

How Many BGP Attributes
1-Next Hope
2-Weight
3-Local-Prefrance
4-Self-Advesment
5-As-Path
6-Origin-Code
7-Med -Metric
8-External > Internal
9-Shortest IGP path to BGP next hop
10-Oldest path
11-Lower Neighbor Router ID
12-Lower Neighbor IP address

Well known
Mandatory : AS-Path, Nex-hop and Origin
Discretionary:Local-pref and atomic-aggregate

Optional
Transitive : Community and agreggator
Non-Transitive : Cluster-id, originator-ID, MED

Route Reflector Type
01 Server
02 Client <Comnication – C To C <Y> >
03 Non-Client <Comnication – Nc To Nc <X> > <Comnication – NC To C <Y> >

BGP Split horizon Rule
Any Update sent by one ibgp neighbor should not be forwarded to another IBGP neighbor.

Prevent the routing loops within the same AS.

Delhi-R2 sends an update to Mumbai-R3, so Mumbai-R3 will not forward the update to banglore-R5.
Any Update sent by one ibgp neighbor should not be forwarded to another IBGP neighbor.

Prevent the routing loops within the same AS.

Delhi-R2 sends an update to Mumbai-R3, so Mumbai-R3 will not forward the update to banglore-R5.

neighbor 13.13.13.1 ttl-security hops 4

BGP- well known /Optional attribute

1. Full mesh Neighborship. – A lot neighborships have to built.
2. Use Route-Reflector
3. Confedrations

				
					conf t
hostname Mumbai-R3
int fa0/1
ip add 192.168.35.3 255.255.255.0
description Mumbai-BGLR-100mbps-Airtel
no sh

int fa1/0
ip add 192.168.13.3 255.255.255.0
description Mumbai-Internet-100mbps-Tata
no sh

int fa0/0
ip add 192.168.23.3 255.255.255.0
description Mumbai-Delhi-100mbps-Airtel
no sh
				
			
				
					Delhi
conf t
int lo 0
ip add 200.2.1.1 255.255.255.0
description Public-WEb-Servers
router bgp 1000
neighbor 192.168.23.3 remote-as 1000
network 200.2.1.0 mask 255.255.255.0
exit

Mumbai
conf t
int lo 0
ip add 200.3.1.1 255.255.255.0
description Public-FTP-Servers
router bgp 1000
neighbor 192.168.23.2 remote-as 1000
network 200.3.1.0 mask 255.255.255.0
exit
				
			

BGP Tables.

  1. BGP Neighbor Table
  2. BGP Database/Forwarding.
  3. Routing Table

All directly connected networks, when you advertise in bgp will show nexthop 0.0.0.0

Lets configure BGP on Bangalore-R5

				
					BGLR
conf t
hostname BGLR-R5
int fa0/0
ip add 192.168.35.5 255.255.255.0
no sh
int fa0/1
ip add 192.168.45.5 255.255.255.0
no sh

int lo 0
ip add 200.5.1.1 255.255.255.0
Router bgp 1000
neighbor 192.168.35.3 remote-as 1000
network 200.5.1.0 mask 255.255.255.0

We need to add bgp neigborship command in Mumbai-R3 also.
####### Mumbai-R3 #######
conf t
router bgp 1000
neighbor 192.168.35.5 remote-as 1000
neighbor 192.168.35.5 description BGLR
				
			
				
					FOR BGP Reachbility mostly all companies
are using IGP protocol like OSPF, ISIS.

### DELHI ####
Router ospf 1
int fa0/1
ip ospf 1 area 0
int fa1/0
ip ospf 1 area 0

### Mumbai ####
Router ospf 1
int fa0/0
ip ospf 1 area 0
int fa0/1
ip ospf 1 area 0

### BGLR ####
Router ospf 1
int fa0/0
ip ospf 1 area 0
int fa0/1
ip ospf 1 area 0
				
			

After OSPF configuration we get the reachability.

BGP Split horizon Rule.

Any Update sent by one ibgp neighbor should not be forwarded to another IBGP neighbor.

Prevent the routing loops within the same AS.

Delhi-R2 sends an update to Mumbai-R3, so Mumbai-R3 will not forward the update to banglore-R5.

We cant see Delhi Prefix in BGLR Router. Because of Split horizon Rule.

To resolve IBGP Split horizon

  1. Full mesh Neighborship. – A lot neighborships have to built.
  2. Use Route-Reflector
  3. Confedrations.

FSM = BGP States | BGP Messages

FSM – Finite State machine

FULL Mesh IBGP Neigborship [ N-1]

Every router should be a neighbor of every router within the AS.

4-1 = 3 neighborships

8-1 = 7 neighborshi

				
					Delhi-R2
router bgp 1000
neighbor 192.168.23.3 remote-as 1000
neighbor 192.168.24.4 remote-as 1000
neighbor 192.168.35.5 remote-as 1000
network 200.2.1.0 mask 255.255.255.0

Mumbai-R3
router bgp 1000
neighbor 192.168.23.2 remote-as 1000
neighbor 192.168.35.5 remote-as 1000
network 200.3.1.0 mask 255.255.255.0
neighbor 192.168.45.4 remote-as 1000

BGLR-R5
Router bgp 1000
neighbor 192.168.35.3 remote-as 1000
neighbor 192.168.45.4 remote-as 1000
neighbor 192.168.23.2 remote-as 1000
network 200.5.1.0 mask 255.255.255.0

##### PUNE #####
conf t
hostname Pune-R4
int fa0/0
ip add 192.168.24.4 255.255.255.0
no sh
int fa0/1
ip add 192.168.45.4 255.255.255.0
no sh

int lo 0
ip add 200.4.1.1 255.255.255.0
int range fa0/0 - 1 
ip ospf 1 area 0
router bgp 1000
neighbor 192.168.24.2 remote-as 1000
neighbor 192.168.45.5 remote-as 1000
network 200.4.1.0 mask 255.255.255.0
We got the connectivity after doing IBGP FULL MESH.
				
			

IBGP Neighborship with Loopbacks.

To provide redundancy in bgp neighborship we are using loopbacks.

For Redudancy we use Loopbacks, and using a loopback interface as source interface we have two paths between them, if one of paths fails, the other one will be used.

Update source loopback-

By default Routers send phyical ip as a source ip address. When you make neighborship with loopback , we need to update the source else router will reject the bgp messages.

				
					AR17
conf t
hostname AR17
int fa0/1
ip add 192.168.51.1 255.255.255.0
no sh
int fa0/0
ip add 192.168.52.1 255.255.255.0
no sh

int lo 0
ip add 10.1.1.1 255.255.255.0
no sh
Router bgp 1000
neighbor 10.2.1.1 remote-as 1000
neighbor 10.2.1.1 update-source Loopback0
Router eigrp 10
network 192.168.51.0 
network 192.168.52.0
network 10.1.1.0
no auto-summary

OR 
ip route 10.2.1.0 255.255.255.0 192.168.51.2
ip route 10.2.1.0 255.255.255.0 192.168.52.2

AR18
conf t
hostname AR18
int fa0/1
ip add 192.168.51.2 255.255.255.0
no sh
int fa0/0
ip add 192.168.52.2 255.255.255.0
no sh
int lo 0
ip add 10.2.1.1 255.255.255.0
no sh

Router bgp 1000
neighbor 10.1.1.1 remote-as 1000
neighbor 10.1.1.1 update-source Loopback0

Router eigrp 10
network 192.168.51.0 
network 192.168.52.0
network 10.2.1.0
no auto-summary

**OR**
ip route 10.1.1.0 255.255.255.0 192.168.51.1
ip route 10.1.1.0 255.255.255.0 192.168.52.1
				
			

Step 1 – Configure Ip addressing

Step 2 – Connect all locations with each other.

Step 3 – Use loopbacks on all routers.

R2 – 2.2.2.2
R3 – 3.3.3.3
R4 – 4.4.4.4
R5 – 5.5.5.5

Hint – You need run EIGRP/OSPF and make sure your loopbacks are reachable from all the routers.

Neighbor Authentication

BGP Support Message Digest 5 Algorithm.

BGP Only makes tcp connection with verified neighbors

				
					Delhi-R2
Router bgp 1000
neighbor 192.168.23.3 remote-as 1000
neighbor 192.168.23.3 password nwkings1234

Mumbai-R3
Router bgp 1000
neighbor 192.168.23.2 remote-as 1000
neighbor 192.168.23.2 password nwkings1234

show ip bgp summary
You can test authentication by giving

#debug ip bgp
#clear ip bgp
Hard Reset - clear ip bgp 
Soft Reset - clear ip bgp soft
				
			

BGP Peer-groups

Peer group is like a template. You can use peergroup for multiple neighbors.

It makes the configuration simple.

				
					Without PEER GROUP
router bgp 1000
neighbor 192.168.23.3 remote-as 1000
neighbor 192.168.24.4 remote-as 1000
neighbor 192.168.35.5 remote-as 1000

neighbor 192.168.23.3 remote-as 1000 password nwkings1234
neighbor 192.168.24.4 remote-as 1000 password nwkings1234
neighbor 192.168.35.5 remote-as 1000 password nwkings1234
neighbor 192.168.23.3 remote-as 1000 update-source loopback 0
neighbor 192.168.24.4 remote-as 1000 update-source loopback 0
neighbor 192.168.35.5 remote-as 1000 update-source loopback 0

neighbor 192.168.23.3 default-orginate
neighbor 192.168.24.4 default-orginate
neighbor 192.168.35.5 default-orginate


With PEER GROUP  
Router bgp 1000
neighbor ABC peer-group
neighbor ABC remote-as 1000
neighbor ABC password nwkings1234
neighbor ABC update-source loopback 0
neighbor ABC default-orginate

neighbor 192.168.23.3 peer-group ABC
neighbor 192.168.24.4 peer-group ABC
neighbor 192.168.35.5 peer-group ABCo
				
			

BGP Peer-groups

Peer group is like a template. You can use peergroup for multiple neighbors.

It makes the configurati

Full-Mesh IBGP Scalability

Because IBGP requires a full mesh of peers, scaling the full mesh is a concern. In general, for N peers in an IBGP full mesh, each would have N – 1 peers. There are N (N – 1) / 2 peering relationships. This means that each peer would need the CPU, memory, and bandwidth to handle updates and peer status for all the other routers. This is not a hierarchical design, and it would not be cost-effective to scale for large networks.

BGP Route Reflectors.

on simple.

Delhi public ip 200.2.1.1 we need to advertise in bgp. We will check if the route is visible in bangalore router.

				
					Delhi - 2.2.2.2 | Public ip - 200.2.1.1
Mumbai - 3.3.3.3
Bangalor - 5.5.5.5
Delhi
Router bgp 1000
neighbor 3.3.3.3 remote-as 1000
neighbor 3.3.3.3 update-source loopback 1
network 200.2.1.0 mask 255.255.255.0

Mumbai
router bgp 1000
neighbor ABC peer-group 
neighbor ABC remote-as 1000
neighbor ABC update-source loopback 1
neighbor ABC route-reflector-client
neighbor 2.2.2.2 peer-group ABC
neighbor 5.5.5.5 peer-group ABC

BGLR
Router bgp 1000
neighbor 3.3.3.3 remote-as 1000
Delhi-R2
conf t
int lo 1
ip add 2.2.2.2 255.255.255.0
ip ospf 1 area 0

Mumbai-R3
conf t
int lo 1
ip add 3.3.3.3 255.255.255.0
ip ospf 1 area 0

Bangalor-R5
conf t
int lo 1
ip add 5.5.5.5 255.255.255.0
ip ospf 1 area 0
router bgp 1000
				
			

Lets config route reflector.

BGP route reflector is an IBGP speaker that reflects or repeats routes learned from IBGP peers to some of its other IBGP peers.

R3 – Route Reflector Server.

R2 and R5 – Route Reflector clients.

				
					Mumbai-R3 [ Route Reflector Server ]
Router bgp 1000
neighbor 2.2.2.2 route-reflector-client
neighbor 5.5.5.5 route-reflector-client

for Peer group
neighbor ABC route-reflector-client.
				
			

Route Reflector with 2 servers.

				
					Configure ospf on all interfaces.
R4
int lo 1
ip add 4.4.4.4 255.255.255.0
ip ospf 1 area 0
router bgp 1000
neighbor 2.2.2.2 remote-as 1000
neighbor 2.2.2.2 update-source loopback 1
neighbor 2.2.2.2 route-reflector-client
neighbor 5.5.5.5 remote-as 1000
neighbor 5.5.5.5 update-source loopback 1
neighbor 5.5.5.5 route-reflector-client

Delhi 
neighbor 4.4.4.4 remote-as 1000
neighbor 4.4.4.4 update-source loopback 1

BGLR 
neighbor 4.4.4.4 remote-as 1000
neighbor 4.4.4.4 update-source loopback 1
				
			

Route is now coming from both the sides as we have routerelflector both the sides.

				
					r4
conf t
int e0/0
ip add 192.168.12.1 255.255.255.0
no sh

int lo 0
ip add 4.4.4.4 255.0.0.0
router bgp 1
neighbor 5.5.5.5 remote-as 2
neighbor 5.5.5.5 update-source lo 0
neighbor 5.5.5.5 disable-connected-check

r5
conf t
int e0/0
ip add 192.168.12.2 255.255.255.0
no sh

int lo 0
ip add 5.5.5.5 255.0.0.0
router bgp 1
neighbor 4.4.4.4 remote-as 2
neighbor 4.4.4.4 update-source lo 0
neighbor 5.5.5.5 disable-connected-check
				
			

Disable connected check

The disable-connected-check was created precisely for the purpose of peering two directly connected routers on their loopbacks without using the ebgp-multihop.

The neighbor disable-connected-check command is used to disable the connection verification process for eBGP peering sessions that are reachable by a single hop but are configured on a loopback interface

neighbor x.x.x.x disable-connected-check.

Next-hop behavior

				
					R2
conf t
hostname R2
int fa0/0
ip add 192.168.12.2 255.255.255.0
description airtel-link
no sh
int fa0/1
ip add 192.168.23.2 255.255.255.0
no sh
description lan-interface
ip ospf 1 area 0
int lo 0 
ip add 10.2.2.2 255.255.255.0
router ospf 1
router-id 10.2.2.2
default-information originate

R3
conf t
hostname R3
int fa0/0
ip add 192.168.23.3 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.34.3 255.255.255.0
no sh
ip ospf 1 area 0
router ospf 1
router-id 10.3.3.3

R4
conf t
hostname R4
int fa0/0
ip add 192.168.34.4 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.45.4 255.255.255.0
no sh
description vodafone-link
int lo 0
ip add 10.4.4.4 255.255.255.0
router ospf 1
router-id 10.4.4.4
default-information originate 

R1-Airtel
conf t
hostname R1-Airtel
int fa0/0
ip add 192.168.12.1 255.255.255.0
no sh
int fa0/1
ip add 192.168.33.1 255.255.255.0
no sh
int lo 0
ip add 1.1.1.1 255.255.255.0

R5-Vodafone
conf t
hostname R5-Vodafone
int fa0/0
ip add 192.168.45.5 255.255.255.0
no sh
int fa0/1
ip add 192.168.43.5 255.255.255.0
no sh
Internet
conf t
int fa0/0
ip add 192.168.33.6 255.255.255.0
no sh
int fa0/1
ip add 192.168.43.6 255.255.255.0
no sh

1. We will configure ebgp between R1 and R2, R4 and R5 and ibgp between R2 and R4.
R1
conf t
router bgp 1
neighbor 192.168.12.2 remote-as 2
neighbor 192.168.12.2 default-originate
network 1.1.1.0 mask 255.255.255.0

R2
conf t
router bgp 2
neighbor 192.168.12.1 remote-as 1

R5-vodafone
conf t
router bgp 3
neighbor 192.168.45.4 remote-as 2
neighbor 192.168.45.4 default-originate

R4
conf t
router bgp 2 neighbor 192.168.45.5 remote-as 3
Loopback issue /32
interface Loopback0
description web-server
ip address 203.1.1.1 255.255.255.0
ip ospf network point-to-point
ip ospf 1 area 0
				
			

Now configure ibgp between R2 and R4, both routers are not directly connected, for reachability we have configured OSPF

				
					R2(config)#interface loopback 0
R2(config-if)#ip address 10.2.2.2 255.255.255.0
R2(config-if)#ip ospf 1 area 0

R4(config)#interface loopback 0
R4(config-if)#ip address 10.4.4.4 255.255.255.0
R4(config-if)#ip ospf 1 area 0

R2(config)#router bgp 2
R2(config-router)#neighbor 10.4.4.4 remote-as 2
R2(config-router)#neighbor 10.4.4.4 update-source loopback 0
R2(config-router)#neighbor 10.4.4.4 next-hop-self

R4(config)#router bgp 2
R4(config-router)#neighbor 10.2.2.2 remote-as 2
R4(config-router)#neighbor 10.2.2.2 update-source loopback 0
R4(config-router)#neighbor 10.2.2.2 next-hop-self
				
			

When any Route coming from EBGP Neighbor, router will not change the next hop self.

We need to give next-hop-self command to fix this issue.

As an examople, Router A is forwarding route to Router B and Router B is sending the same nexthop to Router C.

How Router C will get the next hop of B router ?

  • We need to give next hop self command on Router B.

We need to ping from R4 to 1.1.1.1 which is Airtel IP. We will use source ip 192.168.34.4

				
					R1-Airtel
conf t
router bgp 1
neighbor 192.168.33.6 remote-as 4 

R5-Vodafone
conf t
router bgp 3
neighbor 192.168.43.6 remote-as 4 

Internet
conf t
router bgp 4
neighbor 192.168.33.1 remote-as 1
neighbor 192.168.43.5 remote-as 3
				
			

BGP selects the best path based on a list of attributes

BGP Path Selection Criteria

N W L L A O M N I ORL

BGP As-path prepend & MED

				
					host Nwkings
int fa2/0
ip add 192.16.3.2 255.255.255.0
no sh
int fa1/0
ip add 192.16.4.2 255.255.255.0
no sh 
int lo 0
ip add 200.1.1.0 255.255.255.0
Router bgp 2
neighbor 192.16.4.1 remote-as 3
neighbor 192.16.3.1 remote-as 1
network 200.1.1.0 mask 255.255.255.0

####### Incoming Traffic from ISP 1 ########
access-list 2 permit 200.1.1.0 0.0.0.255
route-map inc permit 10
match ip address 2 
set aspath prepend 2 2 2 2 2 
route-map inc permit 20 
neighbor 192.16.4.1 route-map inc out

####### Outgoing Traffic from ISP 2 ########
access-list 1 permit 8.8.8.0 0.0.0.255
route-map abc permit 10 
match ip address 1 set
weight 500 
route-map abc permit 20
neighbor 192.16.4.1 route-map abc in

host ISP2
int fa0/0
ip add 192.16.4.1 255.255.255.0
no sh
int fa0/1
ip add 192.16.2.1 255.255.255.0
no sh
Router bgp 3
neighbor 192.16.2.2 remote-as 1000
neighbor 192.16.4.2 remote-as 2
network 192.16.2.0 mask 255.255.255.0
network 192.16.4.0 mask 255.255.255.0

host ISP1
int fa0/0
ip add 192.16.3.1 255.255.255.0
no sh
int fa0/1
ip add 192.16.1.1 255.255.255.0
no sh
Router bgp 1
neighbor 192.16.1.2 remote-as 1000
neighbor 192.16.3.2 remote-as 2
neighbor 192.16.3.2 default-originate

host google
int fa0/0
ip add 192.16.1.2 255.255.255.0
no sh
int fa0/1
ip add 192.16.2.2 255.255.255.0
no sh
int lo 0
ip add 8.8.8.8 255.255.255.0
Router bgp 1000
neighbor 192.16.1.1 remote-as 1
neighbor 192.16.2.1 remote-as 3
network 8.8.8.0 mask 255.255.255.0
How ISP Sends only default route ?

ISP 1 & ISP 2
ip prefix-list XYZ seq 10 permit 0.0.0.0/0
router bgp 1
neighbor 192.16.3.2 prefix-list XYZ out
TRACEROUTE. ---- 
traceroute 8.8.8.8 numeric source loopback 0
				
			
				
					R1(config)#router bgp 1
R1(config-router)#maximum-paths 4
R1#show ip bgp 
BGP table version is 3, local router ID is 192.168.13.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, 
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter, 
x best-external, a additional-path, c RIB-compressed, 
t secondary path, 
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*m 192.168.23.0 192.168.13.3 0 23 i
*> 192.168.12.2 0 0 23
				
			

Backdoor Entry

When we learn routes via EBGP and with IGP [ RIP | EIGRP | OSPF ]. It will always prefer the ebgp.

EBGP – 20

OSPF – 110

EIGRP – 90

Rip – 120

BGP tshoot

BGP Neighbor Issues. !!

BGP 4 Byte AS.

BGP had 2 byte AS number 1-65535. They are almost exhausted and this is the reason now BGP has 4 Byte AS.

2 Byte – 16bit – 0-65535 4 byte – 32 bit – 4294967295

  1. As plain – 545415, 4294917295, 4227294.
  2. Asdot – Lower than 65655
  3. Asdot+ – It breaks into two 16bit numbers. AS 100 becomes 0.100 As 4500 becomes 0.4500 AS 65535 becomes 0.65535 As 65536 becomes 1.0 As 65537 becomes 1.1

BGP Confedration | Summary | AIGP | Regular Expressions in BGP

BGP confederation enables you to apply a scalable approach when it comes to BGP deployment and controlling your large autonomous system.

BGP confederation significantly reduces the total number of BGP connections within an autonomous system,

BGP route reflectors does not require major changes to existing configuration and topology.

BGP confederations involves quite a change to BGP configurations and the architecture itself, adding more complexity.

LAB Confederation.

				
					R1
conf t
hostname ISP_R1
int fa0/0
ip add 192.168.12.1 255.255.255.0
no sh
int lo 0
ip add 8.8.8.8 255.0.0.0
Router bgp 1
neighbor 192.168.12.2 remote-as 2
network 8.0.0.0 mask 255.0.0.0

#################### AS2 #################
R2
conf t
hostname R2
int fa0/0
ip add 192.168.12.2 255.255.255.0
no sh
int fa1/0
ip add 192.168.24.2 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.23.2 255.255.255.0
no sh
ip ospf 1 area 0
int lo 0
ip add 2.2.2.2 255.255.255.255
ip ospf 1 area 0
Router bgp 2000
bgp confederation identifier 2
bgp confederation peers 3000 
neighbor 4.4.4.4 remote-as 2000
neighbor 4.4.4.4 update-source loopback 0
neighbor 4.4.4.4 next-hop-self
neighbor 4.4.4.4 remote-as 2000
neighbor 4.4.4.4 update-source loopback 0
neighbor 4.4.4.4 next-hop-self
neighbor 192.168.12.1 remote-as 1

R4
conf t
hostname R4
int fa0/0
ip add 192.168.24.4 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.45.4 255.255.255.0
no sh
ip ospf 1 area 0
int lo 0
ip add 4.4.4.4 255.255.255.255
ip ospf 1 area 0
Router bgp 2000
bgp confederation identifier 2 
bgp confederation peers 3000 
neighbor 2.2.2.2 remote-as 2000
neighbor 2.2.2.2 update-source loopback 0
neighbor 5.5.5.5 remote-as 3000
neighbor 5.5.5.5 update-source loopback 0
neighbor 5.5.5.5 ebgp-multihop 2

R3
conf t
hostname R3
int fa0/0
ip add 192.168.23.3 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.35.3 255.255.255.0
no sh
ip ospf 1 area 0
int lo 0
ip add 3.3.3.3 255.255.255.255
ip ospf 1 area 0
Router bgp 3000
bgp confederation identifier 2
bgp confederation peers 2000
neighbor 2.2.2.2 remote-as 2000
neighbor 2.2.2.2 update-source loopback 0
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 5.5.5.5 remote-as 3000
neighbor 5.5.5.5 update-source loopback 0

R5
conf t
hostname R5
int fa0/0
ip add 192.168.35.5 255.255.255.0
no sh
ip ospf 1 area 0
int fa0/1
ip add 192.168.45.5 255.255.255.0
no sh
ip ospf 1 area 0
int lo 0
ip add 5.5.5.5 255.255.255.255
ip ospf 1 area 0
Router bgp 3000 
bgp confederation identifier 2 
bgp confederation peers 2000 
neighbor 4.4.4.4 remote-as 2000
neighbor 4.4.4.4 update-source loopback 0
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 3.3.3.3 remote-as 3000
neighbor 3.3.3.3 update-source loopback 0
				
			

BGP Summarization | Aggregate.

The aggregate-address command can be used to generate a summary route

				
					R2
conf t
int lo 10
ip add 172.16.0.1 255.255.255.0
int lo 11
ip add 172.16.1.1 255.255.255.0
int lo 12
ip add 172.16.2.1 255.255.255.0
int lo 13
ip add 172.16.3.1 255.255.255.0
Router bgp 2000
network 172.16.0.0 mask 255.255.255.0
network 172.16.1.0 mask 255.255.255.0
network 172.16.2.0 mask 255.255.255.0
network 172.16.3.0 mask 255.255.255.0
aggregate-address 172.16.0.0 255.255.252.0
We can suppress all the summarized routes by recreating the 
aggregate route, this time appending the summary-only keyword.
aggregate-address 172.16.0.0 255.255.252.0 summary-only

##################################################################
aggregate-address 172.16.0.0 255.255.252.0 summary-only as-set 
This configuration generates 
an aggregate route with an AS path containing the other AS Numbers,
since the aggregate contains routes originating 
from those autonomous systems.

R4# show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 172.16.0.0/22 2.2.2.2 0 0 30 {10,20} ?
				
			

BGP community.

Its just an extra information which can be added into prefixes

Well known BGP communities:

Internet – Advertise to all BGP Neighbors.

No-Advertise – Do not advertise to any BGP Neighbor.

				
					router bgp 2000
neighbor 192.168.12.1 send-community
neighbor 192.168.12.1 route-map NA out
route-map NA permit 10
set community no-advertise
				
			

No-Export – Do not advertise to any EBGP Neighbor.

				
					router bgp 2000
neighbor 192.168.12.1 send-community
neighbor 192.168.12.1 route-map NO_ADVERTISE
route-map NA permit 10
set community no-export
				
			

Local-AS – Do not forward to another Sub-AS [ Confedration ]

				
					R2
route-map LAS permit 10
set community local-as
router bgp 2000
neighbor 3.3.3.3 send community
neighbor 192.168.12.1 route-map LAS in