BGP-17 配置BGP負載均衡

    首先,在JUNOS裏面,默認負載均衡方式是基於流的負載均衡,同一源IP地址,同一目標IP地址的一組數據被稱爲一個流,當網絡中有兩條等價的路徑時,基於流的負載均衡規定,同一條流的流量只會在一條鏈路上被傳輸。所以,咱們須要將默認基於流的負載均衡,強制指定爲基於包的負載均衡。
網絡

   先看一下配置命令:負載均衡

  負載均衡命令.png


拓撲:ide

拓撲.png

   1.配置BGP。ui

r1 一條路徑.png

r2 bgp.png

r3 bgp.png

2.檢查路徑。this

2.1查看路由:spa

r1 路由1.png

能夠看到R1優選了下一跳10.0.1.1。3d

2.2查看轉發表:orm

r1 轉發表1.png

3.配置基於包的負載均衡。blog

r1 負載均衡.png


4.查看路徑。ci

4.1路由:

R1 負載均衡 路由.png

r1 detail.png

4.2查看轉發表:

r1 zhuanfabiao.png

能夠明確地看到在轉發表裏面的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作,檢查到轉發表的時候:

    r1 轉發表1.png

    發現沒有負載均衡,我檢查了下配置和路由表都沒有問題。因此上述的路由器均採用SRX340。

相關文章
相關標籤/搜索