Showing posts with label BGP. Show all posts
Showing posts with label BGP. Show all posts

Saturday, 26 July 2025

BGP CHAPTER 24 Originator ID , Cluster ID & Cluster List

 Loop Prevention in RR Setups - 

iBGP loop prevention mechanism  - Split Horizon Rule 

Route learned from an iBGP neighbor cannot be forwarded to other iBGP neighbor.

RR violates this rule so …”introduces risk of loops”


Originator ID 

The Originator ID is set by the route reflector

32-bit router ID of the original iBGP speaker that injected the route. For eg R1

Visible in Route Reflector environments

Prevents loops if route comes back to the originator



Cluster ID & Cluster List

Cluster ID is an unique ID assigned to each Route Reflector.

Cluster List is a list of all Cluster IDs the route has passed through

When an RR reflects a route, it adds its own Cluster ID to the Cluster List.

If a router sees its own Cluster ID in the Cluster List → loop detected → route discarded



Cluster 1 

R1 , R2 - Client 

R3 - Route Reflector 

Cluster 2 

R4 , R5 - Client

R6 - Route Reflector 

BGP Neighborship 

R1_Client>show ip bgp summary 

BGP router identifier 1.1.1.1, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

3.3.3.3         4          100       7       7        1    0    0 00:03:31        0


R2_Client>show ip bgp summary 

BGP router identifier 2.2.2.2, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

3.3.3.3         4          100       6       8        1    0    0 00:03:48        0

R2_Client>


R3_RR1#show ip bgp summary 

BGP router identifier 3.3.3.3, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

1.1.1.1         4          100      11      11        1    0    0 00:06:41        0

2.2.2.2         4          100      10       8        1    0    0 00:06:13        0

6.6.6.6         4          100       4       4        1    0    0 00:00:08        0


R4_Client>show ip bgp summary 

BGP router identifier 4.4.4.4, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

6.6.6.6         4          100       9       9        1    0    0 00:05:01        0


R5_Client>show ip bgp summary 

BGP router identifier 5.5.5.5, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

6.6.6.6         4          100       9       9        1    0    0 00:05:20        0

R5_Client>


R6_RR2#show ip bgp summary 

BGP router identifier 6.6.6.6, local AS number 100

BGP table version is 1, main routing table version 1


Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd

3.3.3.3         4          100       5       5        1    0    0 00:01:10        0

4.4.4.4         4          100      10      10        1    0    0 00:05:43        0

5.5.5.5         4          100      10      10        1    0    0 00:05:43        0

R6_RR2#

=============================================

Now lets advertise a network 100.1.1.1/32 from R1 in BGP 


R1_Client(config)#int loopback 100

R1_Client(config-if)#ip address 100.1.1.1 255.255.255.255

R1_Client(config)#router bgp 100

R1_Client(config-router)#network 100.1.1.1 mask 255.255.255.255

R1_Client(config-router)#^Z


Lets check on its RR - R3


R3_RR1#show ip bgp 100.1.1.1/32

BGP routing table entry for 100.1.1.1/32, version 2

Paths: (1 available, best #1, table default)

  Advertised to update-groups:

     2          3         

  Refresh Epoch 1

  Local, (Received from a RR-client)

    1.1.1.1 (metric 11) from 1.1.1.1 (1.1.1.1)  

      Origin IGP, metric 0, localpref 100, valid, internal, best

      rx pathid: 0, tx pathid: 0x0


Lets check on RR2 - R6


R6_RR2#show ip bgp 100.1.1.1/32

BGP routing table entry for 100.1.1.1/32, version 2

Paths: (1 available, best #1, table default)

  Advertised to update-groups:

     2         

  Refresh Epoch 1

  Local

    1.1.1.1 (metric 21) from 3.3.3.3 (3.3.3.3)

      Origin IGP, metric 0, localpref 100, valid, internal, best

      Originator: 1.1.1.1, Cluster list: 3.3.3.3  ----------> ORIGINATOR ID OF R1     CLUSTER ID OF RR1

      rx pathid: 0, tx pathid: 0x0

Now lets check on R4

R4_Client>show ip bgp 100.1.1.1/32

BGP routing table entry for 100.1.1.1/32, version 2

Paths: (1 available, best #1, table default)

  Not advertised to any peer

  Refresh Epoch 1

  Local

    1.1.1.1 (metric 31) from 6.6.6.6 (6.6.6.6)

      Origin IGP, metric 0, localpref 100, valid, internal, best

      Originator: 1.1.1.1, Cluster list: 6.6.6.6, 3.3.3.3   ---> RR2 Cluster ID is also attached

      rx pathid: 0, tx pathid: 0x0

R4_Client>


For complete configuration - mail me on networkengineerstuff.com




Sunday, 21 July 2024

BGP: The Huge Routing Protocol

 Border Gateway Protocol, commonly known as BGP, stands as a cornerstone of the modern internet, enabling the vast interconnected network to function smoothly and efficiently. As a network engineer, understanding BGP is not just beneficial—it's essential. In this blog post, we'll delve into why BGP is often referred to as "the huge protocol," its key features, and its critical role in today's digital landscape.

### What is BGP?

BGP is a standardized exterior gateway protocol used to exchange routing and reachability information between different autonomous systems (ASes) on the internet. Unlike interior gateway protocols (IGPs) such as OSPF or EIGRP, which operate within a single autonomous system, BGP is designed to manage the routing between different autonomous systems. This makes it fundamental to the functioning of the global internet, where multiple networks operated by different organizations need to exchange routing information reliably.


### Why is BGP Considered "Huge"?

1. **Scale and Reach**: BGP is designed to handle the massive scale of the internet. It manages routing information for potentially millions of networks and routes, making decisions based on complex policies and preferences.

2. **Policy Flexibility**: Unlike IGPs, which primarily focus on the shortest path to a destination, BGP allows network administrators to define routing policies based on business needs. This can include preferences for certain paths, traffic engineering, or compliance with local regulations.

3. **Reliability and Stability**: The decentralized nature of BGP contributes to its robustness. It's built to ensure that changes in network topology or failures in one part of the network do not disrupt the entire internet. BGP's slow convergence mechanisms and careful route selection algorithms help maintain stability.

4. **Internet Backbone**: BGP forms the backbone of the internet's routing infrastructure. Large ISPs, content providers, and enterprises rely on BGP to interconnect their networks and ensure end-to-end connectivity for users worldwide.


### Key Features of BGP

- **Path Vector Protocol**: BGP uses a path vector algorithm to make routing decisions. This means it not only considers the shortest path to a destination but also takes into account policies and constraints defined by network administrators.

- **Autonomous Systems**: BGP operates between autonomous systems (ASes), which are collections of IP networks and routers under a single administrative domain. Each AS is identified by a unique number assigned by a regional internet registry.

- **Peering Relationships**: BGP relies on peering relationships between autonomous systems. These can be bilateral (between two ASes) or multilateral (involving multiple ASes).

- **Internet Routing Policies**: Administrators can control how traffic flows across the internet using BGP attributes and policies. This includes controlling inbound and outbound traffic, influencing routing decisions based on cost, performance, and other criteria.


### Challenges with BGP

Despite its strengths, BGP also faces challenges:

- **Security**: BGP is vulnerable to various types of attacks, including route hijacking and route leaks, which can disrupt internet traffic or redirect it maliciously.

- **Complexity**: Managing BGP configurations and policies can be complex, especially for large networks with diverse requirements.

- **Resource Consumption**: BGP routers must maintain a large amount of routing information, which can strain memory and processing resources.


### Conclusion

In conclusion, BGP plays a crucial role in the operation of the internet, earning its reputation as "the huge protocol" due to its scale, flexibility, and importance. As a network engineer, mastering BGP is essential for managing large-scale networks and ensuring reliable connectivity. Understanding its intricacies, from route propagation to policy implementation, empowers engineers to optimize network performance and security in the dynamic world of internet routing.

Stay tuned for more insights into networking technologies and best practices on our blog!

**References:**

- Cisco: Understanding BGP

- Internet Engineering Task Force (IETF): BGP Specifications


Keep Reading !!!

Network Engineer Stuff

Monday, 15 March 2021

BGP Chapter 22 - BGP Split Horizon Rule

 Route learned from an iBGP neighbor cannot be forwarded to other iBGP neighbor.

 Solution for this are :-

1) Full Mesh iBGP

2) Route Reflector 

3) Confederation 

