IS-IS:09 ISIS路由过滤

在IS-IS 网络中,有时需要使用 filter-policy 工具对 IS-IS 路由进行过滤。这里所说的过滤,是指路由器在将自己IS-IS 路由表中的某些 IS-IS 路由纳入进自己的 IP 路由表的过程,一些满足了过滤条件的 IS-IS 路由将被限制纳入 IP 路由表中。

需要注意的是, filter-policy 进行过滤的并非是生成那些 IS-IS 路由的 LSP ,所以 filter-policy 进行路由过滤之后,路由器中的 IS-IS 链路状态数据库和 IS-IS 路由表都不会受到任何影响。

实验拓扑,所有路由器均为 level-2路由器

基本配置:

复制代码
R1:
sys
sysname R1
int loop 0
ip add 1.1.1.1 24
int g0/0/0
ip add 192.168.12.1 24
int g0/0/1
ip add 192.168.14.1 24
q

R2:
sys
sysname R2
int loop 0
ip add 2.2.2.2 24
int g0/0/0
ip add 192.168.12.2 24
int g0/0/1
ip add 192.168.23.2 24
q

R3:
sys
sysname R3
int loop 1
ip add 172.16.1.1 24
int loop 2
ip add 172.16.2.1 24
int g0/0/1
ip add 192.168.23.3 24
int g0/0/2
ip add 192.168.34.3 24
q

R4:
sys
sysname R4
int loop 0
ip add 4.4.4.4 24
int g0/0/1
ip add 192.168.14.4 24
int g0/0/2
ip add 192.168.34.4 24
q

配置IS-IS 协议,所有路由器均为 Level-2路由器:

复制代码
R1:
isis
network-entity 10.0000.0000.0001.00
is-name R1
is-level level-2
int loo 0
isis enable
int g0/0/0
isis enable
int g0/0/1
isis enable
q

R2:
isis
network-entity 10.0000.0000.0002.00
is-name R2
is-level level-2
int loo 0
isis enable
int g0/0/0
isis enable
int g0/0/1
isis enable
q

R3:
isis
network-entity 20.0000.0000.0003.00
is-name R3
is-level level-2
int loo 1
isis enable
int loo 2
isis enable
int g0/0/1
isis enable
int g0/0/2
isis enable
q

R4:
isis
network-entity 10.0000.0000.0004.00
is-name R4
is-level level-2
int loo 0
isis enable
int g0/0/1
isis enable
int g0/0/2
isis enable
q

配置完成后,查看邻居的建立,路由表学习也正常

使用 filter-policy实现路由过滤:

R1 只能经R2 访问 R3 的loopback 1

R1 只能经R4 访问 R3 的loopback 2

在R2 上过滤掉R3的loopback 2

复制代码
R2:
acl 2000
rule deny source 172.16.2.0 0.0.0.255
rule permit source any

isis
filter-policy 2000 import

172.16.2.0 已经没有了,只有1.0

但在IS-IS 路由表中,还是有的

过滤掉的路由条目不能进入IP 路由表,但并不会对生成这些路由的LSP进行过滤。

在R4 上过滤掉R3的loopback 1

复制代码
R4:
acl 2000
rule deny source 172.16.1.0 0.0.0.255
rule permit source any

isis
filter-policy 2000 import

查看一下,R4 的路由表中,已经没有 172.16.1.0 的路由

配合使用filter-policy 和 route-policy:

在R1 上查看路由表,还是有两个下一跳的,在R2 R4上的过滤,对R1不起作用,这两条路由的LSP还继续泛洪。

在R1上进行路由过滤时,不能只考虑路由的前缀,同时还要考虑到路由的下一跳。

R1 :

定义ACL 2012匹配路由下一跳 192.168.12.2

定义ACL 2014匹配路由下一跳 192.168.14.4

定义ACL 2001匹配路由前缀 172.16.1.0/24

定义ACL 2002匹配路由前缀 172.16.2.0/24

复制代码
R1:
acl 2001
rule permit source 172.16.1.0 0.0.0.255
acl 2002
rule permit source 172.16.2.0 0.0.0.255
acl 2012
rule permit source 192.168.12.2 0
acl 2014
rule permit source 192.168.14.4 0

route-policy 10 deny node 1
if-match ip next-hop acl 2012
if-match acl 2002

route-policy 10 deny node 2
if-match ip next-hop acl 2014
if-match acl 2001

route-policy 10 permit node 3

isis
filter-policy route-policy 10 import

也可以 permit 放行

复制代码
R1:
route-policy 10 permit node 1
if-match ip next-hop acl 2012
if-match acl 2001

route-policy 10 permit node 2
if-match ip next-hop acl 2014
if-match acl 2002

配置完成后,查看 R1 的路由表

相关推荐
木木em哈哈1 小时前
记一次在线编辑器的探索
linux·服务器·网络
一个有温度的技术博主1 小时前
网安实验系列一:Burp Suite探测敏感信息路径
网络·安全
我要成为嵌入式大佬1 小时前
正点原子MP157--问题详解--二(NFS挂载根文件系统双网卡设置)
linux·服务器·网络
lifejump2 小时前
双冗余链路实现(2/2期)
网络
F1FJJ3 小时前
Shield CLI PostgreSQL 插件现已上架 VS Code 扩展市场
网络·vscode·网络协议·postgresql·开源软件
123过去4 小时前
responder使用教程
linux·网络·测试工具·安全·哈希算法
不知名。。。。。。。。4 小时前
数据链路层
linux·网络
liulilittle4 小时前
OPENPPP2 sysnat loader implement / C/C++
服务器·c语言·开发语言·网络·c++·tcp/ip
lpfasd1234 小时前
OpenRouter低延迟使用中国Token算力
网络·token
CQU_JIAKE5 小时前
3.23【A】
linux·服务器·网络