先看一下配置命令:
拓扑:
1.配置BGP。
2.检查路径。
2.1查看路由:
可以看到R1优选了下一跳10.0.1.1。
2.2查看转发表:
3.配置基于包的负载均衡。
4.查看路径。
4.1路由:
4.2查看转发表:
可以明确地看到在转发表里面的defalut.inet 目的地址10.0.2.0/30 的下一跳分别为10.0.1.1和10.0.0.2。
我对于BGP的理解有限,我的问题是为什么路由表里面 不是两条路径前面都带*,而是一条里面两个下一跳,路由的明细里面,10.0.0.2依旧是INACTIVE,而在10.0.1.1里面两个下一跳,并且10.0.1.1显示selected。
“数据包实际的转发是按照RE下发的转发表进行的”,转发表里面确实出现了两个下一跳。
文档里的显示的原文如下:
The show route detail command output designates one gateway as selected. This output is potentially confusing in the context of load balancing. The selected gateway is used for many purposes in addition to deciding which gateway to install into the kernel when Junos OS is not performing per-packet load-balancing. For instance, the ping mpls command uses the selected gateway when sending packets. Multicast protocols use the selected gateway in some cases to determine the upstream interface. Therefore, even when Junos OS is performing per-packet load-balancing by way of a forwarding-table policy, the selected gateway information is still required for other purposes. It is useful to display the selected gateway for troubleshooting purposes. Additionally, it is possible to use forwarding-table policy to override what is installed into the kernel (for example, by using the install-nexthop action). In this case, the next-hop gateway installed in the forwarding table might be a subset of the total gateways displayed in the show route command.
大概的意思就是:实际上负载均衡了,但是在路由表里面显示的话还是选择了一个gateway,用于其他用途。比如PING,比如kernel(kernel junos系统的内核),比如多播协议。
还有一个很有趣的问题,一开始我用VMX做,检查到转发表的时候:
发现没有负载均衡,我检查了下配置和路由表都没有问题。所以上述的路由器均采用SRX340。
原文地址:http://blog.51cto.com/13582804/2103904