当前位置:首页 > 技术与方案 > 网络管理相关

配置转发表的参数对流量进行负载均衡

(2012-09-06 07:24:07)

缺省状态下,转发表中只安装路由表里的最佳路径
lab@juniper# run show route 6.6.6.6

inet.0: 19 destinations, 22 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

6.6.6.6/32         *[IS-IS/18] 00:03:33, metric 42
                      to 10.0.0.2 via fxp1.1
                    > to 10.0.1.2 via fxp1.2

[edit]
lab@juniper# run show route forwarding-table
5.5.5.5/32         user     0 10.0.1.2           ucst   490     7 fxp1.2 
6.6.6.6/32         user     0 10.0.1.2           ucst   490     7 fxp1.2 
10.0.0.0/30        intf     0                    rslv   459     1 fxp1.1 

现在进行配置将路由表里的所有路径都安装进转发表

lab@juniper# show routing-options
forwarding-table {
    export load-balance-route;
}

lab@juniper#show policy-options

policy-statement load-balance-route {
    then {
        load-balance per-packet;
    }
}
查看路由表,路由器选择10.0.1.2作为最佳路由
lab@juniper# run show route 6.6.6.6

inet.0: 19 destinations, 22 routes (19 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

6.6.6.6/32         *[IS-IS/18] 00:03:33, metric 42
                      to 10.0.0.2 via fxp1.1
                    > to 10.0.1.2 via fxp1.2

转发表里对其所有前缀安装了多条路径
(注:安装的条目和PFE有关,IP-ASIC最多安装8条等价路径,以每个包为单位进行负载均衡
IP-II-ASIC最多安装16条,以每个流为单位进行负载均衡)
lab@juniper# run show route forwarding-table
1.1.1.1/32         intf     0 1.1.1.1            locl   468     1
2.2.2.2/32         user     0                    ulst   489    11
                              10.0.0.2           ucst   497     2 fxp1.1 
                              10.0.1.2           ucst   490     2 fxp1.2 
3.3.3.3/32         user     0                    ulst   489    11
                              10.0.0.2           ucst   497     2 fxp1.1 
                              10.0.1.2           ucst   490     2 fxp1.2 
4.4.4.4/32         user     0                    ulst   489    11                
                              10.0.0.2           ucst   497     2 fxp1.1 
                              10.0.1.2           ucst   490     2 fxp1.2 
5.5.5.5/32         user     0                    ulst   489    11
                              10.0.0.2           ucst   497     2 fxp1.1 
                              10.0.1.2           ucst   490     2 fxp1.2 
6.6.6.6/32         user     0                    ulst   489    11
                              10.0.0.2           ucst   497     2 fxp1.1 
                              10.0.1.2           ucst   490     2 fxp1.2 
10.0.0.0/30        intf     0                    rslv   459     1 fxp1.1 

配置路由器,只对特定前缀的多条路径安装进转发表,6.0.0.0/8,4.0.0.0/8,2.0.0.0/8
[edit]
lab@juniper# show  policy-options policy-statement load-balance-route
from {
    route-filter 6.0.0.0/8 orlonger;
    route-filter 2.0.0.0/8 orlonger;
    route-filter 4.0.0.0/8 orlonger;
}
then {
    load-balance per-packet;
}
lab@juniper# show routing-options
forwarding-table {
    export load-balance-route;
}
观察转发表,只对其特定前缀安装了多条路径, 6.0.0.0/8,4.0.0.0/8,2.0.0.0/8
lab@juniper# run show route forwarding-table
1.1.1.1/32         intf     0 1.1.1.1            locl   468     1
2.2.2.2/32         user     0                    ulst   489     3
                              10.0.0.2           ucst   497     6 fxp1.1 
                              10.0.1.2           ucst   490     6 fxp1.2 
3.3.3.3/32         user     0 10.0.1.2           ucst   490     6 fxp1.2 
4.4.4.4/32         user     0                    ulst   489     3
                              10.0.0.2           ucst   497     6 fxp1.1 
                              10.0.1.2           ucst   490     6 fxp1.2 
5.5.5.5/32         user     0 10.0.1.2           ucst   490     6 fxp1.2 
6.6.6.6/32         user     0                    ulst   489     3                   
                              10.0.0.2           ucst   497     6 fxp1.1 
                              10.0.1.2           ucst   490     6 fxp1.2 
10.0.0.0/30        intf     0                    rslv   459     1 fxp1.1 
10.0.0.0/32        dest     0 10.0.0.0           recv   457     1 fxp1.1 

更多
关闭窗口 打印 
网站首页    -    联系我们    -   收藏本站    -    网站地图                                                               客户服务热线:0571-85023000
本网站所有网页信息已申请知识产权和著作权保护,版权归四海光纤公司所有,未经授权禁止任何人复制或镜像,违者必究。
公司主营:杭州光纤光缆视频会议系统,是专业的通信网络工程、视频会议系统建设专家

中华人民共和国备案号:浙ICP备10018243号