等價路由在路由器和CE交換機上默認的行為是不同的,路由器總是走第一個下一跳,CE交換機是逐包。


 

結論:

1、在eNSP中實驗,路由器和CE交換機對於等價路由的默認轉發行為是不同的,

     路由器:默認是基於流的轉發形態,更准確的來講,ping兩個不同的下一跳,都是走等價路由的第一個路由,不走第二條路由。

    CE交換機:默認就是逐包轉發,即使ping同一個目的ip, 流量也會在不同的下一跳上進行負載分擔。

 

2、實驗圖如下:

 

     

 

3. 配置說明

   R1 上配置默認路由,下一跳是兩個,形成等價路由。   

<Huawei>dis curr | inc ip route
ip route-static 0.0.0.0 0.0.0.0 20.0.0.2
ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
<Huawei>

 

   CE交換機上也是相同配置,下一跳是兩個,形成等價路由。

<HUAWEI>dis curr | inc ip route
ip route-static 0.0.0.0 0.0.0.0 10.0.0.1
ip route-static 0.0.0.0 0.0.0.0 20.0.0.1
<HUAWEI>

 

4. 實驗內容

(1)實驗路由器默認情況下的等價路由。

         步驟一、從PC1 ping PC3

         

 

         步驟二、查看路由器的GE0/0/1, GE0/0/2的端口統計信息,如下,

                      可以看出,流量只會從GE 0/0/1發送,GE0/0/2沒有發送流量。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:29:04-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 296 bytes, 4 packets
Output: 740 bytes, 10 packets
Input:
Unicast: 4 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 10 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:29:07-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 0 bytes, 0 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>

 

步驟三、從PC1 ping PC4, 目的是測試不同的流(PC4的ip和PC3的ip不同),會不會進行負載分擔。

清楚R上的統計信息后,再ping.

 

         

                步驟四、查看路由器的GE0/0/1, GE0/0/2的端口統計信息,如下,

                      可以看出,流量只會從GE 0/0/1發送,GE0/0/2沒有發送流量。也就是說,即使是不同的流,也不會進行負載分擔。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:33:39-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 740 bytes, 10 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 10 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:33:42-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 0 bytes, 0 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

              <Huawei>

 

 (2)實驗路由器的逐包轉發功能。

          路由器的逐包轉發功能,需要配置命令行:

          

 

          步驟一、從PC1 ping PC3

           

        步驟二、查看路由器的GE0/0/1, GE0/0/2的端口統計信息,如下,

                      可以看出是每個下一跳端口上都有轉發流量,實現的是負載分擔模式。

<Huawei>dis interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:37 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 10.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5754
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:20:52-08:00
Hardware address is 5489-9806-5754
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 370 bytes, 5 packets
Output: 370 bytes, 5 packets
Input:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>
<Huawei>dis interface GigabitEthernet 0/0/2
GigabitEthernet0/0/2 current state : UP
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:48:49 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is 20.0.0.1/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 5489-9806-5755
Last physical up time : 2018-01-14 18:47:29 UTC-08:00
Last physical down time : 2018-01-14 18:46:51 UTC-08:00
Current system time: 2018-01-14 19:20:55-08:00
Hardware address is 5489-9806-5755
Last 300 seconds input rate 0 bytes/sec, 0 packets/sec
Last 300 seconds output rate 0 bytes/sec, 0 packets/sec
Input: 296 bytes, 4 packets
Output: 370 bytes, 5 packets
Input:
Unicast: 4 packets, Multicast: 0 packets
Broadcast: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%

<Huawei>

 

其實,從上面的GE0/0/2能夠接收到報文的結果看,已經證明CE交換機總是在逐包進行負載分擔。下面再從實驗上驗證。

            (3)驗證交換機的默認轉發

             步驟一、從PC3 ping PC1.  ping 10個包

             

 

             步驟二、查看CE交換機上的GE 1/0/1, GE1/0/2的統計信息,如下,

                         可以看出,即使目的ip相同,交換機也會進行逐包的轉發行為。

              

<HUAWEI>dis interface GE 1/0/1
GE1/0/1 current state : UP (ifindex: 3)
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:50:25
Description:
Route Port,The Maximum Transmit Unit is 1500,The Maximum Frame Length is 9216
Internet Address is 10.0.0.2/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0400-0611-0101
Last physical up time : 2018-01-14 18:50:25
Last physical down time : 2018-01-14 18:46:59
Current system time: 2018-01-14 19:39:46
Statistics last cleared:2018-01-14 19:38:38
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input peak rate 0 bits/sec, Record time: -
Output peak rate 0 bits/sec, Record time: -
Input: 0 bytes, 9 packets
Output: 0 bytes, 5 packets
Input:
Unicast: 9 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
CRC: 0 packets, Symbol: 0 packets
Overrun: 0 packets, InRangeLength: 0 packets
LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets
Fragment: 0 packets, Undersized Frame: 0 packets
RxPause: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets
System: 0 packets, Overruns: 0 packets
TxPause: 0 packets
Last 300 seconds input utility rate: 0.00%
Last 300 seconds output utility rate: 0.00%

<HUAWEI>
<HUAWEI>dis interface GE 1/0/2
GE1/0/2 current state : UP (ifindex: 4)
Line protocol current state : UP
Last line protocol up time : 2018-01-14 18:50:25
Description:
Route Port,The Maximum Transmit Unit is 1500,The Maximum Frame Length is 9216
Internet Address is 20.0.0.2/24
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 0400-0611-0102
Last physical up time : 2018-01-14 18:50:25
Last physical down time : 2018-01-14 18:46:59
Current system time: 2018-01-14 19:39:53
Statistics last cleared:2018-01-14 19:38:38
Last 300 seconds input rate: 0 bits/sec, 0 packets/sec
Last 300 seconds output rate: 0 bits/sec, 0 packets/sec
Input peak rate 0 bits/sec, Record time: -
Output peak rate 0 bits/sec, Record time: -
Input: 0 bytes, 0 packets
Output: 0 bytes, 5 packets
Input:
Unicast: 0 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
CRC: 0 packets, Symbol: 0 packets
Overrun: 0 packets, InRangeLength: 0 packets
LongPacket: 0 packets, Jabber: 0 packets, Alignment: 0 packets
Fragment: 0 packets, Undersized Frame: 0 packets
RxPause: 0 packets
Output:
Unicast: 5 packets, Multicast: 0 packets
Broadcast: 0 packets, JumboOctets: 0 packets
Lost: 0 packets, Overflow: 0 packets, Underrun: 0 packets
System: 0 packets, Overruns: 0 packets
TxPause: 0 packets
Last 300 seconds input utility rate: 0.00%
Last 300 seconds output utility rate: 0.00%

<HUAWEI>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM