OSPF Lab 2 – A megoldás

A feladatok tehát.

  • Routerek bekonfigurálása
  • OSPF
  • Loopback a RID (R1-nél 1.1)
  • R1: summarization a Loopbackekre
  • R2 ne hirdesse be a 10.0.13.0/24-t Area 1-be
  • R4 EIGRP-ből redisztributálja a route-t
  • Default route a 172.18.1.1 legyen

Az alábbiak konfigurációját nem mutatom meg, mert már volt róla szó, de ide másolom, hogy beilleszthessétek a GNS3-ba:

  • Routerek bekonfigurálása
  • OSPF (Area 0)
  • Loopback a RID (R1-nél 1.1)
  • R1: summarization a Loopbackekre
  • EIGRP felkonfigurálása

 

A szemfülesek kiszúrhatták a rejtett hibát: R1-en volt feladat summarization-t csinálni. Ellentétben az EIGRP-vel, ahol bárhol lehet, OSPF-nél csak ABR-en és ASBR-en lehet! Tehát ezt nem lehet megoldani.

 

R1

 

!
 hostname R1
 !
 boot-start-marker
 boot-end-marker
 !
 !
 no aaa new-model
 memory-size iomem 5
 ip cef
 !
 !
 !
 !
 interface Loopback1
 ip address 192.168.10.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 !
 interface Loopback2
 ip address 192.168.1.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 !
 interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/0
 ip address 10.0.12.1 255.255.255.0
 ip ospf 1 area 0
 clock rate 2000000
 !
 interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/1
 ip address 10.0.13.1 255.255.255.0
 ip ospf 1 area 0
 clock rate 2000000
 !
 router ospf 1
 router-id 192.168.1.1
 log-adjacency-changes

 

R2

 

!
 hostname R2
 !
 boot-start-marker
 boot-end-marker
 !
 !
 no aaa new-model
 memory-size iomem 5
 ip cef
 !
 interface Loopback1
 ip address 192.168.2.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 !
 interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/0
 ip address 10.0.12.2 255.255.255.0
 ip ospf 1 area 0
 clock rate 2000000
 !
 interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
 !
 router ospf 1
 router-id 192.168.2.1
 log-adjacency-changes

 

R3

 

!
 hostname R3
 !
 interface Loopback1
 ip address 192.168.3.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 !
 interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/0
 ip address 10.0.13.3 255.255.255.0
 ip ospf 1 area 0
 clock rate 2000000
 !
 interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
 !
 router ospf 1
 router-id 192.168.3.1
 log-adjacency-changes

 

R4

 

!
 hostname R4
!
 interface Loopback1
 ip address 192.168.4.1 255.255.255.0
 ip ospf network point-to-point
 !
 interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/0
 no ip address
 shutdown
 clock rate 2000000
 !
 interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/1
 ip address 172.18.1.1 255.255.255.0
 clock rate 2000000
 !
 router eigrp 1
 network 172.18.1.0 0.0.0.255
 auto-summary
 eigrp router-id 192.168.4.1
 !
 router ospf 1
 router-id 192.168.4.1
 log-adjacency-changes

 

R6

 

 hostname R6
 !
 interface FastEthernet0/0
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/0
 bandwidth 64
 ip address 172.18.1.6 255.255.255.0
 clock rate 2000000
 !
 interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
 !
 interface Serial0/1
 no ip address
 shutdown
 clock rate 2000000
 !
 router eigrp 1
 network 172.18.1.0 0.0.0.255
 no auto-summary

 

Összeállt az OSPF Area 0 és az EIGRP, jöhet a többi feladat.

 

Először is húzzuk fel Area 1-t és 2-t.

 

Area 1 NSSA lesz, amely azt jelenti, hogy ismeri az IA route-kat és lehet redisztributálni bele, ezt meg is fogjuk tenni. A szükséges parancsok: R2-n az area 1 nssa, R4-en szintén area 1 nssa. R2 itt ABR lesz, mivel van interface-e Area 0-ban és Area 1-ben is.

 