Lets focus on 1st Solution in this chapter 

1) Full Mesh iBGP 

 Making full mesh of iBGP peers even if they are not directly connected .

 So that each iBGP router will have BGP routes for AS. 

The requirement of fully meshed iBGP means that, for n BGP speakers (within the same AS), there will be n(n-1)/2 iBGP peering sessions. 

For example, if there are 10 BGP speakers in a particular AS, then there must be 10(10-1)/2 iBGP sessions, which is 45 peering sessions. 

This may not scale well in ASs that have large number of iBGP peers. 

So the solution to this are the other two methods :- 

Route Reflector and Confederation. 

 

LAB 

=========


 
Basic Configuration

=======================

 R1
===============
config t
hostname R1
interface eth1/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
interface eth1/1
ip add 13.1.1.1 255.255.255.0
no shut
exit
int loopback 0
ip address 1.1.1.1 255.255.255.255
int loopback 1
ip address 10.0.0.1 255.255.255.0
ip route 2.2.2.2 255.255.255.255 12.1.1.2
ip route 3.3.3.3 255.255.255.255 13.1.1.3
exit
exit

R2
===============
config t
hostname R2
interface eth1/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int loopback 0
ip address 2.2.2.2 255.255.255.255
int loopback 1
ip address 20.0.0.1 255.255.255.0
ip route 1.1.1.1 255.255.255.255 12.1.1.1
ip route 3.3.3.3 255.255.255.255 12.1.1.1
exit
exit

R3
===============
config t
hostname R3
interface eth1/1
ip add 13.1.1.3 255.255.255.0
no shut
exit
int loopback 0
ip address 3.3.3.3 255.255.255.255
int loopback 1
ip address 30.0.0.1 255.255.255.0
ip route 1.1.1.1 255.255.255.255 13.1.1.1
ip route 2.2.2.2 255.255.255.255 13.1.1.1
exit
exit

BGP Configuration on R1
========================
config t
router bgp 100
neighbor amar peer-group
neighbor amar remote-as 100
neighbor amar update-source loopback 0
neighbor amar password cisco123
neighbor 2.2.2.2 peer-group amar
neighbor 3.3.3.3 peer-group amar
exit
exit

BGP Configuration on R2
==========================
config t
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loopback 0
neighbor 1.1.1.1 password cisco123
exit
exit

BGP Configuration on R3
==========================
config t
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loopback 0
neighbor 1.1.1.1 password cisco123
exit
exit

===================
R1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4          100       6       7        1    0    0 00:02:51        0
3.3.3.3         4          100       5       4        1    0    0 00:02:39        0
R1#

R2#sh ip bgp summary
BGP router identifier 20.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100       7       7        1    0    0 00:03:15        0
R2#

R3#sh ip bgp summary
BGP router identifier 30.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100       5       6        1    0    0 00:03:24        0
R3#

========================================================================
R1

config t
router bgp 100
network 10.0.0.0 mask 255.255.255.0
exit
exit
wr

R2

config t
router bgp 100
network 20.0.0.0 mask 255.255.255.0
exit
exit
wr

R3

config t
router bgp 100
network 30.0.0.0 mask 255.255.255.0
exit
exit
wr

