DynagenでCCIEを目指す
20100427 OSPF NBMA環境の設定
最終更新:
it_certification
-
view
目的
- NBMA環境でのOSPF設定方法を確認します。
構成
- 設定概要
- 各ルータはframe-relayによって接続されています。
- 構成図

- netファイル
ghostios = True sparsemem = True model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 256 [[ROUTER R1]] s0/0 = SW 1 [[ROUTER R2]] s0/0 = SW 2 [[ROUTER R3]] s0/0 = SW 3 [[FRSW SW]] 1:102 = 2:201 1:103 = 3:301
- 初期設定 R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 1.1.1.1 255.255.255.255 ! interface Serial0/0 ip address 192.168.0.1 255.255.255.0 encapsulation frame-relay serial restart-delay 0 frame-relay map ip 192.168.0.2 102 frame-relay map ip 192.168.0.3 103 ! interface Serial0/1 no ip address shutdown serial restart-delay 0 ! interface Serial0/2 no ip address shutdown serial restart-delay 0 ! interface Serial0/3 no ip address shutdown serial restart-delay 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Serial0/0 ip address 192.168.0.2 255.255.255.0 encapsulation frame-relay serial restart-delay 0 frame-relay map ip 192.168.0.1 201 ! interface Serial0/1 no ip address shutdown serial restart-delay 0 ! interface Serial0/2 no ip address shutdown serial restart-delay 0 ! interface Serial0/3 no ip address shutdown serial restart-delay 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- 初期設定 R3
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface Serial0/0 ip address 192.168.0.3 255.255.255.0 encapsulation frame-relay serial restart-delay 0 frame-relay map ip 192.168.0.1 301 ! interface Serial0/1 no ip address shutdown serial restart-delay 0 ! interface Serial0/2 no ip address shutdown serial restart-delay 0 ! interface Serial0/3 no ip address shutdown serial restart-delay 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 ユニキャストによるneighbor確立
- OSPFの設定
NBMA環境下では、マルチキャストを転送する事はできません。そこで、ユニキャストを使用してOSPF neighborを確立するよう設定します。
R1(config)#router ospf 1 R1(config-router)#network 192.168.0.0 0.0.0.255 area 0 R1(config-router)#redistribute connected subnets R1(config-router)#neighbor 192.168.0.2 R1(config-router)#neighbor 192.168.0.3 R2(config)#router ospf 1 R2(config-router)#network 192.168.0.0 0.0.0.255 area 0 R2(config-router)#redistribute connected subnets R2(config-router)#neighbor 192.168.0.1 R3(config)#router ospf 1 R3(config-router)#network 192.168.0.0 0.0.0.255 area 0 R3(config-router)#neighbor 192.168.0.1
- neighborの確認
R1でneighborが確立されたどうかを確認します。すると、まだneighborが確立されていない事が確認できます。neighborのState欄には「ATTEMP」と見慣れない記載がありますが、これは、Helloパケットを送信したものの未だ返答がない状態を表します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface N/A 0 ATTEMPT/DROTHER 00:01:14 192.168.0.2 Serial0/0 N/A 0 ATTEMPT/DROTHER 00:01:15 192.168.0.3 Serial0/0 R1#show 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 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 C 192.168.0.0/24 is directly connected, Serial0/0 R1#
- network typeの確認
R1のOSPF I/Fを確認します。すると、network typeがNON_BROADCASTであり、hello, deadが30秒, 120秒になっている事が読み取れます。I/FがEthernetであるかSerialであるかでデフォルトの設定が異なる事と、Serialの場合はneighborの確立に時間がかかる事が分かります。
R1#show ip ospf interface Serial0/0 is up, line protocol is up Internet Address 192.168.0.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64 <- network typeがNON_BROADCASTになっています。 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 3.3.3.3, Interface address 192.168.0.3 Backup Designated router (ID) 1.1.1.1, Interface address 192.168.0.1 Old designated Router (ID) 2.2.2.2, Interface address 192.168.0.2 Flush timer for old DR LSA due in 00:02:31 Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 <- timerは長めに設定されています。 oob-resync timeout 120 Hello due in 00:00:00 Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 2, Adjacent neighbor count is 2 Adjacent with neighbor 2.2.2.2 Adjacent with neighbor 3.3.3.3 (Designated Router) Suppress hello for 0 neighbor(s)
- neighborの再確認
設定を投入してから3分程度待つと、以下のようなメッセージがコンソール上に表示されます。
R1# *Mar 1 00:09:53.687: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial0/0 from LOADING to FULL, Loading Done *Mar 1 00:10:10.991: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Serial0/0 from LOADING to FULL, Loading Done R1#
neighborも確立されている事も確認できます。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DROTHER 00:01:38 192.168.0.2 Serial0/0 3.3.3.3 1 FULL/DR 00:01:37 192.168.0.3 Serial0/0 R1#show 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 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets O E2 2.2.2.2 [110/20] via 192.168.0.2, 00:00:37, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets O E2 3.3.3.3 [110/20] via 192.168.0.3, 00:00:37, Serial0/0 C 192.168.0.0/24 is directly connected, Serial0/0 R2#show 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 1.0.0.0/32 is subnetted, 1 subnets O E2 1.1.1.1 [110/20] via 192.168.0.1, 00:00:22, Serial0/0 2.0.0.0/32 is subnetted, 1 subnets C 2.2.2.2 is directly connected, Loopback0 3.0.0.0/32 is subnetted, 1 subnets O E2 3.3.3.3 [110/20] via 192.168.0.3, 00:00:22, Serial0/0 C 192.168.0.0/24 is directly connected, Serial0/0 R3#show 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 1.0.0.0/32 is subnetted, 1 subnets O E2 1.1.1.1 [110/20] via 192.168.0.1, 00:00:20, Serial0/0 2.0.0.0/32 is subnetted, 1 subnets O E2 2.2.2.2 [110/20] via 192.168.0.2, 00:00:20, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets C 3.3.3.3 is directly connected, Loopback0 C 192.168.0.0/24 is directly connected, Serial0/0
検証2 擬似ブロードキャスト環境
- 検証1 設定削除
ユニキャストにより、neighborを確立する設定を削除します。
R1(config)#router ospf 1 R1(config-router)#no neighbor 192.168.0.2 R1(config-router)#no neighbor 192.168.0.3 R2(config)#router ospf 1 R2(config-router)#no neighbor 192.168.0.1 R3(config)#router ospf 1 R3(config-router)#no neighbor 192.168.0.1
- 擬似ブロードキャスト環境の設定
frame-relay網内で、擬似的にブロードキャスト, マルチキャストが転送できるよう設定を変更します。
R1(config)#interface Serial 0/0 R1(config-if)#frame-relay map ip 192.168.0.2 102 broadcast R1(config-if)#frame-relay map ip 192.168.0.3 103 broadcast R2(config)#interface Serial 0/0 R2(config-if)#frame-relay map ip 192.168.0.1 201 broadcast R3(config)#interface Serial 0/0 R3(config-if)#frame-relay map ip 192.168.0.1 301 broadcast
- network typeの変更
Serial I/Fのデフォルトのnetwork typeはNON_BROADCASTです。マルチキャストによりneighborを確立できるよう、network typeをbroadcastに変更します。
R1(config)#interface Serial 0/0 R1(config-if)#ip ospf network broadcast R2(config)#interface Serial 0/0 R2(config-if)#ip ospf network broadcast R3(config)#interface Serial 0/0 R3(config-if)#ip ospf network broadcast
show ip ospf interfaceコマンドにより、network typeを確認する事ができます。
R1#show ip ospf interface Serial0/0 is up, line protocol is up Internet Address 192.168.0.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 64 <- network typeがBROADCASTに変わった事を確認できます。 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 1.1.1.1, Interface address 192.168.0.1 Backup Designated router (ID) 2.2.2.2, Interface address 192.168.0.2 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:00 Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 4 msec Neighbor Count is 2, Adjacent neighbor count is 1 Adjacent with neighbor 2.2.2.2 (Backup Designated Router) Suppress hello for 0 neighbor(s)
- neighborの確認
neighborが確立され、経路が交換されている事を確認します。
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DROTHER 00:00:35 192.168.0.2 Serial0/0 3.3.3.3 1 FULL/BDR 00:00:34 192.168.0.3 Serial0/0 R1# R1# R1# R1#show 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 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets O E2 2.2.2.2 [110/20] via 192.168.0.2, 00:00:02, Serial0/0 3.0.0.0/32 is subnetted, 1 subnets O E2 3.3.3.3 [110/20] via 192.168.0.3, 00:00:02, Serial0/0 C 192.168.0.0/24 is directly connected, Serial0/0 R1#
添付ファイル