Basic OSPF Configuration Lab

노션으로 옮김·2024년 1월 1일
0

OSPF

Open Shortest Path First (OSPF) is a link-state routing protocol used as an Interior Gateway Protocol (IGP).
It calculates the cost of each interface and determines the shortest path using the Dijkstra algorithm.

For more information about OSPF, reference to the following link:
https://www.cisco.com/c/ko_kr/support/docs/ip/open-shortest-path-first-ospf/7039-1.html

Topology Diagram

Step-by-Step Configuration

LAN Network Setup

Do basic setup tasks, such as assigning IP addresses, specifying a gateway, and so on for LAN networks.

Serial Interface Setup

In addtion to the basic network setup, we need to synchronize bandwith, and clock rate between Data Communication Equipment (DCE) and Data Terminal Equipment (DTE):

# Router2 - Se0/1/1 (DCE)


Router2(config)#int serial 0/1/1
Router2(config-if)#clock rate 128000
Router2(config-if)#bandwidth 128000

# Router3 - Se0/1/0 (DTE)


Router3(config)#int serial 0/1/0
Router3(config-if)#bandwidth 128000

You can check a serial interface configuration like this:


Router3#show controllers serial 0/1/0
Interface Serial0/1/0
Hardware is PowerQUICC MPC860
DTE V.35 TX and RX clocks detected
idb at 0x81081AC4, driver data structure at 0x81084AC0
SCC Registers:
General [GSMR]=0x2:0x00000000, Protocol-specific [PSMR]=0x8
Events [SCCE]=0x0000, Mask [SCCM]=0x0000, Status [SCCS]=0x00
...
...

Router3#show interfaces serial 0/1/0
Serial0/1/0 is administratively down, line protocol is down (disabled)
  Hardware is HD64570
  MTU 1500 bytes, BW 128000 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set, keepalive set (10 sec)
  Last input never, output never, output hang never
  ...
  ...

OSPF Advertisement Configuration

For each router, add the network addresses that are in its domain to the advertisement table within area 0:


Router1(config)#router ospf 1
Router1(config-router)#network 172.16.1.16 0.0.0.15 area 0
Router1(config-router)#network 192.168.10.0 0.0.0.3 area 0
Router1(config-router)#network 192.168.10.4 0.0.0.3 area 0

Upon completing the OSPF setup for all routers, you would see the following message (or something similar to this) :


00:18:01: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.10.9 on Serial0/0/1
from EXCHANGE to FULL, Exchange Done

Things to Check

Check Communication Status

When using the ping command on PC1, ICMP traffic has been successfully sent from PC1 to PC2:

Verify the Operation of the Shortest Path Algorithm

Currently, the shortest path from PC1 to PC0 is via Serial 0/1/0 on Router1:

To identify the calculated OSPF routes, type show ip route:


Router1#show ip route

<output omitted>

     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0/24 [110/2] via 192.168.10.2, 00:44:54, Serial0/1/0
     172.16.0.0/16 is variably subnetted, 3 subnets, 3 masks
C       172.16.1.16/28 is directly connected, GigabitEthernet0/0/0
L       172.16.1.17/32 is directly connected, GigabitEthernet0/0/0
O       172.16.1.32/29 [110/2] via 192.168.10.6, 00:40:32, Serial0/1/1
     192.168.10.0/24 is variably subnetted, 5 subnets, 2 masks
C       192.168.10.0/30 is directly connected, Serial0/1/0
L       192.168.10.1/32 is directly connected, Serial0/1/0
C       192.168.10.4/30 is directly connected, Serial0/1/1
L       192.168.10.5/32 is directly connected, Serial0/1/1
O       192.168.10.8/30 [110/2] via 192.168.10.2, 00:40:32, Serial0/1/0
                        [110/2] via 192.168.10.6, 00:40:32, Serial0/1/1

By looking at the first row in the above table, we can determine that traffic to 10.10.10.0/24 is routed through Serial0/1/0.

For more details about a specific interface, type show ip ospf interface:


Router1#show ip ospf interface 

GigabitEthernet0/0/0 is up, line protocol is up

<output omitted>

Serial0/1/0 is up, line protocol is up
  Internet address is 192.168.10.1/30, Area 0
  Process ID 1, Router ID 192.168.10.1, Network Type POINT-TO-POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT-TO-POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:01
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 10.10.10.1
  Suppress hello for 0 neighbor(s)
Serial0/1/1 is up, line protocol is up
  Internet address is 192.168.10.5/30, Area 0
  Process ID 1, Router ID 192.168.10.1, Network Type POINT-TO-POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT-TO-POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:01
  Index 3/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 172.16.1.33
  Suppress hello for 0 neighbor(s)

Both costs of Serial 0/1/0 and Serial 0/1/1 are set to the value of 1.

This time, let's adjust the bandwidth of Serial 0/1/0 to make the shortest path change:


Router1(config)#int serial 0/1/0
Router1(config-if)#bandwidth 2

For synchronization with Router2, it is advisable to change the bandwidth of Serial 0/1/0 on Router2 as well:


Router2(config)#int serial 0/1/0
Router2(config-if)#bandwidth 2

Check Once Again

Let's verify if the shortest path has been changed:


Router1#show ip route 

<output omitted>

     10.0.0.0/24 is subnetted, 1 subnets
O       10.10.10.0/24 [110/3] via 192.168.10.6, 00:00:37, Serial0/1/1
     172.16.0.0/16 is variably subnetted, 3 subnets, 3 masks
C       172.16.1.16/28 is directly connected, GigabitEthernet0/0/0
L       172.16.1.17/32 is directly connected, GigabitEthernet0/0/0
O       172.16.1.32/29 [110/2] via 192.168.10.6, 00:44:54, Serial0/1/1
     192.168.10.0/24 is variably subnetted, 5 subnets, 2 masks
C       192.168.10.0/30 is directly connected, Serial0/1/0
L       192.168.10.1/32 is directly connected, Serial0/1/0
C       192.168.10.4/30 is directly connected, Serial0/1/1
L       192.168.10.5/32 is directly connected, Serial0/1/1
O       192.168.10.8/30 [110/2] via 192.168.10.6, 00:00:37, Serial0/1/1

For now, traffic to 10.10.10.0/24 is routed through Serial0/1/1.

Additionally, the cost of Serial0/1/1 has been updated from 1 to 50000:


Router1#show ip ospf interface 

GigabitEthernet0/0/0 is up, line protocol is up

<output omitted>

  Internet address is 192.168.10.1/30, Area 0
  Process ID 1, Router ID 192.168.10.1, Network Type POINT-TO-POINT, Cost: 50000
  Transmit Delay is 1 sec, State POINT-TO-POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:04
  Index 2/2, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 10.10.10.1
  Suppress hello for 0 neighbor(s)
Serial0/1/1 is up, line protocol is up
  Internet address is 192.168.10.5/30, Area 0
  Process ID 1, Router ID 192.168.10.1, Network Type POINT-TO-POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT-TO-POINT,
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03
  Index 3/3, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  Neighbor Count is 1 , Adjacent neighbor count is 1
    Adjacent with neighbor 172.16.1.33
  Suppress hello for 0 neighbor(s)

When using the ping command on PC1 again, ICMP traffic is routed throughSerial 0/1/1 on Router1:

References

#1 https://community.cisco.com/legacyfs/online/legacy/8/9/9/68998-OSPF%20Lab11-1.pdf

0개의 댓글