PT3: Multiarea OSPFv2

I denna laboration fortsätter vi utforska konfigurationer av multiarea OSPFv2. Förutom aktivering av OSPFv2 fokuserar vi på kommandot clear ip ospf process. Detta kommandot används för att rensa OSPF-processens databaser och återställa dess tillstånd till startläget. Det kan vara användbart i flera olika scenarier, inklusive:

  • Felsökning: Om det finns problem med OSPF-anslutningar, routing-tabeller eller grannrelationer kan rensning av OSPF-processen och återställning till startläget bidra till att lösa problemen.
  • Konfigurationsändringar: Efter att ha gjort betydande konfigurationsändringar relaterade till OSPF, som till exempel att lägga till eller ta bort nätverk eller interface, kan det vara nödvändigt att rensa OSPF-processen för att tillämpa de nya inställningarna.
  • Hantering av förändringar i nätverket: Om nätverksstrukturen har förändrats avsevärt, till exempel genom att lägga till eller ta bort routrar eller interface, kan det vara lämpligt att rensa OSPF-processen för att anpassa den till de nya förhållandena.

Det är viktigt att notera att kommandot ”clear ip ospf process” bör användas med försiktighet eftersom det kan orsaka tillfällig avbrott i OSPF-tjänsten.

Topologi

Konfigurationer

  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname ISP
  • ISP(config)# interface
  • ISP(config-if)# interface g0/0
  • ISP(config-if)# description Connected to ASBR Diginto
  • ISP(config-if)# ip address 209.165.100.17 255.255.255.240
  • ISP(config-if)# no shutdown
  • ISP(config-if)#  exit
  • ISP(config)# ip route 0.0.0.0 0.0.0.0 g0/0
  • ISP(config)# end
  • ISP#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname ASBR
  • ASBR(config)# interface g0/0
  • ASBR(config-if)# description Connected to ISP
  • ASBR(config-if)# ip address 209.165.200.18 255.255.255.240
  • ASBR(config-if)# no shutdown
  • ASBR(config-if)# exit
  • ASBR(config)# interface s0/0/0
  • ASBR(config-if)# description Connected to ABR1
  • ASBR(config-if)# ip address 10.1.1.2 255.255.255.252
  • ASBR(config-if)# no shutdown
  • ASBR(config-if)# exit
  • ASBR(config)# interface s0/0/1
  • ASBR(config-if)# description DCE Connected to ABR2
  • ASBR(config-if)# ip address 10.2.2.2 255.255.255.252
  • ASBR(config-if)# clock rate 128000
  • ASBR(config-if)# no shutdown
  • ASBR(config-if)# exit
  • ASBR(config)# ip route 0.0.0.0 0.0.0.0 g0/0
  • ASBR(config)# router ospf 1
  • ASBR(config-router)# router-id 7.7.7.7
  • ASBR(config-router)# network 10.1.1.0 0.0.0.3 area 0
  • ASBR(config-router)# network 10.2.2.0 0.0.0.3 area 0
  • ASBR(config-router)# default-information originate
  • ASBR(config-router)# end
  • ASBR#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname ABR1
  • ABR1(config)# interface s0/0/0
  • ABR1(config-if)# description DCE Connected to ASBR area 0
  • ABR1(config-if)# ip address 10.1.1.1 255.255.255.252
  • ABR1(config-if)# clock rate 128000
  • ABR1(config-if)# no shutdown
  • ABR1(config-if)# exit
  • ABR1(config)# interface g0/1
  • ABR1(config-if)# description Connected to R1 area 1
  • ABR1(config-if)# ip address 192.168.1.1 255.255.255.0
  • ABR1(config-if)# no shutdown
  • ABR1(config-if)# exit
  • ABR1(config)# router ospf 1
  • ABR1(config-router)# router-id 5.5.5.5
  • ABR1(config-router)# network 10.1.1.1 0.0.0.0 area 0
  • ABR1(config-router)# network 192.168.1.0 0.0.0.255 area 1
  • ABR1(config-router)# end
  • ABR1#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R1
  • R1(config)# interface g0/1
  • R1(config-if)# description Connected to ABR1 area 1
  • R1(config-if)# ip address 192.168.1.2 255.255.255.0
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • R1(config)# interface g0/0
  • R1(config-if)# description Connected to R2 area 1
  • R1(config-if)# ip address 192.168.2.1 255.255.255.0
  • R1(config-if)# no shutdown
  • R1(config-if)# exit
  • R1(config)# interface lo0
  • R1(config-if)# description Connected to Simulated LAN
  • R1(config-if)# ip address 192.168.3.1 255.255.255.0
  • R1(config-if)# exit
  • R1(config)# router ospf 1
  • R1(config-router)# router-id 1.1.1.1
  • R1(config-router)# network 192.168.1.0 0.0.0.255 area 1
  • R1(config-router)# network 192.168.2.0 0.0.0.255 area 1
  • R1(config-router)# network 192.168.3.0 0.0.0.255 area 1
  • R1(config-router)# end
  • R1#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R2
  • R2(config)# interface g0/0
  • R2(config-if)# description Connected to R1 area 1
  • R2(config-if)# ip address 192.168.2.2 255.255.255.0
  • R2(config-if)# no shutdown
  • R2(config-if)# exit
  • R2(config)# interface lo1
  • R2(config-if)# description Connected to a simulated LAN
  • R2(config-if)# ip address 192.168.4.1 255.255.255.0
  • R2(config-if)# exit
  • R2(config)# router ospf 1
  • R2(config-router)# router-id 2.2.2.2
  • R2(config-router)# network 192.168.2.0 0.0.0.255 area 1
  • R2(config-router)# network 192.168.4.0 0.0.0.255 area 1
  • R2(config-router)# end
  • R2#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname ABR2
  • ABR2(config)# interface s0/0/1
  • ABR2(config-if)# description Connected to ASBR
  • ABR2(config-if)# ip address 10.2.2.1 255.255.255.252
  • ABR2(config-if)# no shutdown
  • ABR2(config-if)# exit
  • ABR2(config)# interface g0/1
  • ABR2(config-if)# description Connected to R3
  • ABR2(config-if)# ip address 172.16.1.33 255.255.255.224
  • ABR2(config-if)# no shutdown
  • ABR2(config-if)# exit
  • ABR2(config)# router ospf 1
  • ABR2(config-router)# router-id 6.6.6.6
  • ABR2(config-router)# network 10.2.2.0 0.0.0.3 area 0
  • ABR2(config-router)# network 172.16.1.32 0.0.0.31 area 2
  • ABR2(config-router)# end
  • ABR2
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R3
  • R3(config)# interface g0/1
  • R3(config-if)# description Connected to ABR2
  • R3(config-if)# ip address 172.16.1.34 255.255.255.224
  • R3(config-if)# no shutdown
  • R3(config-if)# exit
  • R3(config)# interface g0/0
  • R3(config-if)# description Connected to R4
  • R3(config-if)# ip address 172.16.1.65 255.255.255.224
  • R3(config-if)# no shutdown
  • R3(config-if)# exit
  • R3(config)# router ospf 1
  • R3(config-router)# router-id 3.3.3.3
  • R3(config-router)# network 172.16.1.32 0.0.0.31 area 2
  • R3(config-router)# network 172.16.1.64 0.0.0.31 area 2
  • R3(config-router)# end
  • R3#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R4
  • R4(config)# interface g0/0
  • R4(config-if)# description Connected to R3
  • R4(config-if)# ip address 172.16.1.66 255.255.255.224
  • R4(config-if)# no shutdown
  • R4(config-if)# exit
  • R4(config)# interface lo2
  • R4(config-if)# description Connected to simulated LAN
  • R4(config-if)# ip address 172.16.1.97 255.255.255.224
  • R4(config-if)# no shutdown
  • R4(config-if)# exit
  • R4(config)# router ospf 1
  • R4(config-router)# router-id 4.4.4.4
  • R4(config-router)# network 172.16.1.64 0.0.0.31 area 2
  • R4(config-router)# network 172.16.1.96 0.0.0.31 area 2
  • R4(config-router)# end
  • R4#

Felsökning

Efter att konfigurationerna har genomförts, bör man utföra ping-tester mellan routersinterface och till loopback-adresserna för att verifiera anslutningar. Om ping-tester misslyckas, är det viktigt att noggrant granska routrarnas routing-tabeller för att säkerställa att de innehåller korrekta och fullständiga ruttinformationer. Ett misslyckande i ping-test kan ofta indikera att OSPF-databasen inte har konvergerat ordentligt. I sådana fall kan det vara effektivt att initiera om OSPF-processen med kommandot clear ip ospf process. Detta tvingar OSPF att omedelbart åter initiera, vilket kan hjälpa till att snabba på konvergensen och åtgärda eventuella synkroniseringsproblem mellan routrarna.

Ruttaggregering

Inom OSPF är det möjligt att sammanfatta flera nätverksadresser till en enda rutt inom specifika arean, såsom area 1 och 2. Denna teknik, känd som ruttaggregering, minskar storleken på routing-tabellen och optimerar därmed routing över hela nätverket. Genom att aggregera nätverksadresser kan OSPF effektivt minska antalet rutter som måste annonseras och bearbetas av routrarna.

Area 1

192.168.1.0 0000 0001
192.168.2.0 0000 0010
192.168.3.0 0000 0011
192.168.4.0 0000 0100
===================
192.168. 0000 0 - - -
192.168.0.0 /21 eller 255.255.248.0

Area 2

172.16.1.32 0010 0000
172.16.1.64 0100 0000
172.16.1.96 0110 0000
===============
172.16.1. 0 - - - - - - -
172.16.1.0 /25 eller 255.255.255.128

Nu tillämpar ovan på ABR routrarna:

  • ABR1> enable
  • ABR1# configure terminal
  • ABR1(config)# router ospf 1
  • ABR1(config-router)# area 1 range 192.168.0.0 255.255.248.0
  • ABR1(config-router)# end
  • ABR1# clear ip ospf process
  • ABR1#
  • ABR2> enable
  • ABR2# configure terminal
  • ABR2(config)# router ospf 1
  • ABR2(config-router)# area 2 range 172.16.1.0 255.255.255.128
  • ABR2(config-router)# end
  • ABR2# clear ip ospf process
  • ABR2#