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
|
![]() |
R1# show ip ospf neighbor
|
![]() |
Kommando | Illustration |
R1# show ip ospf border-routers
|
![]() |
R1# show ip route ospf R1# show ip ospf route
|
![]() |