R1#sh ip bgp
BGP table version is 6, local router ID is 1.1.1.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  10.0.0.0/24      0.0.0.0                  0         32768 i
 *>i 20.0.0.0/24      2.2.2.2                  0    100      0 i
 *>i 30.0.0.0/24      3.3.3.3                  0    100      0 i

R2#sh ip bgp
BGP table version is 5, local router ID is 20.1.1.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 10.0.0.0/24      1.1.1.1                  0    100      0 i
 *>  20.0.0.0/24      0.0.0.0                  0         32768 i

R3#sh ip bgp
BGP table version is 3, local router ID is 30.1.1.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 10.0.0.0/24      1.1.1.1                  0    100      0 i
 *>  30.0.0.0/24      0.0.0.0                  0         32768 i


Lets try full mesh iBGP Peering

R2
config t
router bgp 100
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source loopback 0
neighbor 3.3.3.3 password cisco123
exit
exit

R3
config t
router bgp 100
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source loopback 0
neighbor 2.2.2.2 password cisco123
exit
exit

R2#sh ip bgp summary
BGP router identifier 20.1.1.1, local AS number 100
BGP table version is 6, main routing table version 6
3 network entries using 432 bytes of memory
3 path entries using 240 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 944 total bytes of memory
BGP activity 3/0 prefixes, 4/1 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100      43      46        6    0    0 00:35:31        1
3.3.3.3         4          100       7       7        6    0    0 00:00:15        1

R3#sh ip bgp summary
BGP router identifier 30.1.1.1, local AS number 100
BGP table version is 4, main routing table version 4
3 network entries using 432 bytes of memory
3 path entries using 240 bytes of memory
2/2 BGP path/bestpath attribute entries using 272 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 944 total bytes of memory
BGP activity 3/0 prefixes, 3/0 paths, scan interval 60 secs

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100      45      44        4    0    0 00:35:34        1
2.2.2.2         4          100       7       7        4    0    0 00:00:31        1
R3#

R2#sh ip bgp
BGP table version is 6, local router ID is 20.1.1.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 10.0.0.0/24      1.1.1.1                  0    100      0 i
 *>  20.0.0.0/24      0.0.0.0                  0         32768 i
 *>i 30.0.0.0/24      3.3.3.3                  0    100      0 i
R2#
R2#
R2#ping 30.0.0.1 source loopback0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 30.0.0.1, timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/34/44 ms

R3#sh ip bgp
BGP table version is 4, local router ID is 30.1.1.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,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>i 10.0.0.0/24      1.1.1.1                  0    100      0 i
 *>i 20.0.0.0/24      2.2.2.2                  0    100      0 i
 *>  30.0.0.0/24      0.0.0.0                  0         32768 i
R3#
R3#
R3#ping 20.0.0.1 sou
R3#ping 20.0.0.1 source loopback 0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.0.0.1, timeout is 2 seconds:
Packet sent with a source address of 3.3.3.3
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/33/64 ms

Thanks for Reading !!

amartechstuff

 

 

 


Sunday, 14 March 2021

BGP Chapter 20 - BGP Authentication

Simple
Supports Message Digest 5 (MD5) algorithm
Not mandatory
Incase used both the peers should have same password to form BGP neighborship. 

 


 

 

BGP Authentication

 


R1
==============

config t
hostname R1
int eth1/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
exit

config t
int loopback 0
ip add 1.1.1.1 255.255.255.255
exit
exit

config t
ip route 2.2.2.2 255.255.255.255 eth1/0

R2
==============

config t
hostname R2
int eth1/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
exit

config t
int loopback 0
ip add 2.2.2.2 255.255.255.255
exit
exit

config t
ip route 1.1.1.1 255.255.255.255 eth1/0

BGP Configuration
=====================

R1
====
config t
router bgp 100
neighbor 2.2.2.2 remote-as 200
neighbor 2.2.2.2 update-source loopback 0
neighbor 2.2.2.2 ebgp-multihop 255
neighbor 2.2.2.2 soft-reconfiguration in
exit
exit

