概要

複数のポイントで安易に再配送を行うとルーティングループが起こることがあります。ルーティングループを防止するための設定を行います。

ネットワーク構成

図 ルーティングループの防止 ネットワーク構成
図 ルーティングループの防止 ネットワーク構成

設定条件

  • ルーティングループが発生することがないようにR1、R6でルートフィルタの設定を行います。
  • ルーティングは最適な経路で行われるようにします。

初期設定

以下の設定は設定済みとします。

  • ホスト名
  • IPアドレス
  • OSPF
    • 各ルータのインタフェースはネットワーク構成のとおりOSPFが有効化されていてエリアに所属している
  • RIPv2
    • 各ルータのインタフェースはネットワーク構成のとおりRIPv2が有効化されている
    • 自動集約の無効化
  • 再配送
    • R1、R6でRIPとOSPFの双方向再配送が行われている

R1 Initical Configuration(Click)

!
!
!
version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.1.1 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.1.1 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 192.168.1.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 1
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R2 Initical Configuration(Click)

!
!

version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.1.2 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 172.16.2.2 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 ip address 172.16.4.2 255.255.255.0
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router rip
 version 2
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R3 Initical Configuration(Click)

!
!

version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.2.3 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 172.16.3.3 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router rip
 version 2
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R4 Initical Configuration(Click)

!
!

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.1.4 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.2.4 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 ip address 192.168.4.4 255.255.255.0
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R5 Initical Configuration(Click)

!
!

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.2.5 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.3.5 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R6 Initical Configuration(Click)

!
!
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R6
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.4.6 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.4.6 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 192.168.4.0 0.0.0.255 area 0
!
router rip
 version 2
 redistribute ospf 1 metric 1
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

設定と確認

Step1:R2で受信するルートの確認

R2でdebug ip ripを実行して、受信するルート情報を確認します。

R2 debug ip rip

R2#debug ip rip 
RIP protocol debugging is on
R2#
*Mar  1 00:46:21.219: RIP: received v2 update from 172.16.1.1 on Ethernet0/0
*Mar  1 00:46:21.223:      172.16.2.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.227:      172.16.3.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.227:      172.16.4.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.231:      192.168.1.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.235:      192.168.2.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.239:      192.168.3.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.243:      192.168.4.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.479: RIP: received v2 update from 172.16.4.6 on Ethernet0/2
*Mar  1 00:46:21.479:      172.16.1.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.483:      192.168.1.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.487:      192.168.2.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.491:      192.168.3.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:21.495:      192.168.4.0/24 via 0.0.0.0 in 3 hops
*Mar  1 00:46:32.007: RIP: received v2 update from 172.16.2.3 on Ethernet0/1
*Mar  1 00:46:32.011:      172.16.3.0/24 via 0.0.0.0 in 1 hops

デバッグの出力を見ると、R2はE0/0で172.16.2.0/24、172.16.3.0/24、172.16.4.0/24のルートを受信しています。また、E0/2で172.16.1.0/24のルートを受信しています。これらは、RIPドメインのルートです。いったんOSPFドメインに再配送されて、再びRIPドメインに再配送されてきています。

図 RIPドメインのルートがループする
図 RIPドメインのルートがループする

初期設定では、R1、R6でOSPFからRIPへ再配送するときのシードメトリックを1としています。その結果、R2のルーティングテーブルで172.16.3.0/24のルートが正しくありません。そのため、R2から172.16.3.0/24宛ての通信は正常にできません。

R2 show ip route

R2#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Ethernet0/2
C       172.16.1.0 is directly connected, Ethernet0/0
C       172.16.2.0 is directly connected, Ethernet0/1
R       172.16.3.0 [120/1] via 172.16.2.3, 00:00:03, Ethernet0/1
                   [120/1] via 172.16.1.1, 00:00:09, Ethernet0/0
R    192.168.4.0/24 [120/1] via 172.16.4.6, 00:00:28, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:09, Ethernet0/0
R    192.168.1.0/24 [120/1] via 172.16.4.6, 00:00:28, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:09, Ethernet0/0
R    192.168.2.0/24 [120/1] via 172.16.4.6, 00:00:28, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:09, Ethernet0/0
R    192.168.3.0/24 [120/1] via 172.16.4.6, 00:00:28, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:09, Ethernet0/0

RIPへの再配送時のシードメトリックを大きくすれば、ルーティングは正しくできるようになります。ですが、ルートがループしてアドバタイズされているのは変わりません。

Step2:R1のルートフィルタ

