デフォルトルートの伝播



●RIP

 参照したのは下記URLです。
 RIP(デフォルトルートの伝播)

default_route101.jpg

 参照したネットワーク構成では、Router_A、Router_Bでインターネット向けのルートをデフォルトルートを設定することでルーティングテーブルを小さくすることができます。
 そのデフォルトルートですが、Router_A、Router_Bにおいて静的なデフォルトルート「ip route 0.0.0.0 0.0.0.0」を指定することでもできますし、インターネットへの境界ルータであるRouter_Aで指定したルートを他のRIPルータに伝播させることもできます。。
 RIPでデフォルトルートを伝播させる方法は、いくつかありますが、ここでは、静的ルートのデフォルトルート「ip route 0.0.0.0 0.0.0.0」を指定することでデフォルトルートを伝播させてゆきます。
 ここでは、「redistribute static」コマンドを使って、「ip route 0.0.0.0 0.0.0.0」ルートをEIGRPルータに再配布させるようにします。

 機器構成は、ISP(Cisco 1812J)、Router_A(Cisco 1812J)、Router_B(Catalyst 3750G)です。
 ホスト名ISPの設定内容
!
hostname ISP
!
interface Loopback0
 ip address 10.0.0.1 255.0.0.0
!
interface Loopback1
 ip address 192.168.1.1 255.255.255.0
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.1 255.255.0.0
 duplex auto
 speed auto
!
ip route 172.17.0.0 255.255.0.0 172.16.1.2
ip route 172.18.0.0 255.255.0.0 172.16.1.2
!
end
 ホスト名Router_Aの設定内容
!
hostname Router_A
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.2 255.255.0.0
 duplex auto
 speed auto
!
interface FastEthernet1
 ip address 172.17.1.1 255.255.0.0
 duplex auto
 speed auto
!
router rip
 version 2
 network 172.16.0.0
 network 172.17.0.0
!
ip default-network 172.16.0.0
ip route 0.0.0.0 0.0.0.0 172.16.1.1
end
 ホスト名Router_Bの設定内容
!
hostname Router_B
!
no aaa new-model
clock timezone JST 9
switch 1 provision ws-c3750-24ts
system mtu routing 1500
ip subnet-zero
ip routing
!
interface FastEthernet1/0/1
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/2
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/3
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet1/0/4
 switchport access vlan 3
 switchport mode access
!
interface Vlan2
 ip address 172.17.1.2 255.255.0.0
!
interface Vlan3
 ip address 172.18.1.1 255.255.0.0
!
router rip
 version 2
 network 172.17.0.0
 network 172.18.0.0
!
end
 Router_Aのルーティングテーブル
S*    0.0.0.0/0 [1/0] via 172.16.1.1
R     10.0.0.0/8 [120/1] via 172.16.1.1, 00:00:07, FastEthernet0
 *    172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C*       172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.2/32 is directly connected, FastEthernet0
      172.17.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.17.0.0/16 is directly connected, FastEthernet1
L        172.17.1.1/32 is directly connected, FastEthernet1
R     172.18.0.0/16 [120/1] via 172.17.1.2, 00:00:00, FastEthernet1
R     192.168.1.0/24 [120/1] via 172.16.1.1, 00:00:07, FastEthernet0
 Router_Bのルーティングテーブル
Gateway of last resort is not set
C    172.17.0.0/16 is directly connected, Vlan2
R    172.16.0.0/16 [120/1] via 172.17.1.1, 00:00:00, Vlan2
C    172.18.0.0/16 is directly connected, Vlan3
R    10.0.0.0/8 [120/2] via 172.17.1.1, 00:00:00, Vlan2
R    192.168.1.0/24 [120/2] via 172.17.1.1, 00:00:00, Vlan2

●EIGRP

 参照したのは下記URLです。
 EIGRP(デフォルトルートの伝播)

default_route301.jpg

 参照したネットワーク構成では、Router_A、Router_Bでインターネット向けのルートをデフォルトルートを設定することでルーティングテーブルを小さくすることができます。
 デフォルトルートはRouter_A、Router_Bにおいて、それぞれ静的デフォルトルート「ip route 0.0.0.0 0.0.0.0」を指定することでもできますし、インターネットへの境界ルータであるRouter_Aで指定したルートを他のEIGRPルータに伝播させることもできます。
 IGRPの拡張版であるEIGRPでも「0.0.0.0」へのルートが分かりません。したがって、「ip route 0.0.0.0 0.0.0.0」で指定されてデフォルトルートを再配布することができません。その為、EIGRPでは「ip default-network」コマンドを使用して、デフォルトルートを再配布する必要があります。
 「ip route 0.0.0.0 0.0.0.0」で指定したデフォルトルートを再配布することができないと言いましたが、EIGRPではスタティックルートを再配布するという設定で、「ip route 0.0.0.0 0.0.0.0」ルートを伝播させることができます。
 ここでは、「redistribute static」コマンドを使って、「ip route 0.0.0.0 0.0.0.0」ルートをEIGRPルータに再配布させるようにします。

 機器構成は、ISP(Cisco 1812J)、Router_A(Cisco 1812J)、Router_B(Catalyst 3750G)です。
 ホスト名ISPの設定内容
