Tehát a feladatok:
- Routerek IP cím beállítása
- Area 0-ba hirdetés
- Loopbackek legyenek a RID-ek
- Loopbackek point-to-point network type-k legyenek
- Authentication: md5, pass: cisco
- Authentication: egész area-ra megadva md5
Ezek elég egyértelműek:
- Routerek IP cím beállítása
- Area 0-ba hirdetés
- Loopbackek legyenek a RID-ek
- Loopbackek point-to-point network type-k legyenek
R1> R1>en R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int s0/0 R1(config-if)#ip add 10.0.21.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#ip ospf 1 are *Mar 1 00:27:26.803: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R1(config-if)#ip ospf 1 area 0 *Mar 1 00:27:27.811: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-if)#ip ospf 1 area 0 R1(config-if)#int s0/1 R1(config-if)#ip add 10.0.13.1 255.255.255.0 R1(config-if)#no sh R1(config-if)#ip ospf 1 a 0 R1(config-if)# *Mar 1 00:27:45.519: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up R1(config-if)# *Mar 1 00:27:46.527: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up R1(config-if)#^Z R1# *Mar 1 00:27:51.467: %SYS-5-CONFIG_I: Configured from console by console R1# *Mar 1 00:27:57.055: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down R1# *Mar 1 00:28:07.083: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int lo1 R1(config-if)#ip add 17 *Mar 1 00:29:08.431: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up R1(config-if)#ip add 172.17.1.1 255.255.255.0 R1(config-if)#ip ospf net R1(config-if)#ip ospf network pont R1(config-if)#ip ospf network po R1(config-if)#ip ospf network point-to-p R1(config-if)#ip ospf network point-to-point R1(config-if)#^Z R1#
R2> R2>en R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int s0/0 R2(config-if)#ip add 10.0.21.2 255.255.255.0 R2(config-if)#no sh R2(config-if)#ip ospf 1 a 0 R2(config-if)# *Mar 1 00:31:47.247: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R2(config-if)# *Mar 1 00:31:48.255: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up *Mar 1 00:31:48.747: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.21.1 on Serial0/0 from LOADING to FULL, Loading Done R2(config-if)#int lo1 R2(config-if)#ip add 1 *Mar 1 00:31:55.331: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up R2(config-if)#ip add 172.18.1.1 255.255.255.0 R2(config-if)#ip ospf net R2(config-if)#ip ospf network poi R2(config-if)#ip ospf network point-to-p R2(config-if)#^Z R2# *Mar 1 00:32:10.855: %SYS-5-CONFIG_I: Configured from console by console R2#
R3>en R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#int s0/0 R3(config-if)#ip add 10.0.13.3 255.255.255.0 R3(config-if)#ip ospf 1 a 0 R3(config-if)#no sh R3(config-if)# *Mar 1 00:32:58.347: %OSPF-4-NORTRID: OSPF process 1 failed to allocate unique router-id and cannot start R3(config-if)#int s0/1 *Mar 1 00:33:02.027: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R3(config-if)#int s0/1 *Mar 1 00:33:03.031: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R3(config-if)#int s0/1 R3(config-if)#ip add 10.0.34.3 25 *Mar 1 00:33:16.987: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.21.1 on Serial0/0 from LOADING to FULL, Loading Done R3(config-if)#ip add 10.0.34.3 255.255.255.0 R3(config-if)#ip ospf 1 a 0 R3(config-if)#no sh R3(config-if)#int lo1 R3(config-if)#ip *Mar 1 00:33:39.587: %LINK-3-UPDOWN: Interface Serial0/1, changed state to up *Mar 1 00:33:40.751: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to up R3(config-if)#ip add 17 *Mar 1 00:33:41.575: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up R3(config-if)#ip add 172.19.1.1 255.255.255.0 R3(config-if)#ip ospf net R3(config-if)#ip ospf network po R3(config-if)#ip ospf network point-to-p R3(config-if)#^Z R3# *Mar 1 00:33:55.383: %SYS-5-CONFIG_I: Configured from console by console
R4> R4> R4>en R4#conf t Enter configuration commands, one per line. End with CNTL/Z. R4(config)#int s0/0 R4(config-if)#ip add 10.0.34.4 255.255.255.0 R4(config-if)#no sh R4(config-if)#ip ospf 1 a *Mar 1 00:34:59.791: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R4(config-if)#ip ospf 1 a 0 R4(config-if)# *Mar 1 00:35:00.799: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R4(config-if)#int lo1 R4(config-if)#ip ad *Mar 1 00:35:09.527: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up *Mar 1 00:35:10.387: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.13.3 on Serial0/0 from LOADING to FULL, Loading Done R4(config-if)#ip add 172.16.1.1 255.255.255.0 R4(config-if)#ip ospf net po R4(config-if)#ip ospf net point-to-p R4(config-if)#^Z R4# *Mar 1 00:35:36.543: %SYS-5-CONFIG_I: Configured from console by console
Most hirdessük be a Loopback-eket OSPF-be (ezt lehetett volna előbb is természetesen):
R1# R1# R1# R1# R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int lo1 R1(config-if)#ip ospf 1 a 0 R1(config-if)#^Z R1# R2# R2# R2# R2# R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int lo1 R2(config-if)#ip ospf 1 a 0 R2(config-if)#^Z R2# R3# R3# R3# R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#int lo1 R3(config-if)#ip ospf 1 a 0 R3(config-if)#^Z R3# R4# R4# R4#conf t Enter configuration commands, one per line. End with CNTL/Z. R4(config)#int lo1 R4(config-if)#ip ospf 1 a 0 R4(config-if)#^Z R4#
(Még egy megjegyzés: természetesen a router ospf 1 alatt a network paranccsal is meg lehetett volna csinálni a behirdetést.)
Nézzük meg a routing táblát, látszik -e minden route az OSPF-ben:
R1#sh ip route ospf 172.16.0.0/24 is subnetted, 1 subnets O 172.16.1.0 [110/129] via 10.0.13.3, 00:02:37, Serial0/1 172.19.0.0/24 is subnetted, 1 subnets O 172.19.1.0 [110/65] via 10.0.13.3, 00:02:47, Serial0/1 172.18.0.0/24 is subnetted, 1 subnets O 172.18.1.0 [110/65] via 10.0.21.2, 00:02:57, Serial0/0 10.0.0.0/24 is subnetted, 3 subnets O 10.0.34.0 [110/128] via 10.0.13.3, 00:04:35, Serial0/1 R1# R2#sh ip route ospf 172.17.0.0/24 is subnetted, 1 subnets O 172.17.1.0 [110/65] via 10.0.21.1, 00:03:00, Serial0/0 172.16.0.0/24 is subnetted, 1 subnets O 172.16.1.0 [110/193] via 10.0.21.1, 00:02:30, Serial0/0 172.19.0.0/24 is subnetted, 1 subnets O 172.19.1.0 [110/129] via 10.0.21.1, 00:02:40, Serial0/0 10.0.0.0/24 is subnetted, 3 subnets O 10.0.13.0 [110/128] via 10.0.21.1, 00:06:20, Serial0/0 O 10.0.34.0 [110/192] via 10.0.21.1, 00:04:28, Serial0/0
Minden route látszik. Leellenőriztem a neighborship-eket is, azok is rendben vannak.
R1#sh ip ospf ne Neighbor ID Pri State Dead Time Address Interface 10.0.13.3 0 FULL/ - 00:00:35 10.0.13.3 Serial0/1 10.0.21.2 0 FULL/ - 00:00:38 10.0.21.2 Serial0/0 R1# R2#sh ip ospf ne Neighbor ID Pri State Dead Time Address Interface 10.0.21.1 0 FULL/ - 00:00:33 10.0.21.1 Serial0/0 R2# R3#sh ip ospf ne Neighbor ID Pri State Dead Time Address Interface 10.0.34.4 0 FULL/ - 00:00:32 10.0.34.4 Serial0/1 10.0.21.1 0 FULL/ - 00:00:34 10.0.13.1 Serial0/0 R3# R4#sh ip ospf ne Neighbor ID Pri State Dead Time Address Interface 10.0.13.3 0 FULL/ - 00:00:38 10.0.34.3 Serial0/0 R4#
Mindenhol FULL/ – az állapot, ez rendben van, mivel point-to-point interface-eket használunk, és nincs DR/BDR ilyen esetben.
- Loopbackek legyenek a RID-ek
Látható, hogy most a serial interface-k a router ID-k. Ez azért van, mert azokat konfiguráltam előbb, és már akkor rátettem az OSPF area 0-t, mikor a Loopbackeket nem húztam fel.
Állítsuk be a Loopback-eket kézzel RID-nek:
R1(config)#router ospf 1 R1(config-router)#roiu R1(config-router)#ro R1(config-router)#router-id ? A.B.C.D OSPF router-id in IP address format R1(config-router)#router-id 172.17.1.1 Reload or use "clear ip ospf process" command, for this to take effect R1#clear ip ospf process Reset ALL OSPF processes? [no]: yes R1# *Mar 1 00:45:19.127: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.13.3 on Serial0/1 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 00:45:19.135: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.21.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached *Mar 1 00:45:19.959: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.13.3 on Serial0/1 from LOADING to FULL, Loading Done *Mar 1 00:45:19.983: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.21.2 on Serial0/0 from LOADING to FULL, Loading Done
R2-n már az új RID-del kell látnunk R1-et:
R2#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 172.17.1.1 0 FULL/ - 00:00:34 10.0.21.1 Serial0/0
R2-R4-en is beállítom, ezeknek a konfigját most nem másolom ide.
- Authentication: md5, pass: cisco
- Authentication: egész area-ra megadva md5
Authentication-nél két lehetőség van:
- interface alatt állítok be mindent, mint az EIGRP-nél
- router ospf alatt állítom be az area hitelesítést. Ez jó, ha sok interface lóg egy area-ba. Ilyenkor már csak az md5 értéket kell interface alatt beírni. Ha eltérő hitelesítést használunk (pl. type 1-et [plain text] és a router ospf alatt más (mondjuk type 2 [message-digest] van, az interface alatt beírt érvényesül).
R2-n mutatom a konfigot.
R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router ospf 1 R2(config-router)#area 0 authen R2(config-router)#area 0 authentication m R2(config-router)#area 0 authentication message-digest R2(config-router)#int s0/0 R2(config-if)#ip ospf mes R2(config-if)#ip ospf message-digest-key 1 md5 cisco R2(config-if)#^Z
Ugye, hogy nem is volt nehéz :-)?
A megoldott feladatot letölthetitek innen: