Exempel 1

I detta exempel konfigureras ett nätverk multiarea OSPF. Tanken är att ta fram OSPF detaljer med hjälp av olika kommando:

  • show ip route ospf – visar OSPF routing-tabell
  • show ip ospf – visar alla OSPF-processer, RID, area, STF statistik och diverse LSA timer
  • show ip ospf database – visar antal routrar i nätverket och deras RID
  • show ip ospf interface <interface> – visar interfacets area, IP-adress, process ID, RID, nätverkstyp, kostnader, prioritet, DR/BDR roller samt dead timer intervaller och information om OSPF grannar
  • show ip protocol – visar det aktuella protokollet, process ID, RID, area, nätverkstyp och OSPF grannskap
  • show ip ospf neighbor – visar en sammanfattning på alla medlemmar i OSPF grannskapet
  • show ip ospf border-routers – visar ABR och ASBR routers interna routing-tabeller
  • debugging ospf – felsökning för packet, hello och adjcencies

Nätverkstopologi – OSPF multiarea

Konfigurationer

  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R1
  • R1(config)# interface g0/1
  • R1(config-if)# ip address 192.168.1.1 255.255.255.0
  • R1(config-if)# no shut
  • R1(config-if)# interface s0/0/0
  • R1(config-if)# ip address 10.10.10.1 255.255.255.252
  • R1(config-if)# clock rate 64000
  • R1(config-if)# bandwidth 1024
  • R1(config-if)# no shut
  • R1(config-if)# interface s0/1/0
  • R1(config-if)# ip address 10.10.10.5 255.255.255.252
  • R1(config-if)# clock rate 64000
  • R1(config-if)# bandwidth 1024
  • R1(config-if)# no shut
  • R1(config-if)# interface s0/0/1
  • R1(config-if)# ip address 10.10.10.9 255.255.255.252
  • R1(config-if)# clock rate 64000
  • R1(config-if)# bandwidth 128
  • R1(config-if)# no shut
  • R1(config-if)# end
  • R1#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R2
  • R2(config)# interface s0/0/0
  • R2(config-if)# ip address 10.10.10.2 255.255.255.252
  • R2(config-if)# bandwidth 1024
  • R2(config-if)# no shut
  • R2(config-if)# interface s0/0/1
  • R2(config-if)# ip address 10.10.10.13 255.255.255.252
  • R2(config-if)# clock rate 64000
  • R2(config-if)# bandwidth 512
  • R2(config-if)# no shut
  • R2(config-if)# end
  • R2#
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R3
  • R3(config-if)# interface G0/1
  • R3(config-if)# ip address 192.168.2.1 255.255.255.0
  • R3(config-if)# no shut
  • R3(config-if)# interface s0/0/1
  • R3(config-if)# ip address 10.10.10.14 255.255.255.252
  • R3(config-if)# bandwidth 512
  • R3(config-if)# no shut
  • R3(config-if)# interface s0/1/0
  • R3(config-if)# ip address 10.10.10.18 255.255.255.252
  • R3(config-if)# bandwidth 1024
  • R3(config-if)# no shut
  • R3(config-if)# interface s0/0/0
  • R3(config-if)# ip address 10.10.10.22 255.255.255.252
  • R3(config-if)# bandwidth 768
  • R3(config-if)# no shut
  • R3(config-if)# end
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R4
  • R4(config)# interface s0/0/0
  • R4(config-if)# ip address 10.10.10.21 255.255.255.252
  • R4(config-if)# clock rate 64000
  • R4(config-if)# bandwidth 768
  • R4(config-if)# no shut
  • R4(config-if)# interface s0/0/1
  • R4(config-if)# ip address 10.10.10.10 255.255.255.252
  • R4(config-if)# bandwidth 128
  • R4(config-if)# no shut
  • R4(config-if)# end
  • Router> enable
  • Router# configure terminal
  • Router(config)# hostname R5
  • R5(config)#interface s0/0/0
  • R5(config-if)# ip address 10.10.10.6 255.255.255.252
  • R5(config-if)# bandwidth 1024
  • R5(config-if)# no shut
  • R5(config-if)# interface s0/0/1
  • R5(config-if)# ip address 10.10.10.17 255.255.255.252
  • R5(config-if)# clock rate 64000
  • R5(config-if)# bandwidth 1024
  • R5(config-if)# no shut
  • R5(config-if)# end
  • R5#
  • OSPF R1
  • R1#reload
  • R1>enable
  • R1# configure terminal
  • 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 0
  • R1(config-router)# network 10.10.10.0 0.0.0.3 area 0
  • R1(config-router)# network 10.10.10.4 0.0.0.3 area 0
  • R1(config-router)# network 10.10.10.8 0.0.0.3 area 0
  • R1(config-router)# end
  • OSPF R2
  • R2#reload
  • R2>enable
  • R2# configure terminal
  • R2(config)# router ospf 1
  • R2(config-router)# router-id 2.2.2.2
  • R2(config-router)# network 10.10.10.0 0.0.0.3 area 0
  • R2(config-router)# network 10.10.10.12 0.0.0.3 area 1
  • R2(config-router)# end
  • OSPF R3
  • R3#reload
  • R3>enable
  • R3# configure terminal
  • R3(config)# router ospf 1
  • R3(config-router)# router-id 3.3.3.3
  • R3(config-router)# network 192.168.2.0 0.0.0.255 area 1
  • R3(config-router)# network 10.10.10.12 0.0.0.3 area 1
  • R3(config-router)# network 10.10.10.16 0.0.0.3 area 1
  • R3(config-router)# network 10.10.10.20 0.0.0.3 area 1
  • R3(config-router)# end
  • OSPF R4
  • R4#reload
  • R4>enable
  • R4# configure terminal
  • R4(config)# router ospf 1
  • R4(config-router)# router-id 4.4.4.4
  • R4(config-router)# network 10.10.10.8 0.0.0.3 area 0
  • R4(config-router)# network 10.10.10.20 0.0.0.3 area 1
  • R4(config-router)# end
  • OSPF R5
  • R5#reload
  • R5>enable
  • R5# configure terminal
  • R5(config)# router ospf 1
  • R5(config-router)# router-id 5.5.5.5
  • R5(config-router)# network 10.10.10.4 0.0.0.3 area 0
  • R5(config-router)# network 10.10.10.16 0.0.0.3 area 1
  • R5(config-router)# end