R2
====
config t
router bgp 200
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loopback 0
neighbor 1.1.1.1 ebgp-multihop 255
neighbor 1.1.1.1 soft-reconfiguration in
exit
exit

BGP Authentication Configuration
==================================
R1
====

R1(config)#
R1(config)#router bgp 100
R1(config-router)#neighbor 2.2.2.2 password ?
  <0-7>  Encryption type (0 to disable encryption, 7 for proprietary)
  LINE   The password

R1(config-router)#neighbor 2.2.2.2 password cisco123
R1(config-router)#exit
R1(config)#
R1(config)#exit


*Mar 13 14:09:37.667: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(33269) to 1.1.1.1(179) tableid - 0
*Mar 13 14:09:39.663: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(33269) to 1.1.1.1(179) tableid - 0
*Mar 13 14:09:43.671: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(33269) to 1.1.1.1(179) tableid - 0
*Mar 13 14:09:51.671: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(33269) to 1.1.1.1(179) tableid - 0

Lets quickly configure on R2 also

R2
====
config t
router bgp 200
neighbor 1.1.1.1 password cisco123
exit

After configuration the neighborship is now up

Logs on R1
=================
*Mar 13 14:12:31.591: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(27868) to 1.1.1.1(179) tableid - 0
*Mar 13 14:12:39.591: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(27868) to 1.1.1.1(179) tableid - 0
*Mar 13 14:13:01.599: %BGP-5-ADJCHANGE: neighbor 2.2.2.2 Up

R1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4          200       4       5        1    0    0 00:00:48        0


Now I have configured wrong password on R2

R2(config)#router bgp 200
R2(config-router)#neighbor 1.1.1.1 password cisco
R2(config-router)#exit
R2(config)#exit

Logs on R1
=================
*Mar 13 14:17:13.019: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(27879) to 1.1.1.1(179) tableid - 0
*Mar 13 14:17:35.879: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(20365) to 1.1.1.1(179) tableid - 0
*Mar 13 14:17:37.879: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(20365) to 1.1.1.1(179) tableid - 0
*Mar 13 14:17:40.219: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(179) to 1.1.1.1(13155) tableid - 0
*Mar 13 14:17:41.879: %TCP-6-BADAUTH: Invalid MD5 digest from 2.2.2.2(20365) to 1.1.1.1(179) tableid - 0


R1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4          200       0       0        1    0    0 00:01:07 Active

R2#sh ip bgp sum
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100       0       0        1    0    0 00:02:15 Active


Now lets switchback and make the correction in password

& neigbhorship is up

R2#sh ip bgp sum
BGP router identifier 2.2.2.2, local AS number 200
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100       4       4        1    0    0 00:00:05        0

R1#sh run | section bgp
router bgp 100
 bgp log-neighbor-changes
 neighbor 2.2.2.2 remote-as 200
 neighbor 2.2.2.2 password cisco123
 neighbor 2.2.2.2 ebgp-multihop 255
 neighbor 2.2.2.2 update-source Loopback0
 neighbor 2.2.2.2 soft-reconfiguration inbound

R2#sh run | sec bgp
router bgp 200
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 100
 neighbor 1.1.1.1 password cisco123
 neighbor 1.1.1.1 ebgp-multihop 255
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 1.1.1.1 version 4
 neighbor 1.1.1.1 soft-reconfiguration inbound


Thanks for Reading !!!!

amartechstuff

 

Saturday, 13 March 2021

BGP Chapter 21 - BGP Peer Group

 Sometimes it happens that while configuring bgp neighbors some of the configuration for
neighbors is exactly same and configuring the same can irritate you !

So to avoid the same you can use "BGP Peer Group".

For sure it will save time and also CPU resources of the router since whenever BGP sends update
it will send the update for peer group rather than separately for each neighbor.

 

BGP Peer Group

 Basic Configuration

=======================

 R1
