BGP Routing Protocol Practice Lab 01

 

BGP Routing Protocol Practice Lab 01



Lab 1: MED and AS-Path Prepend


Basic configuration

R1:

interface Loopback0

ip address 1.1.1.1 255.255.255.255

!

interface FastEthernet0/0 
ip address 150.1.1.1 255.255.255.0
 no shut

!

interface Serial0/0

ip address 10.0.0.1 255.255.255.252

no shut

R2:

interface Loopback0

ip address 2.2.2.2 255.255.255.255

!

interface Loopback192

ip address 192.1.1.1 255.255.255.0

!

interface Loopback193

ip address 193.1.1.1 255.255.255.0

!

interface Loopback194

ip address 194.1.1.1 255.255.255.0

!

interface Loopback195

ip address 195.1.1.1 255.255.255.0

!

interface Serial0/0

ip address 10.0.0.2 255.255.255.252

no shut !

interface Serial0/1

ip address 10.0.0.9 255.255.255.252

no shut



R3:

interface Loopback0

ip address 3.3.3.3 255.255.255.255

!

interface FastEthernet0/0 ip address 150.3.3.3 255.255.255.0 no shut

!

interface Serial0/1

ip address 10.0.0.10 255.255.255.252

no shut !

interface Serial0/2

ip address 10.0.0.13 255.255.255.252

no shut !

interface Serial0/3

ip address 10.0.0.17 255.255.255.252

no shut




R4:


interface Loopback0

ip address 4.4.4.4 255.255.255.255

!

interface FastEthernet0/0 ip address 150.1.1.4 255.255.255.0 no shut

!

interface Serial0/0

ip address 10.0.0.14 255.255.255.252

no shut !

interface Serial0/1

ip address 10.0.0.18 255.255.255.252

no shut




Configure BGP as illustrated in the topology. Use the Loopback 0 addresses for peering. Do NOT configure any IGPs. Instead, use static routes only. R1 should peer with R2 and R4. R2 should peer with R1 and R3. R3 should peer with R2 and R4. R4 should peer with R1 and R3.



R1(config)#ip route 2.2.2.2 255.255.255.255 serial 0/0

R1(config)#ip route 4.4.4.4 255.255.255.255 fastethernet 0/0 150.1.1.4

R1(config)#router bgp 1

R1(config-router)#neighbor 2.2.2.2 remote-as 2

R1(config-router)#neighbor 2.2.2.2 update-source loopback 0

R1(config-router)#neighbor 2.2.2.2 ebgp-multihop 3

R1(config-router)#neighbor 4.4.4.4 remote-as 4

R1(config-router)#neighbor 4.4.4.4 update-source loopback 0

R1(config-router)#neighbor 4.4.4.4 ebgp-multihop 3



R2(config)#ip route 1.1.1.1 255.255.255.255 serial 0/0

R2(config)#ip route 3.3.3.3 255.255.255.255 serial 0/1

R2(config)#router bgp 2

R2(config-router)#neighbor 1.1.1.1 remote-as 1

R2(config-router)#neighbor 1.1.1.1 update-source loopback 0

R2(config-router)#neighbor 1.1.1.1 ebgp-multihop 3

R2(config-router)#neighbor 3.3.3.3 remote-as 3

R2(config-router)#neighbor 3.3.3.3 update-source loopback 0

R2(config-router)#neighbor 3.3.3.3 ebgp-multihop 3




R3(config)#ip route 2.2.2.2 255.255.255.255 serial 1/1

R3(config)#ip route 4.4.4.4 255.255.255.255 serial 1/2

R3(config)#ip route 4.4.4.4 255.255.255.255 serial 1/3

R3(config)#router bgp 3

R3(config-router)#neighbor 2.2.2.2 remote-as 2

R3(config-router)#neighbor 2.2.2.2 update-source loopback 0

R3(config-router)#neighbor 2.2.2.2 ebgp-multihop 3

R3(config-router)#neighbor 4.4.4.4 remote-as 4

R3(config-router)#neighbor 4.4.4.4 update-source loopback 0

R3(config-router)#neighbor 4.4.4.4 ebgp-multihop 3




R4(config)#ip route 1.1.1.1 255.255.255.255 fastethernet 0/0 150.1.1.1