!
hostname ISP
!
interface Loopback0
 ip address 10.0.0.1 255.0.0.0
!
interface Loopback1
 ip address 192.168.1.1 255.255.255.0
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.1 255.255.0.0
 duplex auto
 speed auto
!
ip route 172.17.0.0 255.255.0.0 172.16.1.2
ip route 172.18.0.0 255.255.0.0 172.16.1.2
!
end
 ホスト名Router_Aの設定内容
!
hostname Router_A
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.2 255.255.0.0
 duplex auto
 speed auto
!
interface FastEthernet1
 ip address 172.17.1.1 255.255.0.0
 duplex auto
 speed auto
!
!
router eigrp 1
 network 172.17.0.0
 redistribute static
!
ip default-network 172.16.0.0
ip route 0.0.0.0 0.0.0.0 172.16.1.1
end
 ホスト名Router_Bの設定内容
!
hostname Router_B
!
no aaa new-model
clock timezone JST 9
switch 1 provision ws-c3750-24ts
system mtu routing 1500
ip subnet-zero
ip routing
!
interface FastEthernet1/0/1
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/2
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/3
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet1/0/4
 switchport access vlan 3
 switchport mode access
!
interface Vlan2
 ip address 172.17.1.2 255.255.0.0
!
interface Vlan3
 ip address 172.18.1.1 255.255.0.0
!
!
router eigrp 1
 network 172.17.0.0
 network 172.18.0.0
!
end
 Router_BのVlan 2に172.18.1.10を接続したところ、このPCから仮想インターネット(10.0.0.1、192.168.1.1)のpingの応答を確認することができました。
 しかし、Router_Bから172.16.1.1(10.0.0.1、192.168.1.1)から応答がなく、ISPから172.17.1.1(よりRouter_Bに向かって右側のIPアドレス)から応答がありません。
 解決
 原因は、下記です。
ip route 172.17.0.0 255.255.255.0 172.16.1.2
ip route 172.18.0.0 255.255.255.0 172.16.1.2
 これを下記の通り修正したら問題が解消しました。
