华为路由器配置策略路由示例(策略路由、PBR)

华为路由器配置策略路由示例(策略路由、PBR)

组网需求
企业用户希望根据用户实际需求制定策略进行路由选择,使不同的数据流通过不同的链路进行发送,增强路由选择的灵活性和可控性,提高链路的利用效率和降低企业成本。为实现上述需求,可以使用策略路由。
如图所示,RouterA、RouterB和RouterC使用OSPF保证全网路由可达,并且在RouterA上察看路由表可以发现到10.0.0.0的下一跳为RouterC的GE1/0/0接口地址。
华为路由器配置策略路由示例(策略路由、BPR)(图1)
在RouterA的上应用策略路由,使从10.0.2.0/24到10.0.0.0/24的流量重定向到RouterB上。

操作步骤
配置RouterA
    #                                                                               
    acl number 3001    //定义ACL匹配目的源地址是10.0.2.0/24,目的地址是10.0.0.0/24    
     rule 5 permit ip source 10.0.2.0 0.0.0.255 destination 10.0.0.0 0.0.0.255     
    #                                                                               
    traffic classifier rdt operator or  //定义需要重定向的数据流分类
     if-match acl 3001                                                              
    #                                                                               
    traffic behavior rdt  //定义流行为为重定向到RouterB的GE1/0/0的接口地址
     redirect ip-nexthop 10.181.10.2                                                
    #                                                                               
    traffic policy rdt  //绑定流策略
     classifier rdt behavior rdt                                                    
    #                                                                               
    interface GigabitEthernet 1/0/0                                                  
     ip address 10.181.20.1 255.255.255.0    
    #                                                                               
    interface GigabitEthernet 2/0/0                                                         
     ip address 10.181.10.1 255.255.255.0
    #                                                                               
    interface GigabitEthernet 3/0/0                                                         
     ip address 10.0.2.1 255.255.255.0
     traffic-policy rdt inbound  //从10.0.2.0/24到10.0.0.0/24的流量重定向到RouterB上
    #                                                                               
    ospf 1     //配置OSPF路由协议                                                                          
     area 0.0.0.0                                                                   
      network 10.0.2.0 0.0.0.255                                                 
      network 10.181.20.0 0.0.0.255                                                 
      network 10.181.10.0 0.0.0.255   
    #                                                                               
    return

配置RouterB
    #                                                                               
    interface GigabitEthernet 1/0/0                                                         
     ip address 10.181.10.2 255.255.255.0   
    #                                                                               
    interface GigabitEthernet 2/0/0                                                         
     ip address 10.184.10.1 255.255.255.0   
    #                                                                               
    ospf 1    //配置OSPF路由协议                                                                        
     area 0.0.0.0                                                                   
      network 10.181.10.0 0.0.0.255                                                 
      network 10.184.10.0 0.0.0.255  
    #
    return

配置RouterC
    #                                                                               
    interface GigabitEthernet 1/0/0                                                  
     ip address 10.181.20.2 255.255.255.0  
    #                                                                               
    interface GigabitEthernet 2/0/0                                                         
     ip address 10.184.10.2 255.255.255.0   
    #                                                                               
    ospf 1        //配置OSPF路由协议                                                                  
     area 0.0.0.0                                                                   
      network 10.184.10.0 0.0.0.255                                                 
      network 10.181.20.0 0.0.0.255     
      network 10.0.0.0 0.0.0.255                                                 
    #
    return

验证配置结果
    # 在10.0.2.0/24网段的主机上执行tracert命令,检测从10.0.2.0/24到10.0.0.0/24的路径。发现从10.0.2.0/24到10.0.0.0/24的流量重定向到RouterB上。


PBR策略路由(列表、list、全)策略路由list、pbrlist
http://www.zh-cjh.com/wenzhangguilei/975.html
文章归类、所有文章列表、LISTLIST
http://www.zh-cjh.com/wangzhangonggao/2195.html

1、本站资源长期持续更新。
2、本资源基本为原创,部分来源其他付费资源平台或互联网收集,如有侵权请联系及时处理。
3、本站大部分文章的截图来源实验测试环境,请不要在生产环境中随意模仿,以免带来灾难性后果。

转载请保留出处:  www.zh-cjh.com珠海陈坚浩博客 » 华为路由器配置策略路由示例(策略路由、PBR)

作者: cjh


手机扫一扫,手机上查看此文章:

一切源于价值!

其他 模板文件不存在: ./template/plugins/comment/pc/index.htm

未雨绸缪、居安思危!

数据安全、有备无患!

注意操作、数据无价!

一切源于价值!