R4(config)#ip route 3.3.3.3 255.255.255.255 serial 0/0

R4(config)#ip route 3.3.3.3 255.255.255.255 serial 0/1

R4(config)#router bgp 4

R4(config-router)#neighbor 1.1.1.1 remote-as 1

R4(config-router)#neighbor 1.1.1.1 update-source loopback 0

R4(config-router)#neighbor 1.1.1.1 ebgp-multihop 3

R4(config-router)#neighbor 3.3.3.3 remote-as 3

R4(config-router)#neighbor 3.3.3.3 update-source loopback 0

R4(config-router)#neighbor 3.3.3.3 ebgp-multihop 3




In order to ensure that the ORIGIN code is INCOMPLETE, you need to redistribute the LAN subnets into BGP. However, you can also use the network statement in conjunction with a route map and set the ORIGIN code within the route map.



R1(config)#route-map CONNECTED permit 10

R1(config-route-map)#match interface fastethernet 0/0

R1(config-route-map)#exit

R1(config)#route-map CONNECTED deny 20

R1(config-route-map)#exit

R1(config)#router bgp 1

R1(config-router)#redistribute connected route-map CONNECTED R1(config-router)#exit





You can verify the ORIGIN code by looking at the prefix entry in the BGP Tables. The ORIGIN code of INCOMPLETE is denoted by a question mark (?) in the output of the show ip bgp command. You can view additional detail on a per-prefix basis also when using this command



show ip bgp


show ip bgp


show ip bgp

show ip bgp




Configure BGP, so that R4 prefers the path via R3 to reach any subnet

In the output of the show ip bgp command on R4 we can see that the preferred route to reach 150.3.3.0 is via R3, however the preferred route to reach 150.2.2.0 is via R1 (the lowest routerid), also, to ensure that the subnet 150.1.1.0 will be reached via R3, configure BGP on R1 to advertise all prefixes with a longer AS-PATH to influence the path selection as follow:




R1(config)#route-map PREP permit 10

R1(config-route-map)#set as-path prepend 1 1 1 1 R1(config-route-map)#exit

R1(config)#router bgp 1

R1(config-router)#neighbor 4.4.4.4 route-map PREP out R1(config-router)#exit



Notice now the preferred path to reach both prefixes 150.3.3.0 and 150.2.2.0 is via R3 with the next-hop 3.3.3.3 because the shortest AS-PATH length:



do show ip bgp



Configure R4 so that it sends all updates to R3 with a MED of 4. Configure R2 so that it sends all updates to R3 with a MED of 2. Ensure that R3 prefers all routes with the better (lower) MED value.

Before configuring the MED let's verify the BGP RIBs on R3:

The preferred path to reach the prefix 150.1.1.0 is via R4, we should see all routes with the next-hop R2:





Let's configure MED




Let's configure MED on R3:

R4(config)#route-map MED permit 10

R4(config-route-map)#set metric 4

R4(config-route-map)#exit

R4(config)#router bgp 4

R4(config-router)#neighbor 3.3.3.3 route-map MED out

R4(config-router)#exit



R2(config)#route-map MED permit 10

R2(config-route-map)#set metric 2

R2(config-route-map)#exit

R2(config)#router bgp 2


R2(config-router)#neighbor 3.3.3.3 route-map MED out

R2(config-router)#exit





Let's verify the BGP RIBs of R3:

We have still the best path to reach 150.1.1.0 via R4 as shown by the show ip bgp command on R3 below, so the problem is not resolved even if R2 advertises the lowest MED comparing with R4.

The reason is: we met two issues in this case:

-the first issue is: by default, the MED is only compared for path received from the same AS ,in this case R3 receives two values of MED from two routers (R2 and R4) configured in different AS.

-The second issue: the MED is compared after the AS-PATH in the BGP decision process. In this case R3 will select the path via R4 as the best path to the 150.1.1.0/24 prefix because of the shorter AS-PATH length.



BGP MED




To override the two issues, configure the bgp always-compare-med command to avoid the first issue so always compare the MED even if MED is received from Different AS. And bgp bestpath as-path ignore command to avoid the second issue so that R3 override the BGP decision process by ignoring the step of the AS-PATH in the BGP Decision Process:

Let's configure these two commands:



R3(config)#router bgp 3

R3(config-router)#bgp bestpath as-path ignore R3(config-router)#bgp always-compare-med



We can see for the prefix 150.1.1.0 that the path with the longer AS-PATH length is preferred because the lowest MED even if the AS-PATH takes precedence over the MED in the order of the path selection in BGP:


BGP



Another way to verify all BGP RIBs with do show ip bgp, R3 prefers all routes from R2 because the lowest MED:





#BGP #LAB #CCNA #CCNP #CCIE #cisco #gns3 #solution

















I-BGP USING FULL MESH NEIGHBORSHIP & BGP SPLIT HORIZON RULE - LAB

 I-BGP USING FULL MESH NEIGHBORSHIP & BGP SPLIT HORIZON RULE






Assign the basic IP Addressing as per the routers!

Router>enable Router#configure terminal Router(config)#hostname R-1

R-1(config)#interface gig0/0

R-1(config-if)#ip add 1.1.1.1 255.0.0.0

R-1(config-if)#no shut R-1(config-if)#exit

R-1(config)#interface gig0/1

R-1(config-if)#ip add 4.4.4.2 255.0.0.0

R-1(config-if)#no shut R-1(config-if)#exit

R-1(config)#interface gig0/2

R-1(config-if)#ip add 10.1.1.1 255.0.0.0

R-1(config-if)#no shut R-1(config-if)#exit

.


Router>enable Router#configure terminal Router(config)#hostname R-2

R-2(config)#interface gig0/0

R-2(config-if)#ip add 1.1.1.2 255.0.0.0

R-2(config-if)#no shut R-2(config-if)#exit

R-2(config)#int gig0/1

R-2(config-if)#ip add 2.2.2.1 255.0.0.0

R-2(config-if)#no shut R-2(config-if)#exit

R-2(config)#interface gig0/2

R-2(config-if)#ip add 20.1.1.1 255.0.0.0

R-2(config-if)#no shut R-2(config-if)#exit

Router>enable Router#configure terminal Router(config)#hostname R-3

R-3(config)#interface gig0/0

R-3(config-if)#ip add 2.2.2.2 255.0.0.0

R-3(config-if)#no shut R-3(config-if)#exit

R-3(config)#int gig0/1

R-3(config-if)#ip add 3.3.3.1 255.0.0.0

R-3(config-if)#no shut R-3(config-if)#exit

R-3(config)#int gig0/2

R-3(config-if)#ip add 30.1.1.1 255.0.0.0

R-3(config-if)#no shut R-3(config-if)#exit

& Now finally the last which IP implementations of R-4

Router>enable Router#configure terminal Router(config)#hostname R-4

R-4(config)#interface gig0/0

R-4(config-if)#ip add 4.4.4.1 255.0.0.0

R-4(config-if)#no shut R-4(config-if)#exit


R-4(config)#int gig0/1

R-4(config-if)#ip add 3.3.3.2 255.0.0.0

R-4(config-if)#no shut R-4(config-if)#exit

R-4(config)#int gig0/2

R-4(config-if)#ip add 40.1.1.1 255.0.0.0

R-4(config-if)#no shut R-4(config-if)#exit


Now we’ll implement I-BGP on all the routers.

R-1(config)#router bgp 500 R-1(config-router)#no sync R-1(config-router)#no auto-sum

R-1(config-router)#neighbor 1.1.1.2 remote-as 500

R-1(config-router)#neighbor 4.4.4.1 remote-as 500

R-1(config-router)#network 1.0.0.0

R-1(config-router)#network 4.0.0.0

R-1(config-router)#network 10.0.0.0

R-1(config-router)#exit





R-2(config)#router bgp 500

R-2(config-router)#no auto-sum

R-2(config-router)#no sync

R-2(config-router)#neighbor 2.2.2.2 remote-as 500

R-2(config-router)#neighbor 1.1.1.1 remote-as 500

R-2(config-router)#network 1.0.0.0

R-2(config-router)#network 20.0.0.0

R-2(config-router)#network 2.0.0.0



R-3(config)#router bgp 500

R-3(config-router)#no auto-sum

R-3(config-router)#no sync

R-3(config-router)#neighbor 3.3.3.2 remote-as 500

R-3(config-router)#neighbor 2.2.2.1 remote-as 500

