DynagenでCCIEを目指す
20010518 TAGによる再配送の制御
最終更新:
it_certification
-
view
目的
- tagによって限られたルートのみを再配送します。
構成
- 設定概要
- 検証したい構成は構成図1の通りです。
- domain 1同士、domain 2同士が経路を交換できるように設定するのが最終目標です。
- PCのスペック上、ルータ6台を起動するのは難しいので、構成図2で検証を行います。
- R2のLoopback 1, Loopback 2をOSPFに再配送し、このルートをEIGRP domain 2であると見立てます。
- R3のLoopback 1, Loopback 2をOSPFに再配送し、このルートをEIGRP domain 2であると見立てます。
- 初期設定時では、タグを定義せず再配送するため、domain 1, domain 2の経路が混ざっている状態になっています。
- 構成図1

- 構成図2

- netファイル
model = 3620 [localhost] [[3620]] image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin ram = 128 [[ROUTER R1]] f0/0 = R2 f0/0 [[ROUTER R2]] f1/0 = R3 f1/0 [[ROUTER R3]] f0/0 = R4 f0/0 [[ROUTER R4]]
- 初期設定 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.255 ! interface FastEthernet0/0 ip address 192.168.10.1 255.255.255.0 duplex auto speed auto ! router eigrp 1 network 1.1.1.1 0.0.0.0 network 192.168.10.1 0.0.0.0 no auto-summary ! 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 Loopback0 ip address 2.2.2.2 255.255.255.255 ! interface Loopback1 ip address 192.168.110.2 255.255.255.0 ! interface Loopback2 ip address 5.5.5.5 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.10.2 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.20.2 255.255.255.0 duplex auto speed auto ! router eigrp 1 redistribute ospf 1 network 192.168.10.2 0.0.0.0 default-metric 100 10 255 1 1 no auto-summary ! router ospf 1 router-id 2.2.2.2 log-adjacency-changes redistribute connected subnets redistribute eigrp 1 subnets network 192.168.10.2 0.0.0.0 area 0 network 192.168.20.2 0.0.0.0 area 0 network 192.168.110.2 0.0.0.0 area 0 ! 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.255 ! interface Loopback1 ip address 192.168.130.3 255.255.255.0 ! interface Loopback2 ip address 6.6.6.6 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.30.3 255.255.255.0 duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.20.3 255.255.255.0 duplex auto speed auto ! router eigrp 1 redistribute ospf 1 network 192.168.30.3 0.0.0.0 default-metric 100 10 255 1 1 no auto-summary ! router ospf 1 router-id 3.3.3.3 log-adjacency-changes redistribute connected subnets redistribute eigrp 1 subnets network 192.168.20.3 0.0.0.0 area 0 network 192.168.30.3 0.0.0.0 area 0 network 192.168.130.3 0.0.0.0 area 0 ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 login ! ! end
- 初期設定 R4
! version 12.3 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 ip subnet-zero ! ! ! ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 4.4.4.4 255.255.255.255 ! interface FastEthernet0/0 ip address 192.168.30.4 255.255.255.0 duplex auto speed auto ! router eigrp 1 network 4.4.4.4 0.0.0.0 network 192.168.30.4 0.0.0.0 no auto-summary ! ip http server ip classless ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 初期設定の確認
- ルーティングテーブルの確認
R1, R4のルーティングテーブルを確認します。domain 2やOSPF内のルートもテーブル上に載っている事が分かります。
R1#show ip route eigrp 3.0.0.0/32 is subnetted, 1 subnets D EX 3.3.3.3 [170/25605120] via 192.168.10.2, 00:14:32, FastEthernet0/0 D EX 192.168.30.0/24 [170/25605120] via 192.168.10.2, 00:02:42, FastEthernet0/0 4.0.0.0/32 is subnetted, 1 subnets D EX 4.4.4.4 [170/25605120] via 192.168.10.2, 00:08:15, FastEthernet0/0 <- OSPFへのルート D EX 192.168.110.0/24 [170/25605120] via 192.168.10.2, 00:07:59, FastEthernet0/0 6.0.0.0/32 is subnetted, 1 subnets D EX 6.6.6.6 [170/25605120] via 192.168.10.2, 00:14:32, FastEthernet0/0 <- domain 2へのルート 192.168.130.0/32 is subnetted, 1 subnets D EX 192.168.130.3 [170/25605120] via 192.168.10.2, 00:02:21, FastEthernet0/0 D EX 192.168.20.0/24 [170/25605120] via 192.168.10.2, 00:14:32, FastEthernet0/0 R1# R4#show ip route eigrp 1.0.0.0/32 is subnetted, 1 subnets D EX 1.1.1.1 [170/25605120] via 192.168.30.3, 00:01:00, FastEthernet0/0 2.0.0.0/32 is subnetted, 1 subnets D EX 2.2.2.2 [170/25605120] via 192.168.30.3, 00:01:05, FastEthernet0/0 <- OSPFへのルート 192.168.110.0/32 is subnetted, 1 subnets D EX 192.168.110.2 [170/25605120] via 192.168.30.3, 00:04:48, FastEthernet0/0 5.0.0.0/32 is subnetted, 1 subnets D EX 5.5.5.5 [170/25605120] via 192.168.30.3, 00:01:05, FastEthernet0/0 <- domain 2へのルート D EX 192.168.10.0/24 [170/25605120] via 192.168.30.3, 00:04:43, FastEthernet0/0 D EX 192.168.130.0/24 [170/25605120] via 192.168.30.3, 00:01:34, FastEthernet0/0 D EX 192.168.20.0/24 [170/25605120] via 192.168.30.3, 00:05:03, FastEthernet0/0 R4#
検証2 TAGの設定
- TAGの付与
EIGRP domain 1からのルートに対し、TAGを付与します。
R2(config)#router ospf 1 R2(config-router)#no redistribute eigrp 1 subnets R2(config-router)#redistribute eigrp 1 subnets tag 1 R3(config)#router ospf 1 R3(config-router)#no redistribute eigrp 1 subnets R3(config-router)#redistribute eigrp 1 subnets tag 1
- TAG付与の確認
TAGが付与された事を確認します。show ip ospf databaseで確認する事ができます。
R2#show ip ospf database OSPF Router with ID (2.2.2.2) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 550 0x80000002 0x007D33 3 3.3.3.3 3.3.3.3 550 0x80000002 0x004638 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.20.3 3.3.3.3 551 0x80000001 0x006336 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 1.1.1.1 2.2.2.2 84 0x80000001 0x0050CE 1 2.2.2.2 2.2.2.2 592 0x80000001 0x004F41 0 3.3.3.3 3.3.3.3 591 0x80000001 0x000385 0 4.4.4.4 3.3.3.3 59 0x80000001 0x00D621 1 5.5.5.5 2.2.2.2 592 0x80000001 0x00C4BF 0 6.6.6.6 3.3.3.3 591 0x80000001 0x007804 0 R2# R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 564 0x80000002 0x007D33 3 3.3.3.3 3.3.3.3 563 0x80000002 0x004638 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 192.168.20.3 3.3.3.3 563 0x80000001 0x006336 Type-5 AS External Link States Link ID ADV Router Age Seq# Checksum Tag 1.1.1.1 2.2.2.2 98 0x80000001 0x0050CE 1 2.2.2.2 2.2.2.2 605 0x80000001 0x004F41 0 3.3.3.3 3.3.3.3 603 0x80000001 0x000385 0 4.4.4.4 3.3.3.3 72 0x80000001 0x00D621 1 5.5.5.5 2.2.2.2 605 0x80000001 0x00C4BF 0 6.6.6.6 3.3.3.3 603 0x80000001 0x007804 0 R3#
検証3 R2の設定
- R2の設定
R2でTAGが付与されたルートのみEIGRP domain 1へ再配送するよう設定します。以下の設定は、TAGが1でOSPF外部ルート2(O E2の表記)であるものを再配送するという意味です。
R2(config)#route-map TAG_MATCH permit 10 R2(config-route-map)#match tag 1 R2(config-route-map)#exit R2(config)# R2(config)#router eigrp 1 R2(config-router)#no redistribute ospf 1 R2(config-router)#redistribute ospf 1 match external 2 route-map TAG_MATCH
- ルーティングテーブルの確認
R1のルーティングテーブルを確認します。R4のEIGRP domain 1から伝わったルート以外がフィルタされた事が確認できます。
R1#show ip route eigrp 4.0.0.0/32 is subnetted, 1 subnets D EX 4.4.4.4 [170/25605120] via 192.168.10.2, 00:00:07, FastEthernet0/0 R1#
検証4 R3の設定
- R3の設定
R3でTAGがデフォルトであるもの(TAGが0であるもの)を拒否するよう設定します。検証3と異なりmatch句がありませんが、この場合は全ルート(O, O IA, O E1, O E2, O N1, O N2)が再配送の対象となり、ルートマップに合致するかどうか検査されます。
R3(config)#route-map TAG_MATCH deny 10 R3(config-route-map)#match tag 0 R3(config-route-map)#exit R3(config)#route-map TAG_MATCH permit 20 R3(config-route-map)#exit R3(config)# R3(config)#router eigrp 1 R3(config-router)#no redistribute ospf 1 R3(config-router)#redistribute ospf 1 route-map TAG_MATCH
- ルーティングテーブルの確認
R4のルーティングテーブルを確認します。R1のEIGRP domain 1から伝わったルート以外がフィルタされた事が確認できます。
R4#show ip route eigrp 1.0.0.0/32 is subnetted, 1 subnets D EX 1.1.1.1 [170/25605120] via 192.168.30.3, 00:00:07, FastEthernet0/0 R4#