R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router ospf 1
R4(config-router)#area 1 nssa
R4(config-router)#rou
R4(config-router)#router-id 192.168.4.1
R4(config-router)#int s0/0
R4(config-if)#ip add 10.0.24.4 255.255.255.0
R4(config-if)#ip ospf 1 a 1
R4(config-if)#no sh
R4(config-if)#^Z

R2(config)#router ospf 1
R2(config-router)#area 1 nssa
R2(config-router)#int s0/1
R2(config-if)#ip add 10.0.24.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ip ospf 1 a 1
R2(config-if)#ip ospf 1 a 1
R2(config-if)#
R2(config-if)#^Z

R4#sh ip ospf 1 | i area
 Supports area transit capability
 Number of areas in this router is 1. 0 normal 0 stub 1 nssa
 Number of areas transit capable is 0
 Number of interfaces in this area is 1
 It is a NSSA area

 

Látjuk Area 0 route-jait:

 

R4#sh ip route ospf
O IA 192.168.10.0/24 [110/129] via 10.0.24.2, 00:02:44, Serial0/0
 10.0.0.0/24 is subnetted, 3 subnets
O IA 10.0.12.0 [110/128] via 10.0.24.2, 00:02:44, Serial0/0
O IA 10.0.13.0 [110/192] via 10.0.24.2, 00:02:44, Serial0/0
O IA 192.168.1.0/24 [110/129] via 10.0.24.2, 00:02:44, Serial0/0
O IA 192.168.2.0/24 [110/65] via 10.0.24.2, 00:02:44, Serial0/0
O IA 192.168.3.0/24 [110/193] via 10.0.24.2, 00:02:44, Serial0/0

 

Area 2 totally stub area lesz, amely szerint csak egy default route-t fogunk látni, valamint intra-area route-kat (de azok jelen esetben nem lesznek).

 

R5>en
R5#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#router ospf 1
R5(config-router)#
R5(config-router)#area 2 stub no
R5(config-router)#int s0/0
R5(config-if)#ip add 10.0.35.5 255.255.255.0
R5(config-if)#no sh
R5(config-if)#int lo1
R5(config-if)#ip a
R5(config-if)#ip add
R5(config-if)#ip add 192.168.5.1 255.255.255.0
R5(config-if)#ip ospf 1 a 2
R5(config-if)#int s0/0
R5(config-if)#ip ospf 1 a 2
R5(config-if)#^Z
R5#

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router ospf 1
R3(config-router)#area 2 stub no-
R3(config-router)#area 2 stub no-summary
R3(config-router)#int s0/1
R3(config-if)#ip add 10.0.35.3 255.255.255.0
R3(config-if)#ip ospf 1 a 2
R3(config-if)#^Z
R3#
R3#^Z
R3(config)#int s0/1
R3(config-if)#no sh
R3(config-if)#^Z

 

Nézzük R5 route tábláját:

 

R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 E1 - OSPF external type 1, E2 - OSPF external type 2
 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 ia - IS-IS inter area, * - candidate default, U - per-user static route
 o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.5.0/24 is directly connected, Loopback1
 10.0.0.0/24 is subnetted, 1 subnets
C 10.0.35.0 is directly connected, Serial0/0

 

Hohó, nincs OSPF route! Miért? Talán nem állt össze a neighborship?

 

R5#sh ip ospf ne
Neighbor ID Pri State Dead Time Address Interface
192.168.3.1 0 FULL/ - 00:00:38 10.0.35.3 Serial0/0

 

De! Hát akkor?

Ez így . Mivel totally stub area, nem láthat IA route-kat. Mivel R4 nem hirdet default route-t felé, nem tudhat a külvilágról.

  • R2 ne hirdesse be a 10.0.13.0/24-t Area 1-be
Itt route filteringet kell használnunk. A konfig hasonló az EIGRP-hez, annyi a különbség, hogy itt area X filter … in/out kell, és csak ip prefix-listával lehet megcsinálni.
R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip prefix-list lab2 seq 5 deny 10.0.13.0/24
R2(config)#ip prefix-list lab2 seq 10 permit 0.0.0.0/0 le 32
R2(config-route-map)#^Z
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router ospf 1
R2(config-router)#area 0 filter-list prefix lab2 out
R2(config-router)#^Z
R2(config)#int s0/1
R2(config-if)#sh
R2(config-if)#
*Mar 1 00:48:25.887: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.4.1 on Serial0/1 from FULL to DOWN, Neighbor Down: Interface down or detached
R2(config-if)#
*Mar 1 00:48:27.875: %LINK-5-CHANGED: Interface Serial0/1, changed state to administratively down
*Mar 1 00:48:28.875: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1, changed state to down
R2(config-if)#no sh
R2(config-if)#^Z
R2#
R4-en előtte-utána (látható, hogy a többi IA route látszik):
R4#
R4#sh ip route 10.0.13.0
Routing entry for 10.0.13.0/24
 Known via "ospf 1", distance 110, metric 192, type inter area
 Last update from 10.0.24.2 on Serial0/0, 00:11:18 ago
 Routing Descriptor Blocks:
 * 10.0.24.2, from 192.168.2.1, 00:11:18 ago, via Serial0/0
 Route metric is 192, traffic share count is 1
R4#sh ip route 10.0.13.0
Routing entry for 10.0.13.0/24
 Known via "ospf 1", distance 110, metric 192, type inter area
 Last update from 10.0.24.2 on Serial0/0, 00:13:47 ago
 Routing Descriptor Blocks:
 * 10.0.24.2, from 192.168.2.1, 00:13:47 ago, via Serial0/0
 Route metric is 192, traffic share count is 1
R4#
*Mar 1 00:48:46.251: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.2.1 on Serial0/0 from LOADING to FULL, Loading Done
R4#sh ip route 10.0.13.0
% Subnet not in table
R4#sh ip route ospf
O IA 192.168.10.0/24 [110/129] via 10.0.24.2, 00:02:13, Serial0/0
 192.168.5.0/32 is subnetted, 1 subnets
O IA 192.168.5.1 [110/257] via 10.0.24.2, 00:02:13, Serial0/0
 10.0.0.0/24 is subnetted, 4 subnets
O IA 10.0.12.0 [110/128] via 10.0.24.2, 00:02:13, Serial0/0
O IA 10.0.35.0 [110/256] via 10.0.24.2, 00:02:13, Serial0/0
O IA 192.168.1.0/24 [110/129] via 10.0.24.2, 00:02:13, Serial0/0
O IA 192.168.2.0/24 [110/65] via 10.0.24.2, 00:02:13, Serial0/0
O IA 192.168.3.0/24 [110/193] via 10.0.24.2, 00:02:13, Serial0/0
  • R4 EIGRP-ből redisztributálja a route-t. Ez most basic redistribution lesz, mert az a téma később lesz aktuális.
A konfiguráció az alábbi:
R4#
R4#
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router ospf 1
R4(config-router)#redistribute eigrp 1 subnets
R4(config-router)#^Z
R4#
R2 routing táblája előtte és utána:
R2#sh ip route ospf
O 192.168.10.0/24 [110/65] via 10.0.12.1, 00:04:15, Serial0/0
 192.168.5.0/32 is subnetted, 1 subnets
O IA 192.168.5.1 [110/193] via 10.0.12.1, 00:04:15, Serial0/0
 10.0.0.0/24 is subnetted, 4 subnets
O 10.0.13.0 [110/128] via 10.0.12.1, 00:04:15, Serial0/0
O IA 10.0.35.0 [110/192] via 10.0.12.1, 00:04:15, Serial0/0
O 192.168.1.0/24 [110/65] via 10.0.12.1, 00:04:15, Serial0/0
O 192.168.3.0/24 [110/129] via 10.0.12.1, 00:04:15, Serial0/0
R2#sh ip route ospf
O 192.168.10.0/24 [110/65] via 10.0.12.1, 00:05:32, Serial0/0
 172.18.0.0/24 is subnetted, 1 subnets
