ルートフィルタ設定(ルート再配送時)
ルートフィルタの設定を行います。ここでは、ルートの再配送時に標準アクセスリストを使ってルートフィルタを検証してみます。
まずは、RIPv2、OSPFによるネットワークを構築し、Router_B上で再配送の設定を行います。
再配送の設定については、「ルート再配送(redistribute)」を参考にしてみて下さい。

各ルータのルーティングの設定は、以下のようになります。
●Router_A
Router_A(config)#router rip
Router_A(config-router)#version 2
Router_A(config-router)#network 10.0.0.0
Router_A(config-router)#no auto-summary
●Router_B
Router_B(config)#router rip
Router_B(config-router)#version 2
Router_B(config-rouiter)#redistribute ospf 1 metric 10
Router_B(config-router)#network 10.0.0.0
Router_B(config-router)#no auto-summary
Router_B(config)#router ospf 1
Router_B(config-router)#redistribute rip metric 100 subnets
Router_B(config-router)#network 20.0.0.0 0.255.255.255 area 0
●Router_C
Router_C(config)#router ospf 1
Router_C(config-router)#version 2
Router_C(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router_C(config-router)#network 172.16.0.0 0.0.255.255 area 0
Router_C(config-router)#network 192.168.1.0 0.0.0.63 area 0
Router_C(config-router)#network 192.168.1.64 0.0.0.63 area 0
Router_C(config-router)#network 192.168.1.128 0.0.0.31 area 0
Router_C(config-router)#network 192.168.1.160 0.0.0.31 area 0
●Router_Aの設定
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router_A
!
boot-start-marker
boot-end-marker
!
enable password cisco
!
no aaa new-model
ip subnet-zero
!
ip cef
!
interface FastEthernet0
no ip address
shutdown
speed auto
!
interface Serial0
ip address 10.0.0.1 255.0.0.0
clockrate 64000
no fair-queue
!
router rip
version 2
network 10.0.0.0
no auto-summary
!
ip classless
no ip http server
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
●Router_Bの設定
!
version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_B
!
enable password cisco
!
memory-size iomem 25
ip subnet-zero
!
interface Serial0
ip address 10.0.0.2 255.0.0.0
no fair-queue
!
interface Serial1
ip address 20.0.0.1 255.0.0.0
clockrate 64000
!
interface FastEthernet0
no ip address
shutdown
speed auto
!
router ospf 1
redistribute rip metric 100 subnets
network 20.0.0.0 0.255.255.255 area 0
!
router rip
version 2
redistribute ospf 1 metric 10
network 10.0.0.0
no auto-summary
!
ip classless
no ip http server
!
line con 0
exec-timeout 0 0
transport input none
line aux 0
line vty 0 4
password cisco
login
!
no scheduler allocate
end
●Router_Cの設定
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router_C
!
enable password cisco
!
memory-size iomem 25
ip subnet-zero
!
interface Loopback0
ip address 192.168.1.1 255.255.255.192
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.1.65 255.255.255.192
ip ospf network point-to-point
!
interface Loopback2
ip address 192.168.1.129 255.255.255.224
ip ospf network point-to-point
!
interface Loopback3
ip address 192.168.1.161 255.255.255.224
ip ospf network point-to-point
!
interface Loopback4
ip address 172.16.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Loopback5
ip address 172.16.2.1 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0
no ip address
shutdown
speed auto
!
interface Serial0
ip address 20.0.0.2 255.0.0.0
no fair-queue
!
interface Serial1
no ip address
shutdown
!
interface Serial2
no ip address
shutdown
!
router ospf 1
log-adjacency-changes
network 20.0.0.0 0.255.255.255 area 0
network 172.16.0.0 0.0.255.255 area 0
network 192.168.1.0 0.0.0.63 area 0
network 192.168.1.64 0.0.0.63 area 0
network 192.168.1.128 0.0.0.31 area 0
network 192.168.1.160 0.0.0.31 area 0
!
ip classless
no ip http server
!
line con 0
line aux 0
line vty 0 4
password cisco
login
!
end
Router_Aのルーティングテーブルを表示します。
●Router_Aのルーティングテーブル
Gateway of last resort is not set
R 20.0.0.0/8 [120/10] via 10.0.0.2, 00:00:14, Serial0
172.16.0.0/24 is subnetted, 2 subnets
R 172.16.1.0 [120/10] via 10.0.0.2, 00:00:14, Serial0
R 172.16.2.0 [120/10] via 10.0.0.2, 00:00:14, Serial0
C 10.0.0.0/8 is directly connected, Serial0
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
R 192.168.1.64/26 [120/10] via 10.0.0.2, 00:00:14, Serial0
R 192.168.1.0/26 [120/10] via 10.0.0.2, 00:00:14, Serial0
R 192.168.1.160/27 [120/10] via 10.0.0.2, 00:00:15, Serial0
R 192.168.1.128/27 [120/10] via 10.0.0.2, 00:00:15, Serial0
全てのルートが表示されています。
フィルタの作成と適用
Router_Bで、OSPFからRIPv2へ再配送する時に、標準アクセスリスト(ディストリビュートリスト)で送信するルートを192.168.1.0/26、192.168.1.64/26、192.168.1.128/27、192.168.1.160/27のルートだけにします。

●フィルタの作成
Router_Bで標準アクセスリストを使ってフィルタを作成します。
Router_B(config)#access-list 1 permit 192.168.1.0 0.0.0.255
4つのルートは、先頭の「192.168.1.」が共通です。ワイルドカードマスクを「0.0.0.255」と指定すると4つのルートを許可するようになります。
●フィルタの配置
Router_BでOSPFからRIPへ再配送する時に、上で作成したフィルタの配置を適用します。
Router_B(config)#router rip
Router_B(config-router)#distribute-list 1 out ospf 1
Router_Bから再配送される経路情報は、192.168.1.0/26、192.168.1.64/26、192.168.1.128/27、192.168.1.160/27の4つのルートになります。
Router_Aのルーティングテーブルを表示してみます。
●Router_Aのルーティングテーブル
Gateway of last resort is not set
C 10.0.0.0/8 is directly connected, Serial0
192.168.1.0/24 is variably subnetted, 4 subnets, 2 masks
R 192.168.1.64/26 [120/10] via 10.0.0.2, 00:00:02, Serial0
R 192.168.1.0/26 [120/10] via 10.0.0.2, 00:00:02, Serial0
R 192.168.1.160/27 [120/10] via 10.0.0.2, 00:00:02, Serial0
R 192.168.1.128/27 [120/10] via 10.0.0.2, 00:00:02, Serial0
R 172.16.1.0 [120/10] via 10.0.0.2, 00:00:14, Serial0
R 172.16.2.0 [120/10] via 10.0.0.2, 00:00:14, Serial0
のルートを受信しなくなりました。これは、Router_B側でルート情報の再送信時に、「172.16.1.0」「172.16.2.0」のルートがフィルタされたからです。
次は、ルートの再配送時にルートマップを使ってルートフィルタを検証してみます。ルートマップでは、再配送時にルートのフィルタだけでなく、ルートごとにシードメトリックを設定してメトリックを調整することができます。
続きは、「ルートフィルタ設定(ルートマップ)」で紹介します。
