filter&distribute-list


v4 filter-list

before

iosv-2#sh ip ro | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.12.1, 00:10:52, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 00:59:34, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O E2     4.4.4.4 [110/20] via 192.168.12.1, 00:09:13, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
O E2     5.5.5.5 [110/20] via 192.168.12.1, 00:09:13, GigabitEthernet0/0
      10.0.0.0/32 is subnetted, 1 subnets
O IA     10.10.10.10 [110/3] via 192.168.12.1, 00:00:02, GigabitEthernet0/0
O IA  192.168.10.0/24 [110/2] via 192.168.12.1, 00:10:52, GigabitEthernet0/0
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/0
L        192.168.12.2/32 is directly connected, GigabitEthernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/1
L        192.168.23.2/32 is directly connected, GigabitEthernet0/1
O E2  192.168.40.0/24 [110/20] via 192.168.12.1, 00:09:13, GigabitEthernet0/0
O E2  192.168.45.0/24 [110/20] via 192.168.12.1, 00:09:13, GigabitEthernet0/0

after(filter-list out)

[設定]
iosv-1(config-router)#do sh run | s ospf|prefix
 ip ospf 1 area 0
 ip ospf 1 area 1
 ip ospf 1 area 0
router ospf 1
 area 1 filter-list prefix PRE out
ip prefix-list PRE seq 5 deny 10.10.10.10/32
ip prefix-list PRE seq 10 permit 0.0.0.0/0 le 32

[結果]
iosv-2#sh ip ro | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.12.1, 00:08:55, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 00:57:37, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O E2     4.4.4.4 [110/20] via 192.168.12.1, 00:07:16, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
O E2     5.5.5.5 [110/20] via 192.168.12.1, 00:07:16, GigabitEthernet0/0
O IA  192.168.10.0/24 [110/2] via 192.168.12.1, 00:08:55, GigabitEthernet0/0
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/0
L        192.168.12.2/32 is directly connected, GigabitEthernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/1
L        192.168.23.2/32 is directly connected, GigabitEthernet0/1
O E2  192.168.40.0/24 [110/20] via 192.168.12.1, 00:07:16, GigabitEthernet0/0
O E2  192.168.45.0/24 [110/20] via 192.168.12.1, 00:07:16, GigabitEthernet0/0

10.10.10.10/32が消滅

after(filter-list in)

[設定]
iosv-1(config-router)#do sh run | s ospf|prefix
 ip ospf 1 area 0
 ip ospf 1 area 1
 ip ospf 1 area 0
router ospf 1
 area 0 filter-list prefix PRE in
ip prefix-list PRE seq 5 deny 10.10.10.10/32
ip prefix-list PRE seq 10 permit 0.0.0.0/0 le 32

[結果]
iosv-2#sh ip ro | b Gate
Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.12.1, 00:11:34, GigabitEthernet0/0
      2.0.0.0/32 is subnetted, 1 subnets
C        2.2.2.2 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 01:00:16, GigabitEthernet0/1
      4.0.0.0/32 is subnetted, 1 subnets
O E2     4.4.4.4 [110/20] via 192.168.12.1, 00:09:55, GigabitEthernet0/0
      5.0.0.0/32 is subnetted, 1 subnets
O E2     5.5.5.5 [110/20] via 192.168.12.1, 00:09:55, GigabitEthernet0/0
O IA  192.168.10.0/24 [110/2] via 192.168.12.1, 00:11:34, GigabitEthernet0/0
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/0
L        192.168.12.2/32 is directly connected, GigabitEthernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/1
L        192.168.23.2/32 is directly connected, GigabitEthernet0/1
O E2  192.168.40.0/24 [110/20] via 192.168.12.1, 00:09:55, GigabitEthernet0/0
O E2  192.168.45.0/24 [110/20] via 192.168.12.1, 00:09:55, GigabitEthernet0/0

outと同様。

tag制御

after(タグ付与)

[設定]
iosv-5#sh run | s route-map|prefix|eigrp     
router eigrp 1
 distribute-list route-map TAG in 
 network 5.5.5.5 0.0.0.0
 network 192.168.45.0
 network 192.168.58.0
ip prefix-list PRE seq 5 permit 8.8.8.8/32
route-map TAG permit 10
 match ip address prefix-list PRE
 set tag 80
route-map TAG permit 20

[結果]
iosv-5#sh ip ro 8.8.8.8
Routing entry for 8.8.8.8/32
  Known via "eigrp 1", distance 90, metric 130816
  Tag 80, type internal
  Redistributing via eigrp 1
  Last update from 192.168.58.8 on GigabitEthernet0/1, 00:02:37 ago
  Routing Descriptor Blocks:
  * 192.168.58.8, from 192.168.58.8, 00:02:37 ago, via GigabitEthernet0/1
      Route metric is 130816, traffic share count is 1
      Total delay is 5010 microseconds, minimum bandwidth is 1000000 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1
      Route tag 80            <<<<タグが付いている

タグを付与。

after(タグでフィルタ)

[設定]
iosv-4#sh run | s route-map|eigrp
router eigrp 1
 distribute-list route-map TAG_MAP in 
 network 0.0.0.0
route-map TAG_MAP deny 10
 match tag 80
route-map TAG_MAP permit 20

[結果]
iosv-0#sh ip ro | b Gate
Gateway of last resort is not set

<略>
      5.0.0.0/32 is subnetted, 1 subnets
D        5.5.5.5 [90/131072] via 192.168.40.4, 00:00:08, GigabitEthernet0/1
      6.0.0.0/32 is subnetted, 1 subnets
O IA     6.6.6.6 [110/5] via 192.168.10.1, 00:11:15, GigabitEthernet0/0
      7.0.0.0/32 is subnetted, 1 subnets
O IA     7.7.7.7 [110/6] via 192.168.10.1, 00:11:15, GigabitEthernet0/0
      10.0.0.0/32 is subnetted, 1 subnets
C        10.10.10.10 is directly connected, Loopback0
      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
<略>

iosv-0#sh ip ro 8.8.8.8
% Network not in table

EIGRPでやったタグ付与とタグフィルタと全く同じ設定でOSPFに適用させるとうまくいかない。なんで?

因みに

iosv-4(config)#router eigrp 1
iosv-4(config-router)#distribute-list route-map TAG_MAP ?
  in   Filter incoming service updates
  out  Filter outgoing service updates

iosv-6(config)#router ospf 1
iosv-6(config-router)#distribute-list route-map TAG ?
  in  Filter incoming routing updates

EIGRPだとdistribute-listをoutに適用できるけどOSPFだと無理。これに関してはCMLのiosのバージョンの問題かもしれない。


この記事が気に入ったらサポートをしてみませんか?