ルートのループを防止するために、R1でOSPFからRIPへ再配送するときには、元々RIPドメインのルートをフィルタします。RIPドメインのルートは172.16ではじまるルートです。同様に、R1でRIPからOSPFへ再配送するときには、元々OSPFドメインのルートをフィルタします。OSPFドメインのルートは192.168ではじまるルートです。

図 ルートフィルタの概要
図 ルートフィルタの概要

R1では、このようなフィルタをディストリビュートリストで行います。

R1 ルートフィルタ

router ospf 1
 distribute-list 2 out rip
!
router rip
 distribute-list 1 out ospf 1
!
access-list 1 deny   172.16.0.0 0.0.255.255
access-list 1 permit any
access-list 2 deny   192.168.0.0 0.0.255.255
access-list 2 permit any

Step3:R6のルートフィルタ

R6でもR1と同様のフィルタを行います。R6ではプレフィクスリストをルートマップで関連付けたフィルタの設定を行うことにします。

R6 ルートフィルタ

router ospf 1
 redistribute rip subnets route-map RIP2OSPF
!
router rip
 redistribute ospf 1 metric 1 route-map OSPF2RIP
!
ip prefix-list OSPF_routes seq 5 permit 192.168.0.0/16 ge 24 le 24
!
ip prefix-list RIP_routes seq 5 permit 172.16.0.0/16 ge 24 le 24
!
route-map OSPF2RIP deny 10
 match ip address prefix-list RIP_routes
!
route-map OSPF2RIP permit 20
!
route-map RIP2OSPF deny 10
 match ip address prefix-list OSPF_routes
!
route-map RIP2OSPF permit 20

Step4:R2で受信するルートの確認

再度、R2でdebug ip ripによって受信するルートを確認します。

R2 debug ip rip

R2#debug ip rip 
RIP protocol debugging is on
R2#
*Mar  1 01:19:19.647: RIP: received v2 update from 172.16.2.3 on Ethernet0/1
*Mar  1 01:19:19.651:      172.16.3.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:21.135: RIP: received v2 update from 172.16.1.1 on Ethernet0/0
*Mar  1 01:19:21.139:      192.168.1.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:21.143:      192.168.2.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:21.147:      192.168.3.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:21.151:      192.168.4.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:24.899: RIP: sending v2 update to 224.0.0.9 via Ethernet0/2 (172.16.4.2)
*Mar  1 01:19:24.903: RIP: build update entries
*Mar  1 01:19:24.903:   172.16.1.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 01:19:24.907:   172.16.2.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 01:19:24.911:   172.16.3.0/24 via 0.0.0.0, metric 2, tag 0
*Mar  1 01:19:27.583: RIP: received v2 update from 172.16.4.6 on Ethernet0/2
*Mar  1 01:19:27.587:      192.168.1.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:27.591:      192.168.2.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:27.595:      192.168.3.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:19:27.595:      192.168.4.0/24 via 0.0.0.0 in 1 hops

R2では、R1およびR6から元々RIPドメインのルートを受信しなくなっていることがわかります。

Step5:通信経路の確認

R1からRIPドメインの172.16.3.0/24へTracerouteを実行します。

R1 traceroute

R1#traceroute 172.16.3.3

Type escape sequence to abort.
Tracing the route to 172.16.3.3

  1 192.168.1.4 60 msec 16 msec 4 msec
  2 192.168.4.6 8 msec 8 msec 4 msec
  3 172.16.4.2 4 msec 20 msec 32 msec
  4 172.16.2.3 44 msec *  80 msec

Tracerouteの結果から、R1からいったんOSPFドメインにパケットを送信してしまっています。これは、最適な経路のルーティングではありません。

図 R1から172.16.3.0/24への経路
図 R1から172.16.3.0/24への経路

R1は、172.16.3.0/24のルートをRIPv2でR2から受信しています。また、R6でOSPFに再配送された172.16.3.0/24のルートをR4経由で受信しています。アドミニストレイティブディスタンスによって、R1はOSPFで学習した172.16.3.0/24をルーティングテーブルに登録しています。

図 R1における172.16.3.0/24のルート
図 R1における172.16.3.0/24のルート

R1 show ip route

R1#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
O E2    172.16.4.0 [110/20] via 192.168.1.4, 01:31:38, Ethernet0/1
C       172.16.1.0 is directly connected, Ethernet0/0
O E2    172.16.2.0 [110/20] via 192.168.1.4, 01:31:38, Ethernet0/1
O E2    172.16.3.0 [110/20] via 192.168.1.4, 01:31:38, Ethernet0/1
O    192.168.4.0/24 [110/20] via 192.168.1.4, 01:31:38, Ethernet0/1
C    192.168.1.0/24 is directly connected, Ethernet0/1
O    192.168.2.0/24 [110/20] via 192.168.1.4, 01:31:38, Ethernet0/1
O    192.168.3.0/24 [110/30] via 192.168.1.4, 01:31:38, Ethernet0/1

