DynagenでCCIEを目指す
20100511 デフォルトゲートウェイ OSPFの場合
最終更新:
it_certification
-
view
目的
- RIPのデフォルトルートの扱い方を確認します。
構成
- 設定概要
- EIGRPによってルーティングします。
- 構成図

- netファイル
model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 128 [[ROUTER R1]] f0/0 = R2 f1/0 [[ROUTER R2]] f0/0 = R3 f1/0 [[ROUTER R3]]
- 初期設定 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.0 ! interface FastEthernet0/0 ip address 192.168.10.1 255.255.255.0 duplex auto speed auto ! router rip version 2 network 192.168.10.0 no auto-summary ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login ! ! 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.0 ! interface FastEthernet0/0 ip address 192.168.20.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.10.2 255.255.255.0 duplex auto speed auto ! router rip version 2 network 192.168.10.0 network 192.168.20.0 no auto-summary ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login ! ! 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.0 ! interface FastEthernet1/0 ip address 192.168.20.3 255.255.255.0 duplex auto speed auto ! router rip version 2 network 192.168.20.0 no auto-summary ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login ! ! end
検証1 ip route
- 事前確認
R3からR2 Loopback 0(2.2.2.2)へpingが届かない事を確認します。R3のルーティングテーブルを見ると、2.2.2.2宛てのエントリはありません。
R3#ping 2.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) R3# R3# 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 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 O IA 192.168.10.0/24 [110/2] via 192.168.20.2, 00:00:41, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0 R3#
- デフォルトルートの通知
ip routeコマンドで、デフォルトルート通知を試みます。RIPやEIGRPと異なり、OSPFはこのコマンドだけではデフォルトルートが通知されません。
R2(config)#ip router 0.0.0.0 0.0.0.0 Null 0 R2(config)#router ospf 1 R2(config-router)#redistribute static subnets
OSPFの場合、デフォルトルートを通知するためには、default-information originateが必要になります。
R2(config)#router ospf 1 R2(config-router)#no redistribute static subnets R2(config-router)#default-information originate
- 疎通確認
R3からR2 Loopback 0(2.2.2.2)へpingが届くようになりました。また、R3のルーティングテーブル上にはデフォルトルートが見られます。
R3#ping 2.2.2.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/50/116 ms R3# R3# 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.20.2 to network 0.0.0.0 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 O IA 192.168.10.0/24 [110/2] via 192.168.20.2, 00:01:51, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0 O*E2 0.0.0.0/0 [110/1] via 192.168.20.2, 00:01:12, FastEthernet1/0 R3#
- 設定削除
検証1の設定を削除します。
R2(config)#no ip route 0.0.0.0 0.0.0.0 Nul 0 R2(config)#router ospf 1 R2(config-router)#no default-information originate
検証2 default-network
- default-networkの設定
ip default-networkコマンドで、デフォルトルート通知を試みます。EIGRPと同様に、OSPFもip default-networkコマンドではデフォルトルートを通知できないようです。
R2(config)#ip default-network 2.0.0.0 R2(config)#router ospf 1 R2(config-router)#default-information originate
検証3 STUBとの比較
- STUBの設定
area 1をSTUBとして設定します。
R2(config)#router ospf 1 R2(config-router)#area 1 stub R3(config)#router ospf 1 R3(config-router)#area 1 stub
- 考察
R3のルーティングテーブルを確認します。検証1のデフォルトルートはE2と表記されており、LSA type 5によって通知されます。一方、検証3の場合はIAと表記されておりLSA Type 3によって通知されています。
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.20.2 to network 0.0.0.0 3.0.0.0/24 is subnetted, 1 subnets C 3.3.3.0 is directly connected, Loopback0 O IA 192.168.10.0/24 [110/2] via 192.168.20.2, 00:03:36, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0 O*IA 0.0.0.0/0 [110/2] via 192.168.20.2, 00:03:36, FastEthernet1/0 R3#
添付ファイル