R-3(config-router)#network 2.0.0.0

R-3(config-router)#network 3.0.0.0

R-3(config-router)#network 30.0.0.0



R-4(config)#router bgp 500

R-4(config-router)#no auto-sum

R-4(config-router)#no sync

R-4(config-router)#neighbor 4.4.4.2 remote-as 500

R-4(config-router)#neighbor 3.3.3.1 remote-as 500

R-4(config-router)#network 4.0.0.0

R-4(config-router)#network 3.0.0.0

R-4(config-router)#network 40.0.0.0





So, as per the implementations of i-BGP we can see that there’s a trouble in our verifications which is that –

R-1 is not having the routing entry for the network 30.0.0.0 which is on R-3. 
R-3 is not having the routing entry for the network 10.0.0.0 which is on R-1. 
R-2 is not having the routing entry for the network 40.0.0.0 which is on R-4. 
R-4 is not having the routing entry for the network 20.0.0.0 which is on R-2.

Now as per this, the routes are shared via the directly connected neighbors.

But something we discussed “BGP Split Horizon Rule” is here –

By-default as per i-BGP the default rule says that an update sent by one i-BGP neighbor should not be sent back to another i-BGP neighbor.

To overcome this cause, we’ll use full-mesh neighborship.

R-1(config)#router bgp 500

R-1(config-router)#neighbor 2.2.2.2 remote-as 500

R-3(config)#router bgp 500

R-3(config-router)#neighbor 1.1.1.1 remote-as 500

R-3(config-router)#exit



& here’s the routing table verification after defining full-mesh neighborship between R-1 & R-3

#BGP #cisco #lab #practice #learn #useful

🧭 Understanding OSPF Network Types: A Complete Guide for Network Engineers

Understanding OSPF Network Types



 Open Shortest Path First (OSPF) is one of the most widely used interior gateway protocols (IGPs) in enterprise and service provider networks. It helps routers dynamically discover the best path to reach every destination within an autonomous system.

However, one of the most important — yet often misunderstood — parts of OSPF configuration is “Network Types.”

In this article, we’ll break down the different OSPF network types, their uses, benefits, limitations, requirements, and a comparison between them.

Whether you’re preparing for CCNA, CCNP, or designing large-scale networks, understanding OSPF network types is critical for efficient routing and convergence.




🧩 What Are OSPF Network Types?

OSPF supports several network types that define how routers communicate within a particular link or segment.
Each network type affects:

  • How Hello packets are exchanged

  • Whether a Designated Router (DR) and Backup Designated Router (BDR) are elected

  • What kind of adjacencies are formed

  • The type of LSA (Link-State Advertisement) flooding behavior


⚙️ OSPF Network Types and Their Characteristics

1. Broadcast Network Type

  • Used in: Ethernet, FastEthernet, Gigabit Ethernet

  • DR/BDR Election: ✅ Yes

  • Hello Interval: 10 seconds

  • Dead Interval: 40 seconds

  • Adjacency Formation: Full adjacency with DR and BDR only

➡️ Benefits:

  • Reduces overhead by forming adjacencies only with DR/BDR.

  • Efficient LSA flooding through DR.

  • Scales well for large Ethernet networks.

❌ Disadvantages:

  • DR/BDR election adds delay in convergence.

  • If DR/BDR fails, network recalculates adjacencies.


2. Non-Broadcast Multi-Access (NBMA)

  • Used in: Frame Relay, ATM, X.25

  • DR/BDR Election: ✅ Yes

  • Hello Interval: 30 seconds

  • Manual Neighbors Configuration: Required (since broadcast is not supported)

➡️ Benefits:

  • Simulates a broadcast network on non-broadcast media.

  • Still allows DR/BDR for scalability.

❌ Disadvantages:

  • Manual neighbor configuration increases administrative overhead.

  • Slower convergence due to non-broadcast nature.


3. Point-to-Point Network Type

  • Used in: Serial Links, PPP connections, VPN tunnels

  • DR/BDR Election: ❌ No

  • Hello Interval: 10 seconds

  • Adjacency Formation: Full adjacency directly between two routers

➡️ Benefits:

  • Simple configuration; no DR/BDR needed.

  • Fast convergence.

  • Ideal for WAN links.

❌ Disadvantages:

  • Not scalable for multiple routers on a single segment.


4. Point-to-Multipoint Network Type

  • Used in: Hub-and-Spoke topologies (Frame Relay, DMVPN)

  • DR/BDR Election: ❌ No

  • Hello Interval: 30 seconds

  • Adjacency Formation: One adjacency per remote spoke

➡️ Benefits:

  • Works well in hub-and-spoke networks.

  • Does not rely on DR/BDR.

  • Simplifies configuration for dynamic spokes.

❌ Disadvantages:

  • Less efficient LSA flooding (unicast instead of multicast).

  • More CPU utilization on hub routers.



🔄 Comparison of OSPF Network Types

Network TypeMedia TypeDR/BDR ElectionBroadcast SupportNeighbor DiscoveryScalabilityConvergence Speed
BroadcastEthernetYesYesAutomaticHighModerate
NBMAFrame Relay, ATMYesNoManualMediumSlow
Point-to-PointSerial, PPP, VPNNoN/AAutomaticLowFast
Point-to-MultipointHub-and-SpokeNoNoManual or DynamicMedium




Moderate








🧠 Choosing the Right OSPF Network Type

Selecting the correct OSPF network type depends on:

  1. Media Type — Ethernet, Serial, or Virtual link

  2. Topology Design — Hub-and-Spoke, Full Mesh, or Point-to-Point

  3. Scalability Needs — Number of routers on the segment

  4. Performance Requirements — Convergence speed vs. control overhead

👉 Example:

  • Use Broadcast for Ethernet LANs.

  • Use Point-to-Point for WAN links or tunnels.

  • Use Point-to-Multipoint for DMVPN or partial mesh environments.

  • Use NBMA when working with legacy Frame Relay or ATM setups.


🧩 Key Requirements for OSPF Network Types

RequirementBroadcastNBMAPoint-to-PointPoint-to-Multipoint
Hello Interval10s30s10s30s
Manual NeighborNoYesNoOptional
DR/BDRYesYesNoNo
Hello Packet TypeMulticastUnicastMulticastUnicast/Multicast

⚖️ Advantages and Disadvantages Overview

Network TypeAdvantagesDisadvantages
BroadcastEfficient adjacency formation, easy setupDR/BDR overhead
NBMADR/BDR scalability on non-broadcast linksManual neighbor setup
Point-to-PointFast convergence, simpleNot suitable for multi-access
Point-to-MultipointIdeal for hub-spokeHigher CPU, less efficient LSA flooding

🚀 Conclusion

Understanding OSPF network types is vital for designing scalable, stable, and high-performing networks.
Each type has its unique behavior and specific use case, so selecting the right one can drastically improve routing performance and simplify troubleshooting.

As a network engineer, mastering OSPF network types ensures your routing topology is optimized for both efficiency and reliability — a critical skill for real-world implementations and Cisco certifications alike.

OSPF network types, OSPF#OSPF #Networking #Cisco #CCNA #CCNP #RoutingProtocols #NetworkEngineering #FortisNetSolutions #OSPFNetworkTypes #NetworkDesign #CCIE #CyberSecurity #ITInfrastructure point-to-point, OSPF broadcast vs NBMA, OSPF adjacency formation, OSPF DR BDR election, CCNA OSPF tutorial, OSPF configuration guide, OSPF topology types, network engineering, Cisco OSPF explained

Featured Post

Day 41 — BGP Confederations: Sub-AS Design, External View and Migration

1. Opening Confederations are another way to scale BGP inside a large administrative domain. They divide the domain into member autonomous systems while presenting a single confederation identifier to external peers. They are powerful, but their operational model is more complex than simply 'using private ASNs inside.' The engineering goal is not to memorize another BGP command. It is to understand what information each speaker is allowed to propagate, what path information can be hidden, and what failure domain is created by the chosen control-plane architecture . 2. Concept and standards behavior RFC 5065 defines AS_CONFED_SEQUENCE and AS_CONFED_SET and how member-AS relationships are represented. Confederation external sessions have eBGP-like properties inside the confederation, while the confederation is presented externally as one AS. Modern guidance must also account for the fact that RFC 9774 prohibits new origination of AS_SET/AS_CONFED_SET in ordinary aggregation c...