Step6:ルーティングの最適化

最適な経路でパケットをルーティングできるようにするためには、ルーティングドメインの境界となるR1とR6で追加の設定を行います。R1、R6ではRIPドメインのルートはRIPルートとしてルーティングテーブルに登録されるようにします。同様に、OSPFドメインのルートはOSPFルートとしてルーティングテーブルに登録されるようにします。

これを実現するために、アドミニストレイティブディスタンスを調整します。OSPF外部ルートのアドミニストレイティブをRIPのデフォルト値120よりも大きくします。

R1/R6 アドミニストレイティブディスタンスの設定

router ospf 1
 distance ospf external 125
図 ルーティングの最適化
図 ルーティングの最適化

Step7:ルーティングテーブルの確認

各ルータで最終的なルーティングテーブルを確認します。

R1 show ip route

R1#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
R       172.16.4.0 [120/1] via 172.16.1.2, 00:00:10, Ethernet0/0
C       172.16.1.0 is directly connected, Ethernet0/0
R       172.16.2.0 [120/1] via 172.16.1.2, 00:00:10, Ethernet0/0
R       172.16.3.0 [120/2] via 172.16.1.2, 00:00:10, Ethernet0/0
O    192.168.4.0/24 [110/20] via 192.168.1.4, 00:05:17, Ethernet0/1
C    192.168.1.0/24 is directly connected, Ethernet0/1
O    192.168.2.0/24 [110/20] via 192.168.1.4, 00:05:17, Ethernet0/1
O    192.168.3.0/24 [110/30] via 192.168.1.4, 00:05:17, Ethernet0/1

R2 show ip route

R2#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Ethernet0/2
C       172.16.1.0 is directly connected, Ethernet0/0
C       172.16.2.0 is directly connected, Ethernet0/1
R       172.16.3.0 [120/1] via 172.16.2.3, 00:00:02, Ethernet0/1
R    192.168.4.0/24 [120/1] via 172.16.4.6, 00:00:01, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:15, Ethernet0/0
R    192.168.1.0/24 [120/1] via 172.16.4.6, 00:00:01, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:15, Ethernet0/0
R    192.168.2.0/24 [120/1] via 172.16.4.6, 00:00:01, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:15, Ethernet0/0
R    192.168.3.0/24 [120/1] via 172.16.4.6, 00:00:01, Ethernet0/2
                    [120/1] via 172.16.1.1, 00:00:15, Ethernet0/0

R3 show ip route

R3#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
R       172.16.4.0 [120/1] via 172.16.2.2, 00:00:21, Ethernet0/0
R       172.16.1.0 [120/1] via 172.16.2.2, 00:00:21, Ethernet0/0
C       172.16.2.0 is directly connected, Ethernet0/0
C       172.16.3.0 is directly connected, Ethernet0/1
R    192.168.4.0/24 [120/2] via 172.16.2.2, 00:00:21, Ethernet0/0
R    192.168.1.0/24 [120/2] via 172.16.2.2, 00:00:21, Ethernet0/0
R    192.168.2.0/24 [120/2] via 172.16.2.2, 00:00:21, Ethernet0/0
R    192.168.3.0/24 [120/2] via 172.16.2.2, 00:00:21, Ethernet0/0

R4 show ip route

R4#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
O E2    172.16.4.0 [110/20] via 192.168.4.6, 00:06:43, Ethernet0/2
                   [110/20] via 192.168.1.1, 00:06:43, Ethernet0/0
O E2    172.16.1.0 [110/20] via 192.168.4.6, 00:06:39, Ethernet0/2
                   [110/20] via 192.168.1.1, 00:06:39, Ethernet0/0
O E2    172.16.2.0 [110/20] via 192.168.4.6, 00:06:43, Ethernet0/2
                   [110/20] via 192.168.1.1, 00:06:43, Ethernet0/0
O E2    172.16.3.0 [110/20] via 192.168.4.6, 00:06:43, Ethernet0/2
                   [110/20] via 192.168.1.1, 00:06:43, Ethernet0/0
C    192.168.4.0/24 is directly connected, Ethernet0/2
C    192.168.1.0/24 is directly connected, Ethernet0/0
C    192.168.2.0/24 is directly connected, Ethernet0/1
O    192.168.3.0/24 [110/20] via 192.168.2.5, 01:44:43, Ethernet0/1

R5 show ip route