===============
config t
hostname R1
interface eth1/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
interface eth1/1
ip add 13.1.1.1 255.255.255.0
no shut
exit
int loopback 0
ip address 1.1.1.1 255.255.255.255
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
exit

R2
===============
config t
hostname R2
interface eth1/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int loopback 0
ip address 2.2.2.2 255.255.255.255
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
exit

R3
===============
config t
hostname R3
interface eth1/1
ip add 13.1.1.3 255.255.255.0
no shut
exit
int loopback 0
ip address 3.3.3.3 255.255.255.255
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
exit
exit
==============================================
BGP Configuration on R2
==========================
config t
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loopback 0
neighbor 1.1.1.1 password cisco123
exit

BGP Configuration on R3
==========================
config t
router bgp 100
neighbor 1.1.1.1 remote-as 100
neighbor 1.1.1.1 update-source loopback 0
neighbor 1.1.1.1 password cisco123
exit

Without Peer Group
=========================
BGP Configuration on R1

config t
router bgp 100
neighbor 2.2.2.2 remote-as 100
neighbor 2.2.2.2 update-source loopback 0
neighbor 2.2.2.2 password cisco123
neighbor 3.3.3.3 remote-as 100
neighbor 3.3.3.3 update-source loopback 0
neighbor 3.3.3.3 password cisco123
exit


With Peer Group

=========================
BGP Configuration on R1

config t
router bgp 100
neighbor amar peer-group
neighbor amar remote-as 100
neighbor amar update-source loopback 0
neighbor amar password cisco123
neighbor 2.2.2.2 peer-group amar
neighbor 3.3.3.3 peer-group amar
exit
exit

R1#sh run | section bgp
router bgp 100
 bgp log-neighbor-changes
 neighbor amar peer-group
 neighbor amar remote-as 100
 neighbor amar password cisco123
 neighbor amar update-source Loopback0
 neighbor 2.2.2.2 peer-group amar
 neighbor 3.3.3.3 peer-group amar
R1#
R1#
R1#sh ip bgp summ
R1#sh ip bgp summary
BGP router identifier 1.1.1.1, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.2.2.2         4          100       6       6        1    0    0 00:02:05        0
3.3.3.3         4          100       6       4        1    0    0 00:02:04        0
R1#

R2#sh ip bgp summary
BGP router identifier 2.2.2.2, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100      13      13        1    0    0 00:08:33        0
R2#

R3#sh ip bgp summary
BGP router identifier 3.3.3.3, local AS number 100
BGP table version is 1, main routing table version 1

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4          100      10      13        1    0    0 00:08:09        0
R3#

Thanks for reading !!!!

 amartechstuff

 



Wednesday, 3 February 2021

BGP CHAPTER 19 - BGP PATH SELECTION

 In BGP Table – If there are multiple paths to reach a destination network then BGP PATH SELECTION comes into picture.

 


 

 

BGP Table

Unlike other Routing Protocol it is very different 


Can’t Compare with IGPs –RIP , OSPF , EIGRP 

Comparing IGP and BGP Metric

BGP ATTRIBUTES PLAYS A VERY IMPORTANT ROLE
 BGP PATH SELECTION MNEMONIC 

We Love Oranges AS Oranges Mean Pure Refreshment”

BGP BEST PATH SELECTION MNEMONIC 

 BGP PATH SELECTION

 Condition :- The route should have valid Next hop then it will consider for BGP Path Selection.

Highest Weight is preferred.(local to the router)
Highest Local Preference is preferred.
Locally Originate routes are preferred.
Shortest AS Path is preferred.
Lowest Origin code is preferred.
Lowest MED value is preferred.
Path - EBGP is preferred over IBGP.
The path with the lowest BGP neighbor Router ID
Few more ………….  
The path within the AS with the lowest IGP metric to the BGP next hop
Oldest Path – the path that was received first
The path with the lowest neighbor IP address.
 
Thanks for Reading 
amartechstuff