1.基本概念
过滤策略,一种路由过滤器。
2.基本配置
1)Filter-Policy过滤RIP发出的路由
![图片[1]-6.3 Filter-Policy-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片8-10-1024x297.png)
(1)基本配置
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]undo summary
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 192.168.2.0
[R1-rip-1]network 192.168.3.0
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]undo summary
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 23.0.0.0
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]undo summary
[R3-rip-1]network 3.0.0.0
[R3-rip-1]network 23.0.0.0
(2)在R2配置过滤192.168.1.0策略
[R2]acl 2000
[R2-acl-basic-2000]rule deny source 192.168.1.0 0.0.0.0
[R2-acl-basic-2000]rule permit
[R2-acl-basic-2000]quit
[R2]rip 1
[R2-rip-1]filter-policy 2000 export GigabitEthernet 0/0/1
Filter-Policy过滤RIP接收的路由
[R2-rip-1]filter-policy 2000 import GigabitEthernet 0/0/0
(3)查看R2路由表
[R2]display ip routing-table protocol rip
Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 RIP 100 1 D 23.1.1.3 GigabitEthernet0/0/1
192.168.1.0/24 RIP 100 1 D 12.1.1.1 GigabitEthernet0/0/0
192.168.2.0/24 RIP 100 1 D 12.1.1.1 GigabitEthernet0/0/0
192.168.3.0/24 RIP 100 1 D 12.1.1.1 GigabitEthernet0/0/0
(4)查看R3路由表(过滤了192.168.1.0/24网段)
[R3]display ip routing-table protocol rip
Destination/Mask Proto Pre Cost Flags NextHop Interface
12.0.0.0/8 RIP 100 1 D 23.1.1.2 GigabitEthernet0/0/1
192.168.2.0/24 RIP 100 2 D 23.1.1.2 GigabitEthernet0/0/1
192.168.3.0/24 RIP 100 2 D 23.1.1.2 GigabitEthernet0/0/1
2)Filter-Policy过滤OSPF发出的路由
![图片[2]-6.3 Filter-Policy-大赛人网](https://www.dsrw.com/wp-content/uploads/2023/03/图片9-9-1024x301.png)
(1)基本配置
[R1]ospf 1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.255.255.255
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.255.255.255
(2)在R1配置过滤路由
[R1]acl 2000
[R1-acl-basic-2000]rule deny source 192.168.1.0 0.0.0.0
[R1-acl-basic-2000]rule permit
[R1]ospf 1
[R1-ospf-1]import-route direct
[R1-ospf-1]filter-policy 2000 export
(3)查看R2路由表
[R2]display ip routing-table protocol ospf
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 O_ASE 150 1 D 12.1.1.1 GigabitEthernet0/0/0
3.3.3.3/32 OSPF 10 1 D 23.1.1.3 GigabitEthernet0/0/1
192.168.2.0/24 O_ASE 150 1 D 12.1.1.1 GigabitEthernet0
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
请登录后查看评论内容