Advertisement

HCIE之路-路由策略与策略路由(2)

阅读量:

实验内容:

1、R1 R2 R4 R6正常启用ISIS协议建立邻居关系,所有路由器类型都为level2,R4的loopback口宣告进ISIS进程中,
R6的不用宣告。R5上引入直连,在R2上做双向引入,即OSPF引入到ISIS中,ISIS再引入到OSPF中;
2、在R5上把10.1.0.0/24至10.1.5.0/24六条路由引入OSPF中,其余的不需要引入(用router-policy+ACL实现)
3、在R6上把192.168.0.0/24至192.168.3.0/24四条路由引入ISIS中,其余的不用引入(用router-policy+ip-prefix实现)
4、在R2上把OSPF的路由引入到ISIS中,只引入10.1.0.0/24至10.1.5.0/24六条路由(用filter-policy+ip-prefix实现)
5、在R2上把ISIS的路由引入到OSPF中,只引入192.168.0.0/24至192.168.1.0/24两条+10.4.4.4/32这三条路由(用
filter-policy+ACL实现)
6、在R1的OSPF中上把10.1.0.0/24至10.1.3.0/24的路由优先级改为13,把10.1.4.0和5.0两条路由优先级改为8

7、基于现有固定的路由配置,在不修改默认设置的情况下,在此前提下实现如下:将使R4上的loopback接口连接到目标设备,并使其按照经过该线路(即从路由器的角度出发)依次经过Router1、Router3再到Router5进行数据转发操作;该过程中的往返通信路径无需严格对称。
8、同样地,在此前提下实现如下:将使Router6上的loopback接口连接到目标设备,并使其按照经过 Router6、Router4、Router1、Router3再到Router5这条路线进行数据转发;该过程中的往返通信路径无需严格对称。

配置ospf 与isis 接口ip地址自行规划(除图中标出地址)。

在R5ospf中引入直连路由

复制代码
    import-route direct

在R2ospf中引入isis路由,在isis中引入ospf路由条目。

复制代码
 ospf

    
 import-route isis
    
 isis
    
 import-route ospf

在R5上配置六个默认网关地址(10.1.0.0/24至10.1.5.0/24)进入OSPF网络中,并对不需将其他默认网关地址加入OSPF配置列表的方式进行处理(采用router-policy结合ACL的技术方案)

复制代码
 R5:

    
 acl 2000
    
 rule 5 permit source 10.1.0.0 0.0.3.0 
    
  rule 10 permit source 10.1.4.0 0.0.1.0
    
 q
    
 route-policy xiao permit node 10 
    
  if-match acl 2000 
    
 1
    
 ospf 1
    
 import-route direct route-policy xiao

3、将范围内的四组静态IP地址配置为isis routes部署于R6上,并对其他无需配置。

复制代码
 R6:

    
 ip ip-prefix 6_l permit 192.168.0.0 22 greater-equal 24 less-equal 24
    
 q
    
 route-policy xiao permit node 10
    
 if-match ip-prefix 6_l
    
 q
    
 isis
    
 import-route direct route-policy xiao 

4、将在R2上将OSPF网络中的路由引入到ISIS域中,并且仅限于10.1.0.0/24至10.1.5.0/24这六条路由(采用filter-policy+ip-prefix策略进行配置)

复制代码
 R2:

    
 ip ip-prefix 5_l permit 10.1.0.0 22 greater-equal 24 less-equal 24
    
 ip ip-prefix 5_l permit 10.1.4.0 23 greater-equal 24 less-equal 24
    
 isis
    
 filter-policy ip-prefix 5_l export

在R2网络中将ISIS协议的路由导入OSPF协议网络中。
通过配置路径限制、流量控制以及访问控制列表(ACL)来实现仅允许指定范围内的 ISIS 路由被引入OSPF网络中。
具体包括:

  • 从IP地址范围192\.168\.0\.0/24192\.168\.1\.0/24导入两条路由
  • 同时导入IP地址范围10\.4\.4\.4/32的第三条路由

这种做法能够有效避免潜在的安全风险并确保网络性能得到优化

复制代码
 R2:

    
 rule permit source 192.168.0.0 0.0.1.0
    
 rule permit source 10.4.4.4 0
    
 ospf
    
 filter-policy 2000 export

6、在R1的OSPF中上把10.1.0.0/24至10.1.3.0/24的路由优先级改为13,把10.1.4.0和5.0两条路由优先级改为8

复制代码
 R1:

    
 ip ip-prefix 0-3 permit 10.1.0.0 22 greater-equal 24 less-equal 24
    
 ip ip-prefix 4-5 permit 10.1.4.0 23 greater-equal 24 less-equal 24
    
 route-policy set-pre permit node 10
    
 if-match ip-prefix  0-3
    
 apply preference 13 
    
 q
    
 route-policy set-pre permit node 20
    
 if-match ip-prefix  4-5
    
 apply preference 8
    
 q
    
 ospf 
    
 preference ase route-policy set-pre

验证

在不修改路由表的情况下,
使R4的loopback接口连接到R5,
并确保其访问10.1.0.5时经过
R4-R1-R3-R5这条线路(往返路径无需保持一致性)。

复制代码
 R4:

    
 acl number 3000  
    
  rule 5 permit ip source 10.4.4.4 0 destination 10.1.0.5 0 
    
 q
    
 policy-based-route 4-5 permit node 10
    
  if-match acl 3000
    
  apply ip-address next-hop 10.1.14.1 
    
 q
    
 ip local policy-based-route 4-5

在不修改路由表的情况下, 使R6的loopback0连接到设备R5, 使其通过指定路径与该设备通信, 即R6-R4-R1-R3-R5这一通路(往返通信路径无需一致)。

复制代码
 R4:

    
 acl number 3001  
    
  rule 5 permit ip source 192.168.0.6 0 destination 10.1.0.5 0 
    
 traffic classifier 6-5 operator or
    
  if-match acl 3001
    
 traffic behavior 6-5
    
  redirect ip-nexthop 10.1.14.1
    
 traffic policy 6-5
    
  classifier 6-5 behavior 6-5

网络交流群

全部评论 (0)

还没有任何评论哟~