Kommando Illustration

R1# show ip ospf

  1. OSPF routing-process identifikation
  2. Antal areor som körs på R1
  3. Area 0 betraktas som backbone

R1# show ip ospf neighbor

  1. neighbor ID - samma som router ID, kan bli den högsta IP bland loopback, eller manuellt konfigurerat. När router ID har valts blir det ingen ändring tills ospf process återställs med kommandot clear ip ospf process xx
  2. Priority - router med högsta prioritet blir utvald till DR. Noll kan aldrig bli DR eller BDR.
  3. State - Full betyder att grannskap mellan router är fullständigt etablerat.
  4. Dead time - indikerar tiden som återstår från den tiden som Hello-paketet togs emot.
Kommando Illustration

R1# show ip ospf border-routers

  1. i markerar vägen (the route) som har genererats och identifierats inne i samma area. Stor I är route som har identifierats från andra externa areor.
  2. Destinations RID
  3. Kostnaden att använda vägen
  4. Nästa hopp på väg till destination
  5. ABR destinationens router-typ, det kan bli antingen ABR eller ASBR. ABR är routern som har minst ett interface i Area 0. 
  6. Intern nummer för den kortaste vägens (SPF) kostnad.

R1# show ip route ospf

R1# show ip ospf route

  1. O står för OSPF och IA för Inter-Area vilket innebär att denna väg har identifierats som väg till destination i en annan area.
  2. Destination
  3. [110/292], 110 är den administrativa distans och 292 är metric som är kostnad för OSPF vägen.
  4. Nästa hopp mot destination