ip route 172.17.0.0 255.255.0.0 172.16.1.2
ip route 172.18.0.0 255.255.0.0 172.16.1.2

 ISPのルーティングテーブル(ISPのip routeの設定が間違っている場合
Gateway of last resort is not set
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/8 is directly connected, Loopback0
L        10.0.0.1/32 is directly connected, Loopback0
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.1/32 is directly connected, FastEthernet0
      172.17.0.0/24 is subnetted, 1 subnets
S        172.17.0.0 [1/0] via 172.16.1.2
      172.18.0.0/24 is subnetted, 1 subnets
S        172.18.0.0 [1/0] via 172.16.1.2
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback1
L        192.168.1.1/32 is directly connected, Loopback1

 ISPのルーティングテーブル(ISPのip routeの設定が正しい場合
Gateway of last resort is not set
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.0.0.0/8 is directly connected, Loopback0
L        10.0.0.1/32 is directly connected, Loopback0
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.1/32 is directly connected, FastEthernet0
S     172.17.0.0/16 [1/0] via 172.16.1.2
S     172.18.0.0/16 [1/0] via 172.16.1.2
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Loopback1
L        192.168.1.1/32 is directly connected, Loopback1

 Router_Aのルーティングテーブル(ISPのip routeの設定が間違っている場合
Gateway of last resort is 172.16.1.1 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 172.16.1.1
 *    172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C*       172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.2/32 is directly connected, FastEthernet0
      172.17.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.17.0.0/16 is directly connected, FastEthernet1
L        172.17.1.1/32 is directly connected, FastEthernet1
D     172.18.0.0/16 [90/28416] via 172.17.1.2, 00:42:21, FastEthernet1

 Router_Aのルーティングテーブル(ISPのip routeの設定が正しい場合
Gateway of last resort is 172.16.1.1 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 172.16.1.1
 *    172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C*       172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.2/32 is directly connected, FastEthernet0
      172.17.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.17.0.0/16 is directly connected, FastEthernet1
L        172.17.1.1/32 is directly connected, FastEthernet1
D     172.18.0.0/16 [90/28416] via 172.17.1.2, 00:31:05, FastEthernet1

 Router_Bのルーティングテーブル(ISPのip routeの設定が間違っている場合
Gateway of last resort is 172.17.1.1 to network 0.0.0.0
C    172.17.0.0/16 is directly connected, Vlan2
C    172.18.0.0/16 is directly connected, Vlan3
D*EX 0.0.0.0/0 [170/28416] via 172.17.1.1, 00:46:27, Vlan2

 Router_Bのルーティングテーブル(ISPのip routeの設定が正しい場合
Gateway of last resort is 172.17.1.1 to network 0.0.0.0
C    172.17.0.0/16 is directly connected, Vlan2
C    172.18.0.0/16 is directly connected, Vlan3
D*EX 0.0.0.0/0 [170/28416] via 172.17.1.1, 00:32:52, Vlan2

●OSPF

 参照したのは下記URLです。
 OSPF(デフォルトルートの伝播)

default_route401.jpg

 参照したネットワーク構成では、Router_A、Router_Bでインターネット向けのルートをデフォルトルートを設定することでルーティングテーブルを小さくすることができます。
 デフォルトルートはRouter_A、Router_Bにおいて、それぞれ静的デフォルトルート「ip route 0.0.0.0 0.0.0.0」を指定することでもできますし、インターネットへの境界ルータであるRouter_Aで指定したルートを他のOSPFルータに伝播させることもできます。
 OSPFでは「ip route 0.0.0.0 0.0.0.0」で指定したデフォルトルートを「default-information originate」コマンドを使用してデフォルトルートを伝播させます。
 「default-information originate」コマンドはルーティング設定モードで設定します。

 機器構成は、ISP(Cisco 1812J)、Router_A(Cisco 1812J)、Router_B(Catalyst 3750G)です。
 ホスト名ISPの設定内容
!
hostname ISP
!
interface Loopback0
 ip address 10.0.0.1 255.0.0.0
!
interface Loopback1
 ip address 192.168.1.1 255.255.255.0
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.1 255.255.0.0
 duplex auto
 speed auto
!
ip route 172.17.0.0 255.255.0.0 172.16.1.2
ip route 172.18.0.0 255.255.0.0 172.16.1.2
!
end
 ホスト名Router_Aの設定内容
!
hostname Router_A
!
interface BRI0
 no ip address
 encapsulation hdlc
 shutdown
!
interface FastEthernet0
 ip address 172.16.1.2 255.255.0.0
 duplex auto
 speed auto
!
interface FastEthernet1
 ip address 172.17.1.1 255.255.0.0
 duplex auto
 speed auto
!
router ospf 1
 network 172.17.0.0 0.0.255.255 area 0
 default-information originate
!
ip default-network 172.16.0.0
ip route 0.0.0.0 0.0.0.0 172.16.1.1
end
 ホスト名Router_Bの設定内容
!
hostname Router_B
!
no aaa new-model
clock timezone JST 9
switch 1 provision ws-c3750-24ts
system mtu routing 1500
ip subnet-zero
ip routing
!
interface FastEthernet1/0/1
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/2
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet1/0/3
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet1/0/4
 switchport access vlan 3
 switchport mode access
!
interface Vlan2
 ip address 172.17.1.2 255.255.0.0
!
interface Vlan3
 ip address 172.18.1.1 255.255.0.0
!
router ospf 1
 log-adjacency-changes
 network 172.17.0.0 0.0.255.255 area 0
 network 172.18.0.0 0.0.255.255 area 0
!
end
 Router_Aのルーティングテーブル
Gateway of last resort is 172.16.1.1 to network 0.0.0.0
S*    0.0.0.0/0 [1/0] via 172.16.1.1
 *    172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C*       172.16.0.0/16 is directly connected, FastEthernet0
L        172.16.1.2/32 is directly connected, FastEthernet0
      172.17.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.17.0.0/16 is directly connected, FastEthernet1
L        172.17.1.1/32 is directly connected, FastEthernet1
O     172.18.0.0/16 [110/2] via 172.17.1.2, 01:16:45, FastEthernet1
 Router_Bのルーティングテーブル
Gateway of last resort is 172.17.1.1 to network 0.0.0.0
C    172.17.0.0/16 is directly connected, Vlan2
C    172.18.0.0/16 is directly connected, Vlan3
O*E2 0.0.0.0/0 [110/1] via 172.17.1.1, 00:00:01, Vlan2

●デフォルトルートの設定し忘れ

 catalyst3750-1に直接設定されているネットワークからしかインターネットに接続できずに、何でだろう・・何でだろう・・悩んでいました。
 catalyst3750-1のルーティング情報は下記のとおりです。
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
   (省略)
Gateway of last resort is 1.0.0.1 to network 0.0.0.0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.0.0.0 is directly connected, Vlan2
O E2 172.17.0.0/16 [110/10] via 1.0.0.252, 02:01:34, Vlan2
     172.16.0.0/24 is subnetted, 1 subnets
O       172.16.0.0 [110/2] via 1.0.0.252, 02:01:34, Vlan2
   (省略)
 よくよく確認してい見ると他のL3SWはデフォルトルートが設定されていませんでした。
◆Router_A
Router_A#sh ip route
   (省略)
Gateway of last resort is not set
      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.0.0.0/24 is directly connected, Vlan2
L        1.0.0.252/32 is directly connected, Vlan2
   (省略)
◆Router_B
Router_B#sh ip route
   (省略)
Gateway of last resort is not set
      1.0.0.0/24 is subnetted, 1 subnets
O        1.0.0.0 [110/2] via 172.16.0.254, 02:34:00, Vlan10
   (省略)
◆Router_C
Router_C#sh ip route
   (省略)
Gateway of last resort is not set
      1.0.0.0/24 is subnetted, 1 subnets
R        1.0.0.0 [120/2] via 172.50.1.254, 00:00:12, Vlan50
                 [120/2] via 172.40.1.254, 00:00:20, FastEthernet0
   (省略)
◆Router_D
Router_D#sh ip route
   (省略)
Gateway of last resort is not set
      1.0.0.0/24 is subnetted, 1 subnets
D EX     1.0.0.0 [170/30720] via 172.41.1.254, 02:53:18, FastEthernet0
   (省略)
◆catalyst3750-2
catalyst3750-2#sh ip route
   (省略)
Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
D EX    1.0.0.0 [170/28416] via 172.17.1.254, 02:19:46, Vlan20
   (省略)
 すべてのL3SWにデフォルトゲートウェイが伝搬するように設定します。catalyst3750-1ではOSPFを設定していますので、OSPFで伝搬するようにします
catalyst3750-1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
catalyst3750-1(config)#router ospf 1                   
catalyst3750-1(config-router)#default-information originate   
catalyst3750-1(config-router)#^Z
 他のL3SWに伝搬されているか確認します。
◆Router_A
Router_A#sh ip route
   (省略)
Gateway of last resort is 1.0.0.1 to network 0.0.0.0
O*E2  0.0.0.0/0 [110/1] via 1.0.0.1, 00:14:15, Vlan2
      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.0.0.0/24 is directly connected, Vlan2
L        1.0.0.252/32 is directly connected, Vlan2
   (省略)
◆Router_B
Router_B#sh ip route
   (省略)
Gateway of last resort is 172.16.0.254 to network 0.0.0.0
O*E2  0.0.0.0/0 [110/1] via 172.16.0.254, 00:17:19, Vlan10
      1.0.0.0/24 is subnetted, 1 subnets
O        1.0.0.0 [110/2] via 172.16.0.254, 03:28:15, Vlan10
   (省略)
◆Router_C
Router_C#sh ip route
   (省略)
Gateway of last resort is 172.50.1.254 to network 0.0.0.0
R*    0.0.0.0/0 [120/2] via 172.50.1.254, 00:00:18, Vlan50
                [120/2] via 172.40.1.254, 00:00:19, FastEthernet0
      1.0.0.0/24 is subnetted, 1 subnets
R        1.0.0.0 [120/2] via 172.50.1.254, 00:00:18, Vlan50
                 [120/2] via 172.40.1.254, 00:00:19, FastEthernet0
   (省略)
◆Router_D
Router_D#sh ip route
   (省略)
Gateway of last resort is 172.41.1.254 to network 0.0.0.0
D*EX  0.0.0.0/0 [170/30720] via 172.41.1.254, 00:21:01, FastEthernet0
      1.0.0.0/24 is subnetted, 1 subnets
D EX     1.0.0.0 [170/30720] via 172.41.1.254, 03:17:55, FastEthernet0
   (省略)
◆catalyst3750-2
catalyst3750-2#sh ip route
   (省略)
Gateway of last resort is 172.17.1.254 to network 0.0.0.0
     1.0.0.0/24 is subnetted, 1 subnets
D EX    1.0.0.0 [170/28416] via 172.17.1.254, 03:33:32, Vlan20
   (省略)