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

- 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
- 事前確認
R1からR3 Loopback 0(3.3.3.3)へpingが届かない事を確認します。R1のルーティングテーブルを見ると、3.3.3.3宛てのエントリはありません。
R1#ping 3.3.3.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds: ..... Success rate is 0 percent (0/5) 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/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 C 192.168.10.0/24 is directly connected, FastEthernet0/0 R 192.168.20.0/24 [120/1] via 192.168.10.2, 00:00:08, FastEthernet0/0 R1#
- デフォルトルートの通知
R3へのデフォルトルートを他のルータへ通知します。
トップページ/動作検証 ネットワーク系/20100509 デフォルトゲートウェイ EIGRPの場合と若干設定方法が異なりますが、next-hopをNull0にする設定方法もあります。
トップページ/動作検証 ネットワーク系/20100509 デフォルトゲートウェイ EIGRPの場合と若干設定方法が異なりますが、next-hopをNull0にする設定方法もあります。
R3(config)#ip route 0.0.0.0 0.0.0.0 Null 0 R3(config)#router rip R3(config-router)#redistribute static
この設定によって送信されたパケットは以下です。デフォルトルートが他のルータに通知されます。

- 疎通確認
R1からR3 Loopback 0にpingが届くようになりました。また、R1のルーティングテーブル上にはデフォルトルートが載っています。
R1#ping 3.3.3.3 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 16/58/180 ms 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 192.168.10.2 to network 0.0.0.0 <- デフォルトルート 1.0.0.0/24 is subnetted, 1 subnets C 1.1.1.0 is directly connected, Loopback0 C 192.168.10.0/24 is directly connected, FastEthernet0/0 R 192.168.20.0/24 [120/1] via 192.168.10.2, 00:00:03, FastEthernet0/0 R* 0.0.0.0/0 [120/2] via 192.168.10.2, 00:00:03, FastEthernet0/0 R1#
- 設定削除
検証1の設定を削除します。
R3(config)#no ip route 0.0.0.0 0.0.0.0 Null 0 R3(config)#router rip R3(config-router)#no redistribute static
検証2 default-network
- 事前確認
設定投入前の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 R 192.168.10.0/24 [120/1] via 192.168.20.2, 00:00:05, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0
- default-networkの設定
default-networkを指定します。ルーティングテーブルには3.0.0.0/8という謎のルートが載ります。デフォルトルートはルーティングテーブル上に「*」が表示されますが、テーブル上に「*」つきのエントリが見当たりません。さらに、configを見ると、謎のstatic routeが自動生成されています。
あやしさ満載の動きをします。
あやしさ満載の動きをします。
R3(config)#ip default-network 3.3.3.0 R3(config)# R3(config)# R3(config)# R3(config)#do 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/8 is variably subnetted, 2 subnets, 2 masks C 3.3.3.0/24 is directly connected, Loopback0 S 3.0.0.0/8 [1/0] via 3.3.3.0 R 192.168.10.0/24 [120/1] via 192.168.20.2, 00:00:10, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0 R3(config)# R3(config)# R3(config)#do show run | i ^ip route ip route 3.0.0.0 255.0.0.0 3.3.3.0
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 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Loopback0 C 192.168.10.0/24 is directly connected, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet0/0
- static 再配送
ダメもとで、staticを再配送してみます。
R3(config)#router rip R3(config-router)#redistribute static
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 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Loopback0 R 3.0.0.0/8 [120/1] via 192.168.20.3, 00:00:01, FastEthernet0/0 C 192.168.10.0/24 is directly connected, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet0/0
- 設定削除
検証2の設定を削除します。
R3(config)#no ip default-network 3.3.3.0 R3(config)#router rip R3(config-router)#no redistribute static
検証3 default-network クラスフル指定
- default-network 設定
クラスフルなnetworkアドレスでdefault-netwokrを指定します。3.0.0.0に「*」がつきました。
R3(config)#ip default-network 3.0.0.0 R3(config)# R3(config)# R3(config)#do 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 R 192.168.10.0/24 [120/1] via 192.168.20.2, 00:00:21, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet1/0 R3(config)#
R2のルーティングテーブルを見ると、デフォルトルートが通知された事が確認できます。
EIGRPはdefault-networkを通知できませんが、RIPはdefault-networkを通知できるようです。
EIGRPはdefault-networkを通知できませんが、RIPはdefault-networkを通知できるようです。
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.20.3 to network 0.0.0.0 2.0.0.0/24 is subnetted, 1 subnets C 2.2.2.0 is directly connected, Loopback0 C 192.168.10.0/24 is directly connected, FastEthernet1/0 C 192.168.20.0/24 is directly connected, FastEthernet0/0 R* 0.0.0.0/0 [120/1] via 192.168.20.3, 00:00:15, FastEthernet0/0
補足
ip default-networkを使用する時は、クラスフルネットワークを指定する必要があるようです(サブネットマスクが指定できないのだから当然かもしれませんが…)。