Lab 10 - Routing Protocols (Static, OSPF, BGP)

Back to Labs

Lab Objective

To understand and implement different routing protocols including static routing, OSPF (Open Shortest Path First), and BGP (Border Gateway Protocol) in network configurations.

1. Routing Protocols Overview

Default Route

A default route is used to forward packets whose destination is not in the routing table.

Typically used on stub networks (networks with only one exit path).

Static Routes

Used when the router is connected to multiple networks and you want to manually define paths to reach them.

2. Router Interface Configuration

Example commands:

Router(config)#interface fa0/0
Router(config-if)#ip address 192.168.1.129 255.255.255.192
Router(config-if)#no shutdown
Explanation:
fa0/0 → Router interface being configured
ip address 192.168.1.129 255.255.255.192 → Assigns IP and subnet mask
no shutdown → Activates the interface (routers are shut down by default)
Repeat for all interfaces with appropriate IP addresses.

3. Default Route Example (Router 3)

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.221
Explanation:
0.0.0.0 0.0.0.0 → Matches all destinations (default)
192.168.1.221 → Next-hop router to forward packets
Router 3 only has one exit path, so default routing is enough.

4. Static Routes Example (Router 0)

ip route 192.168.1.64 255.255.255.192 192.168.1.214
ip route 192.168.1.160 255.255.255.224 192.168.1.209
ip route 192.168.1.192 255.255.255.240 192.168.1.209
ip route 192.168.1.224 255.255.255.252 192.168.1.222
Explanation:
• Router 0 is connected to multiple networks
• Each command defines a destination network, subnet mask, and next-hop router
• Example: "To reach 192.168.1.64/26, send packets to 192.168.1.214"
Repeat similar configurations on all routers.

5. Viewing the Routing Table

show ip route
Shows:
• Directly connected networks
• Static routes
• Default routes
• Dynamically learned routes (OSPF/BGP)
Alternative: Use Packet Tracer Inspect Tool → Routing Table.

6. Troubleshooting Routing Issues

  • Request timed out → Packet could not return to source; typically the return path is missing.
  • Destination host unreachable → Router does not know the path to the destination; forward path is missing.

7. Dynamic Routing: OSPF

Overview

Open Shortest Path First (OSPF) uses Dijkstra's algorithm to find the shortest path.

Supports:

  • Fast convergence
  • Multi-area and multi-vendor deployment
  • VLSM/CIDR
  • Multiple equal-cost paths

Terminology

  • Router ID, Neighbor, Adjacency
  • Hello Protocol, Link-State Advertisement (LSA)
  • Topology Database, OSPF Areas, Link Cost

OSPF Configuration Example

router ospf 1
network 10.0.0.0 0.255.255.255 area 0
Explanation:
1 → OSPF process ID
network 10.0.0.0 0.255.255.255 → All interfaces matching 10.x.x.x will participate in OSPF
area 0 → Backbone area

Wildcard Mask:
Wildcard = inverse of subnet mask
Example: Subnet mask /28 → 255.255.255.240 → Wildcard 0.0.0.15

8. Dynamic Routing: BGP

Overview

BGP is a path-vector protocol used between autonomous systems (AS).

Makes routing decisions based on:

  • AS path
  • Next-hop
  • Local preference
  • Policies

BGP ensures stable, scalable inter-domain routing.

BGP Configuration Examples

Router R0 (AS 1)

router bgp 1
neighbor 172.16.0.2 remote-as 71
network 10.0.0.0 mask 255.0.0.0
Explanation:
• Router R0 is in AS 1
• Connects to neighbor in AS 71
• Advertises 10.0.0.0/8 network

Router R1 (AS 71)

router bgp 71
neighbor 172.16.0.1 remote-as 1
neighbor 172.14.0.2 remote-as 79
network 40.0.0.0 mask 255.0.0.0
Explanation:
• Router R1 is in AS 71
• Connects to AS 1 and AS 79
• Advertises 40.0.0.0/8 network

Router R3 (AS 79)

router bgp 79
neighbor 172.14.0.1 remote-as 71
network 40.0.0.0 mask 255.0.0.0
Explanation:
• Router R3 is in AS 79
• Connects to AS 71
• Advertises 40.0.0.0/8

9. BGP Testing & Verification

Essential BGP Verification Commands

ping
Ping from PC to another PC → Check connectivity
show ip bgp
Check BGP routes and routing table
show ip bgp summary
Check BGP neighbor status and summary information
show ip bgp neighbors
Detailed information about BGP neighbors
show running-config | section bgp
Check running configuration for BGP settings
Purpose:
• Confirm neighbors are up
• Confirm networks are advertised
• Confirm proper routing paths
• Verify BGP session status and statistics

BGP Summary Output Example

Router# show ip bgp summary
BGP router identifier 192.168.1.1, local AS number 1
BGP table version is 5, main routing table version 5
4 network entries using 576 bytes of memory
4 path entries using 208 bytes of memory
3/2 BGP path/bestpath attribute entries using 408 bytes of memory
1 BGP AS-PATH entries using 24 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 1216 total bytes of memory
BGP activity 10/6 prefixes, 10/6 paths, scan interval 60 secs

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
172.16.0.2      4    71     125     120        5    0    0 01:45:30        2
172.14.0.2      4    79      98      95        5    0    0 01:30:15        1
Key Fields Explanation:
Neighbor → BGP peer IP address
AS → Autonomous System number of the neighbor
MsgRcvd/MsgSent → BGP messages exchanged
Up/Down → Session duration
State/PfxRcd → Session state and prefixes received
TblVer → BGP table version

Lab Resources

Lab 10 Task

Download PDF