DynagenでCCIEを目指す
20100512 ODR(On-Demand Routing)
最終更新:
it_certification
-
view
目的
- ODRの設定を確認します。
構成
- 設定概要
- 各ルータは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 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 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 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 事前準備
- CDPの有効化
ODRを使用するためには、CDPを有効にする必要があります。
まず、CDPが有効になっているI/Fを確認します。CDPはデフォルトで有効ですが、point-to-multipointであるI/Fは例外的に無効になっています。Serial0/0がCDPが有効になっているI/F一覧に載っていない事を確認します。
まず、CDPが有効になっているI/Fを確認します。CDPはデフォルトで有効ですが、point-to-multipointであるI/Fは例外的に無効になっています。Serial0/0がCDPが有効になっているI/F一覧に載っていない事を確認します。
R1#show cdp interface Serial0/1 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0/2 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0/3 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds R1#
以下コマンドでSerial0/0のCDPを有効にします。
R1(config)#interface Serial 0/0 R1(config-if)#cdp enable R1(config-if)# R1(config-if)# R1(config-if)#do show cdp interface Serial0/0 is up, line protocol is up <- CDPが有効になった事を確認します。 Encapsulation FRAME-RELAY Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0/1 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0/2 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds Serial0/3 is administratively down, line protocol is down Encapsulation HDLC Sending CDP packets every 60 seconds Holdtime is 180 seconds R1(config-if)#
同様にR2, R3にもCDP有効の設定を行います。
R2(config)#interface Serial 0/0 R2(config-if)#cdp enable R3(config)#interface Serial 0/0 R3(config-if)#cdp enable
- 擬似ブロードキャスト環境の設定
CDPアップデートはマルチキャストを使用します。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
検証2 ODRの設定
- ODRの設定
ODRを有効にします。ODRは必ず、ハブルータでのみ有効にして下さい。
R1(config)#router odr
- ルーティングテーブルの確認
R2, R3のルーティングテーブルにODRによるデフォルトルートが載った事が確認できます。
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 192.168.0.1 to network 0.0.0.0 C 192.168.0.0/24 is directly connected, Serial0/0 o* 0.0.0.0/0 [160/1] via 192.168.0.1, 00:00:47, Serial0/0 <- ODRによるルート R2# 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 192.168.0.1 to network 0.0.0.0 C 192.168.0.0/24 is directly connected, Serial0/0 o* 0.0.0.0/0 [160/1] via 192.168.0.1, 00:00:02, 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 192.168.0.1 to network 0.0.0.0 C 192.168.0.0/24 is directly connected, Serial0/0 o* 0.0.0.0/0 [160/1] via 192.168.0.1, 00:00:03, Serial0/0 <- ODRによるルート R3#
- パケットキャプチャによる確認
この時、キャプチャされたパケットは以下の通りです。CDPの中にデフォルトルートが混ざっている事が読み取れます。

検証3 非ブロードキャスト環境
- 非ブロードキャスト環境の設定
マルチキャストを転送できないように設定します。
R1(config)#interface Serial 0/0 R1(config-if)#frame-relay map ip 192.168.0.2 102 R1(config-if)#frame-relay map ip 192.168.0.3 103 R2(config)#interface Serial 0/0 R2(config-if)#frame-relay map ip 192.168.0.1 201 R3(config)#interface Serial 0/0 R3(config-if)#frame-relay map ip 192.168.0.1 301
- ルーティングテーブルの確認
マルチキャストが転送できない環境ではODRが使えない事を確認します。
が、しかし、なぜかODRによる経路が通知されています。なぞです…。何か分かったら加筆します。
が、しかし、なぜかODRによる経路が通知されています。なぞです…。何か分かったら加筆します。
R2#clear ip route * R2# R2# 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 192.168.0.1 to network 0.0.0.0 C 192.168.0.0/24 is directly connected, Serial0/0 o* 0.0.0.0/0 [160/1] via 192.168.0.1, 00:00:47, Serial0/0 <- ODRによるルート R2#
broadcastオプションを付けるべきという主張は私だけではありません。以下URLでも、broadcastオプションを付けるべきと主張しております。
http://www.infraexpert.com/study/rp8odr.htm
検証4 スポーク側でもODRを有効にした場合
- ODRの設定
スポーク側でもODRを有効にします。
R2(config)#router odr
- ルーティングテーブルの確認
スポーク側でもODRを有効にすると、デフォルトゲートウェイがうまく通知できないようです。ルーティングテーブルにはデフォルトゲートウェイが載っていません。
R2#clear ip route * R2# R2# 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 C 192.168.0.0/24 is directly connected, Serial0/0 R2#
添付ファイル