R5#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
O E2    172.16.4.0 [110/20] via 192.168.2.4, 00:07:00, Ethernet0/0
O E2    172.16.1.0 [110/20] via 192.168.2.4, 00:06:57, Ethernet0/0
O E2    172.16.2.0 [110/20] via 192.168.2.4, 00:07:00, Ethernet0/0
O E2    172.16.3.0 [110/20] via 192.168.2.4, 00:07:00, Ethernet0/0
O    192.168.4.0/24 [110/20] via 192.168.2.4, 01:45:06, Ethernet0/0
O    192.168.1.0/24 [110/20] via 192.168.2.4, 01:45:06, Ethernet0/0
C    192.168.2.0/24 is directly connected, Ethernet0/0
C    192.168.3.0/24 is directly connected, Ethernet0/1

R6 show ip route

R6#show ip route 
-- omitted --

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 4 subnets
C       172.16.4.0 is directly connected, Ethernet0/0
R       172.16.1.0 [120/1] via 172.16.4.2, 00:00:22, Ethernet0/0
R       172.16.2.0 [120/1] via 172.16.4.2, 00:00:22, Ethernet0/0
R       172.16.3.0 [120/2] via 172.16.4.2, 00:00:22, Ethernet0/0
C    192.168.4.0/24 is directly connected, Ethernet0/1
O    192.168.1.0/24 [110/20] via 192.168.4.4, 00:07:32, Ethernet0/1
O    192.168.2.0/24 [110/20] via 192.168.4.4, 00:07:32, Ethernet0/1
O    192.168.3.0/24 [110/30] via 192.168.4.4, 00:07:32, Ethernet0/1

Step8:通信経路の確認

あらためてR1からRIPドメインの172.16.3.0/24へTracerouteを実行します。

R1 traceroute

R1#traceroute 172.16.3.3

Type escape sequence to abort.
Tracing the route to 172.16.3.3

  1 172.16.1.2 4 msec 12 msec 8 msec
  2 172.16.2.3 12 msec *  12 msec

R1からRIPドメインの172.16.3.0/24へ最適な経路でルーティングされています。

図 R1から172.16.3.0/24への経路
図 R1から172.16.3.0/24への経路

完了した設定ファイル

R1 Completed Configuration(Click)

!
version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.1.1 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.1.1 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets
 network 192.168.1.0 0.0.0.255 area 0
 distribute-list 2 out rip
 distance ospf external 125
!
router rip
 version 2
 redistribute ospf 1 metric 1
 network 172.16.0.0
 distribute-list 1 out ospf 1
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
access-list 1 deny   172.16.0.0 0.0.255.255
access-list 1 permit any
access-list 2 deny   192.168.0.0 0.0.255.255
access-list 2 permit any
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R2 Completed Configuration(Click)

!
version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.1.2 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 172.16.2.2 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 ip address 172.16.4.2 255.255.255.0
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router rip
 version 2
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R3 Completed Configuration(Click)

!
version 12.4
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
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.2.3 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 172.16.3.3 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router rip
 version 2
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R4 Completed Configuration(Click)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R4
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.1.4 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.2.4 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 ip address 192.168.4.4 255.255.255.0
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R5 Completed Configuration(Click)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R5
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.2.5 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.3.5 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 network 192.168.0.0 0.0.255.255 area 0
!
ip http server
ip forward-protocol nd
!
!
!
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

R6 Completed Configuration(Click)

!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R6
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
!
!
ip cef
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 172.16.4.6 255.255.255.0
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.4.6 255.255.255.0
 half-duplex
!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
!
router ospf 1
 log-adjacency-changes
 redistribute rip subnets route-map RIP2OSPF
 network 192.168.4.0 0.0.0.255 area 0
 distance ospf external 125
!
router rip
 version 2
 redistribute ospf 1 metric 1 route-map OSPF2RIP
 network 172.16.0.0
 no auto-summary
!
ip http server
ip forward-protocol nd
!
!
!
!
ip prefix-list OSPF_routes seq 5 permit 192.168.0.0/16 ge 24 le 24
!
ip prefix-list RIP_routes seq 5 permit 172.16.0.0/16 ge 24 le 24
!
route-map OSPF2RIP deny 10
 match ip address prefix-list RIP_routes
!
route-map OSPF2RIP permit 20
!
route-map RIP2OSPF deny 10
 match ip address prefix-list OSPF_routes
!
route-map RIP2OSPF permit 20
!
!
!
control-plane
!
!
!
!
mgcp behavior g729-variants static-pt
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
line aux 0
line vty 0 4
 login
!
!
end

関連記事

関連記事










IPルーティング応用