O N2 172.18.1.0 [110/20] via 10.0.24.4, 00:00:06, Serial0/1
 192.168.5.0/32 is subnetted, 1 subnets
O IA 192.168.5.1 [110/193] via 10.0.12.1, 00:05:32, Serial0/0
 10.0.0.0/24 is subnetted, 4 subnets
O 10.0.13.0 [110/128] via 10.0.12.1, 00:05:32, Serial0/0
O IA 10.0.35.0 [110/192] via 10.0.12.1, 00:05:32, Serial0/0
O 192.168.1.0/24 [110/65] via 10.0.12.1, 00:05:32, Serial0/0
O 192.168.3.0/24 [110/129] via 10.0.12.1, 00:05:32, Serial0/0
  • Default route a 172.18.1.1 legyen

Ehhez R2-en kell felvennünk a parancsot, mivel Area 0-ból tudjuk hirdetni a route-t, hiába hogy R4-en redisztributáljuk bele OSPF-be.  Ez így nem igaz, csak CCNP ROUTE-nál “out of scope”, lásd default-information originate NSSA Area-ba post. Az alábbi megoldás működik, de az eredeti feladatkiírást nézve nem jó megoldás.

R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 0.0.0.0 0.0.0.0 172.18.1.1
R2(config)#router ospf 1
R2(config-router)#default-information originate

R5 totally stub area-ban van, nézzük, most a route tábláját:

R5#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
 D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
 E1 - OSPF external type 1, E2 - OSPF external type 2
 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
 ia - IS-IS inter area, * - candidate default, U - per-user static route
 o - ODR, P - periodic downloaded static route
Gateway of last resort is 10.0.35.3 to network 0.0.0.0
C 192.168.5.0/24 is directly connected, Loopback1
 10.0.0.0/24 is subnetted, 1 subnets
C 10.0.35.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 10.0.35.3, 00:30:22, Serial0/0

Nézzünk egy traceroute-t:

R5#traceroute 172.18.1.6
Type escape sequence to abort.
Tracing the route to 172.18.1.6
1 10.0.35.3 296 msec 164 msec 140 msec
 2 10.0.13.1 352 msec 308 msec 264 msec
 3 10.0.12.2 568 msec 400 msec 572 msec
 4 10.0.24.4 600 msec 1740 msec 712 msec
 5 * * *
 6 * *

 

Ajajj, itt valami gigszer van. R4-en érdemes szétnézni.

R6-ig eljut a ping, de R6-nak nincs route-ja a 10.0.35-re, ezért nem megy vissza a csomag:

 

 
R6#sh ip route 10.0.35.5
% Network not in table

 

Vagy belehirdetjük az OSPF-et EIGRP-be, vagy kell egy default route R4 felé.

Tegyük fel, hogy legyen egy 10.0.0.0/18 (255.255.192.0) route R4 felé R6-on:

 

R6#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R6(config)#ip route 10.0.0.0 255.255.192.0 172.18.1.1

 

Nézzük az eredményt:

 

R5#ping 172.18.1.6

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.18.1.6, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 644/734/856 ms
R5#traceroute 172.18.1.6
Type escape sequence to abort.
Tracing the route to 172.18.1.6
1 10.0.35.3 156 msec 236 msec 44 msec
 2 10.0.13.1 280 msec 216 msec 308 msec
 3 10.0.12.2 1796 msec 580 msec 428 msec
 4 10.0.24.4 572 msec 548 msec 644 msec
 5 172.18.1.6 1092 msec 1440 msec 644 msec

 

Működik!

Készen vagyunk!

A megoldott feladat letölthető innen:

OSPF LAB 2 – GNS3 – solved

(A megoldás a post írásával együtt 86 perc volt.)