如何在IOS XR中限制重新分配到ISIS的路由?

网络工程 cisco-ios-xr 路由过滤器
2021-08-02 00:20:25

我有一个路由器Cisco IOS XR,它与邻居路由器建立了 L2 ISIS 邻接关系。我只想将环回接口上配置的 IPv4 地址注入 ISIS。配置的 IPv4 地址的路由Loopback0如下所示:

RP/0/RP0/CPU0:PE2#sh route 172.16.0.22/32
Sun Apr 18 20:13:11.393 UTC

Routing entry for 172.16.0.22/32
  Known via "local", distance 0, metric 0 (connected)
  Installed Apr 18 20:06:41.281 for 00:06:30
  Routing Descriptor Blocks
    directly connected, via Loopback0
      Route metric is 0
  Redist Advertisers:
    4 (protoid=4, clientid=21)

RP/0/RP0/CPU0:PE2#`

起初我尝试使用route-policy以下方法:

RP/0/RP0/CPU0:PE2#sh run route-policy allow-lo 
Sun Apr 18 20:15:02.546 UTC
route-policy allow-lo
  if destination in (172.16.0.22/32) then
    done
  else
    drop
  endif
end-policy
!

RP/0/RP0/CPU0:PE2#

此路由策略是在 ISIS 配置下配置的:

RP/0/RP0/CPU0:PE2#sh run router isis 
Sun Apr 18 20:15:50.689 UTC
router isis lab
 is-type level-2-only
 net 49.0000.1720.1600.0022.00
 address-family ipv4 unicast
  redistribute connected route-policy allow-lo
 !
/* output removed for brevity */

由于这似乎没有影响,然后我172.16.0.22/32用标签标记了路线10并尝试使用以下策略:

RP/0/RP0/CPU0:PE2#sh run route-policy allow-lo 
Sun Apr 18 20:19:39.017 UTC
route-policy allow-lo
  if tag eq 10 then
    done
  else
    drop
  endif
end-policy
!

RP/0/RP0/CPU0:PE2#

同样,这没有影响。根据Cisco 文档 destinationtag似乎是两个合理的属性,带有redistribution用于过滤路由的附加点。

如何在IOS XR中限制重新分配到ISIS的路由?

1个回答

作为一种解决方法,我将Lo0接口配置为被动接口,并仅将被动接口通告到 ISIS 中:

RP/0/RP0/CPU0:PE2#sh run router isis lab
Mon Apr 19 11:01:50.732 UTC
router isis lab
 is-type level-2-only
 net 49.0000.1720.1600.0022.00
 address-family ipv4 unicast
  advertise passive-only
 !
 interface Loopback0
  passive
  address-family ipv4 unicast
  !
 !
  /* output removed for brevity */
RP/0/RP0/CPU0:PE2#