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

2008-02-23 04:54:37来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

缺省状态下,转发表中只安装路由表里的最佳路径
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

对5.5.5.5进行traceroute,每次都使用相同的下一跳

lab@juniper> traceroute 5.5.5.5
traceroute to 5.5.5.5 (5.5.5.5), 30 hops max, 40 byte packets
1 10.0.1.2 (10.0.1.2) 0.457 ms 0.774 ms 0.224 ms
2 10.0.2.2 (10.0.2.2) 0.317 ms 0.360 ms 0.287 ms
3 10.0.3.2 (10.0.3.2) 0.398 ms 0.439 ms 0.383 ms
4 5.5.5.5 (5.5.5.5) 0.495 ms 0.533 ms 1.149 ms

lab@juniper> traceroute 5.5.5.5
traceroute to 5.5.5.5 (5.5.5.5), 30 hops max, 40 byte packets
1 10.0.1.2 (10.0.1.2) 0.431 ms 0.380 ms 0.225 ms
2 10.0.2.2 (10.0.2.2) 0.320 ms 0.367 ms 0.310 ms

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:用命令行在设备上查看机框序列号

下一篇:VPN技术分析讲座——路由和转发