一、简介

本章给出了静态路由和默认路由的配置实例,并在此基础上给出了浮动静态路由和负载均衡的配置实例。

二、静态路由及默认路由基本配置

2.1 静态路由

2.1.1 静态路由定义

用户或官网管理员手工配置的路由信息。

2.1.2 静态路由优点

配置简单,无需频繁交换各自的路由表

2.1.3 静态路由缺点

工作量大,且无法自动感知错误发生,不易排错

2.1.4 静态路由适用场景

比较适合小型的、简单的网络环境

2.2 默认路由

2.2.1 默认路由定义

默认路由是一种特殊的静态路由,当路由表中与数据包目的地址没有匹配的表项时,数据包将根据默认路由条目进行转发。

2.2.2 默认路由优点

在末梢网络中,默认路由可以大大简化路由器配置,减轻网络管理员的工作负担。

2.3 静态路由及默认路由基本配置实验

2.3.1 实验目的

1、掌握配置静态路由(指定接口)的方法 2、掌握配置静态路由(指定下一跳IP地址)的方法 3、掌握测试静态路由连通性的方法 4、掌握配置默认路由的方法 5、掌握测试默认路由的方法 6、掌握在简单网络中部署静态路由时的故障排除方法 7、掌握简单的网络优化方法 注意:为保证路由的正确性在MA(多路访问)网络环境中配置静态路由时应明确下一跳地址!!!

2.3.2 实验内容

在由3台路由器所组成的简单网络中,R1和R3各自连接着一台主机,现在要求能够实现PC-1和PC-2之间正常通信。本实验将通过配置基本的静态路由和默认路由来实现。

2.3.3 实验拓扑

静态路由及默认路由基本配置实验拓扑

2.3.4 实验编址

设备 接口 IP地址 子网掩码 默认网关
PC-1 E 0/0/1 192.168.10.10 255.255.255.0 192.168.10.254
R1(AR2220) G 0/0/0 192.168.10.254 255.255.255.0 N/A
R1(AR2220) S 4/0/0 10.0.12.1 255.255.255.0 N/A
R2(AR2220) S 4/0/0 10.0.12.2 255.255.255.0 N/A
R2(AR2220) S 4/0/1 10.0.23.2 255.255.255.0 N/A
R3(AR2220) S 4/0/1 10.0.23.3 255.255.255.0 N/A
R3(AR2220) G 0/0/0 192.168.20.254 255.255.255.0 N/A
PC-2 E 0/0/1 192.168.20.20 255.255.255.0 192.168.20.254

2.3.5 实验步骤

2.3.5.1 基本配置

根据实验编址表进行相应的基本IP地址配置,并使用Ping命令检测各直连链路的连通性。

2.3.5.2 实现PC-1与PC-2之间的通信

1、分别在R1、R2上配置目的网段为主机PC-2所在网段的静态路由

[R1]ip route-static 192.168.20.0 24 10.0.12.2
[R2]ip route-static 192.168.20.0 24 10.0.23.3

2、分别在R2、R3上配置目的网段为PC-1所在网段的静态路由

[R2]ip route-static 192.168.10.0 24 10.0.12.1
[R3]ip route-static 192.169.10.0 24 10.0.23.2

[R2]ip route-static 192.168.10.0 255.255.255.0 Serial4/0/0(出接口)
[R3]ip route-static 192.168.10.0 255.255.255.0 Serial4/0/1(出接口)

3、使用Ping命令测试,显示测试成功

PC-1>ping 192.168.20.20

Ping 192.168.20.20: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.20.20: bytes=32 seq=2 ttl=125 time=31 ms
From 192.168.20.20: bytes=32 seq=3 ttl=125 time=47 ms
From 192.168.20.20: bytes=32 seq=4 ttl=125 time=32 ms
From 192.168.20.20: bytes=32 seq=5 ttl=125 time=46 ms

--- 192.168.20.20 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/39/47 ms

2.3.5.3 使用默认路由实现简单的网络优化

1、查看此时R1的路由表

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 13       Routes : 13       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      10.0.12.0/24  Direct  0    0           D   10.0.12.1       Serial4/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.12.2/32  Direct  0    0           D   10.0.12.2       Serial4/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.23.0/24  Static  60   0          RD   10.0.12.2       Serial4/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0           D   192.168.10.254  GigabitEthernet
0/0/0
 192.168.10.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
 192.168.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
   192.168.20.0/24  Static  60   0          RD   10.0.12.2       Serial4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

2、在R1上配置一条默认路由,即目的网段和掩码为全0,表示任何网络,下一跳地址为10.0.12.2,并删除先前配置的两条静态路由

[R1]ip route-static 0 0 10.0.12.2
[R1]undo ip route-static 10.0.23.0 255.255.255.0 10.0.12.2
[R1]undo ip route-static 192.168.20.0 255.255.255.0 10.0.12.2

3、配置完成后,查看R1的路由表

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 12       Routes : 12       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0          RD   10.0.12.2       Serial4/0/0
      10.0.12.0/24  Direct  0    0           D   10.0.12.1       Serial4/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.12.2/32  Direct  0    0           D   10.0.12.2       Serial4/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0           D   192.168.10.254  GigabitEthernet
0/0/0
 192.168.10.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
 192.168.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

注意:在配置过程中,顺序是先配置默认路由,再删除原有的静态路由配置,这样的操作可以避免网络中通信中断!!!

2.4 思考

在静态路由配置当中,可以采取指定下一跳IP地址方式,也可以采取指定出接口的方式,这两种方式存在什么区别吗? 答:1、对于点到点接口,指定出接口即隐含指定了下一跳地址,这时认为与该接口相连的对端接口地址就是路由的下一跳地址。 通过PPP协商获取对端的IP地址,这时可以不指定下一跳地址,只需指定出接口即可。 2、对于NBMA接口(如ATM接口),它支持点到多点网络,这时除了配置IP路由外,还需在链路层建立二次路由,即IP地址到链路层地址的映射。这种情况下应配置下一跳IP地址。 3、以太网接口或Virtual-template接口必须指定下一跳。因为以太网接口是广播类型的接口,而Virtual-template接口下可以关联多个虚拟访问接口(Virtual Access Interface),这都会导致出现多个下一跳,无法唯一确定下一跳。因此如果必须指定广播接口(如以太网接口)、VT接口或NBMA接口做为出接口,则应同时指定通过该接口发送时对应的下一跳地址。只配置下一跳的静态路由首先需要经过下一跳迭代,迭代成功才可以参与选路,否则路由无法被优选;而同时配置下一跳和出接口的静态路由,可以直接参与选路,只有在选路过程中被优选的路由才能下刷FIB,指导报文转发。

三、浮动静态路由及负载均衡

3.1 浮动静态路由

3.1.1 浮动静态路由定义

浮动静态路由(Floating Static Route)是一种特殊的静态路由,通过配置去往相同的目的网段,但优先级、下一跳地址不同的静态路由,以保证在网络中优先级较高的路由,即主路由失效的情况下,提供备份路由。正常情况下,备份路由不会出现在路由表中。

3.1.2 负载均衡定义

负载均衡(Load sharing),当数据有多条可选路径前往同一目的网络,可以通过配置相同优先级和开销,但下一跳不同的静态路由实现负载均衡,使得数据的传输均衡地分配到多条路径上,从而实现数据分流、减轻单条路径负载过重的效果。而当其中某一条路径失效时,其他路径仍然能够正常传输数据,起到冗余作用。

3.2 浮动静态路由及负载均衡实验

3.2.1 实验目的

1、理解浮动静态路由的应用场景 2、掌握配置浮动静态路由的方法 3、掌握测浮动静态路由的方法 4、掌握配置静态路由负载均衡的方法 5、掌握测试静态路由负载均衡的方法

3.2.2 实验内容

R2为某公司内部,R1和R3是两个分部,主机PC-1与PC-2所在的网段分别模拟两个分部中的办公网络。现需要总部和两个分部、分部与分部之间都能够通信,且分部之间在通信时,之间的直连链路为主用链路、通过总部的链路为备用链路。本实验使用浮动静态路由实现需求,并在根据实际需求实现负载均衡来优化网络。

3.2.3 实验拓扑

浮动静态路由及负载均衡实验拓扑

3.2.4 实验编址

设备 接口 IP地址 子网掩码 默认网关
PC-1 E0/0/1 192.168.10.1 255.255.255.0 192.168.10.254
R1(AR2220) G0/0/0 192.168.10.254 255.255.255.0 N/A
R1(AR2220) S4/0/0 10.0.12.1 255.255.255.0 N/A
R1(AR2220) S4/0/1 10.0.13.1 255.255.255.0 N/A
R2(AR2220) S4/0/0 10.0.12.2 255.255.255.0 N/A
R2(AR2220) S4/0/1 10.0.23.2 255.255.255.0 N/A
R3(AR2220) G0/0/0 192.168.20.254 255.255.255.0 N/A
R3(AR2220) S4/0/0 10.0.23.3 255.255.255.0 N/A
R3(AR2220) S4/0/1 10.0.13.3 255.255.255.0 N/A
PC-2 E0/0/1 192.168.20.1 255.255.255.0 192.168.20.254

3.2.5 实验步骤

3.2.5.1 基本配置

根据实验编址表进行相应的基本IP地址配置,并使用Ping命令检测各直连链路的连通性。

3.2.5.2 实现两分部间、总部与两分部间的通信

1、在R1上配置目的网段为主机PC-2所在网段的静态路由,在R3上配置目的网段为主机PC-1所在网段的静态路由,在R2上分别配置目的网段为主机PC-1、PC-2所在网段的静态路由。

[R1]ip route-static 192.168.20.0 255.255.255.0 10.0.13.3
[R2]ip route-static 192.168.10.0 255.255.255.0 10.0.12.1
[R2]ip route-static 192.168.20.0 255.255.255.0 10.0.23.3
[R3]ip route-static 192.168.10.0 255.255.255.0 10.0.13.1

2、使用Ping命令测试PC-1与PC-2的连通性。

PC>ping 192.168.20.1 -t

Ping 192.168.20.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.20.1: bytes=32 seq=2 ttl=126 time=31 ms
From 192.168.20.1: bytes=32 seq=3 ttl=126 time=16 ms
From 192.168.20.1: bytes=32 seq=4 ttl=126 time=31 ms
From 192.168.20.1: bytes=32 seq=5 ttl=126 time=31 ms

--- 192.168.20.1 ping statistics ---
  10 packet(s) transmitted
  9 packet(s) received
  10.00% packet loss
  round-trip min/avg/max = 0/24/32 ms

3、在主机PC-1上使用tracert命令测试所经过的网关。观察到PC-1访问PC-2是通过R1、R3。

PC-1>tracert 192.168.20.1

traceroute to 192.168.20.1, 8 hops max
(ICMP), press Ctrl+C to stop
 1  192.168.10.254   16 ms  15 ms  16 ms
 2  10.0.13.3   31 ms  16 ms  16 ms
 3  192.168.20.1   31 ms  15 ms  <1 ms

4、在总部路由器R2上测试与分部的连通性。

[R2]ping 192.168.10.1
  PING 192.168.10.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.10.1: bytes=56 Sequence=2 ttl=127 time=30 ms
    Reply from 192.168.10.1: bytes=56 Sequence=3 ttl=127 time=30 ms
    Reply from 192.168.10.1: bytes=56 Sequence=4 ttl=127 time=20 ms
    Reply from 192.168.10.1: bytes=56 Sequence=5 ttl=127 time=30 ms

  --- 192.168.10.1 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 20/27/30 ms

[R2]ping 192.168.20.1
  PING 192.168.20.1: 56  data bytes, press CTRL_C to break
    Request time out
    Reply from 192.168.20.1: bytes=56 Sequence=2 ttl=127 time=20 ms
    Reply from 192.168.20.1: bytes=56 Sequence=3 ttl=127 time=20 ms
    Reply from 192.168.20.1: bytes=56 Sequence=4 ttl=127 time=20 ms
    Reply from 192.168.20.1: bytes=56 Sequence=5 ttl=127 time=20 ms

  --- 192.168.20.1 ping statistics ---
    5 packet(s) transmitted
    4 packet(s) received
    20.00% packet loss
    round-trip min/avg/max = 20/20/20 ms

3.2.5.3 配置浮动静态路由实现路由备份

1、在R1上配置静态路由,目的网段为主机PC-2所在网段,掩码24位,下一跳为R2,将路由优先级设置为100(默认为60,越小越优先)

[R1]ip route-static 192.168.20.0 24 10.0.12.2 preference 100

2、配置完成后,使用dis ip routing-table查看路由器R1的路由表,发现没有任何变化。

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 16       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      10.0.12.0/24  Direct  0    0           D   10.0.12.1       Serial4/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.12.2/32  Direct  0    0           D   10.0.12.2       Serial4/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.13.0/24  Direct  0    0           D   10.0.13.1       Serial4/0/1
      10.0.13.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      10.0.13.3/32  Direct  0    0           D   10.0.13.3       Serial4/0/1
    10.0.13.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0           D   192.168.10.254  GigabitEthernet
0/0/0
 192.168.10.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet

3、使用dis ip routing-table protocol static 命令仅查看静态路由的路由信息,可以查看到去往PC-2所在网段的两条优先级为100和60的静态路由条目都已经存在。

[R1]dis ip routing-table protocol static 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

   192.168.20.0/24  Static  60   0          RD   10.0.13.3       Serial4/0/1

Static routing table status : <Inactive>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

   192.168.20.0/24  Static  100  0          R    10.0.12.2       Serial4/0/0

4、在R3上配置静态路由,目的网段为主机PC-1所在网段,掩码24位,下一跳为R2,将路由优先级设置为100(默认为60,越小越优先)

[R3]ip route-static 192.168.10.0 24 10.0.23.2 preference 100

5、模拟验证,将R1上的S4/0/1接口关闭,观察是否会使用备份链路

[R1-Serial4/0/1]shutdown 

6、配置完成后,使用使用dis ip routing-table protocol static 命令仅查看静态路由的路由信息,可以查看到去往PC-2所在网段的优先级为100的静态路由条目为Active状态,优先级为60的静态路由条目为Inactive状态。

[R1]dis ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
         Destinations : 1        Routes : 2        Configured Routes : 2

Static routing table status : <Active>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

   192.168.20.0/24  Static  100  0          RD   10.0.12.2       Serial4/0/0

Static routing table status : <Inactive>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

   192.168.20.0/24  Static  60   0               10.0.13.3       Unknown

注意:当与配置的静态路由由下一跳地址相关的接口处于down状态后该静态路由表项会被标记为inactive状态并从当前路由表中移除! 7、使用Tracert命令查看此时PC-1与PC-2通信时所经过的网关。验证了此时两分部之间通信时使用了备份链路。

PC>tracert 192.168.20.1

traceroute to 192.168.20.1, 8 hops max
(ICMP), press Ctrl+C to stop
 1  192.168.10.254   16 ms  15 ms  <1 ms
 2  10.0.12.2   31 ms  16 ms  16 ms
 3  10.0.23.3   15 ms  32 ms  15 ms
 4  192.168.20.1   31 ms  16 ms  31 ms

注意:默认情况下静态路由只能感知直连接口的状态,可通过静态路由与NQA、BFD等检测特性联动的方式增强静态路由的智能度。

3.2.5.4 通过负载均衡实现网络优化

1、在R1上恢复接口状态并配置目的网段为PC-2所在网段,掩码24位,下一跳为R2,优先级不变

[R1-Serial4/0/1]undo shutdown 
[R1]ip route-static 192.168.20.0 255.255.255.0 10.0.12.2

2、使用dis ip routing-table命令查看R1上的路由表

[R1]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 17       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      10.0.12.0/24  Direct  0    0           D   10.0.12.1       Serial4/0/0
      10.0.12.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.12.2/32  Direct  0    0           D   10.0.12.2       Serial4/0/0
    10.0.12.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      10.0.13.0/24  Direct  0    0           D   10.0.13.1       Serial4/0/1
      10.0.13.1/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      10.0.13.3/32  Direct  0    0           D   10.0.13.3       Serial4/0/1
    10.0.13.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Direct  0    0           D   192.168.10.254  GigabitEthernet
0/0/0
 192.168.10.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
 192.168.10.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
   192.168.20.0/24  Static  60   0          RD   10.0.13.3       Serial4/0/1
                    Static  60   0          RD   10.0.12.2       Serial4/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

3、在R3上配置目的网段为PC-1所在网段,掩码24位,下一跳为R2,优先级不变

[R3]ip route-static 192.168.10.0 255.255.255.0 10.0.23.2

4、使用dis ip routing-table命令查看R3上的路由表

[R3]dis ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 16       Routes : 17       

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      10.0.13.0/24  Direct  0    0           D   10.0.13.3       Serial4/0/1
      10.0.13.1/32  Direct  0    0           D   10.0.13.1       Serial4/0/1
      10.0.13.3/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
    10.0.13.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/1
      10.0.23.0/24  Direct  0    0           D   10.0.23.3       Serial4/0/0
      10.0.23.2/32  Direct  0    0           D   10.0.23.2       Serial4/0/0
      10.0.23.3/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
    10.0.23.255/32  Direct  0    0           D   127.0.0.1       Serial4/0/0
      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0
   192.168.10.0/24  Static  60   0          RD   10.0.13.1       Serial4/0/1
                    Static  60   0          RD   10.0.23.2       Serial4/0/0
   192.168.20.0/24  Direct  0    0           D   192.168.20.254  GigabitEthernet
0/0/0
 192.168.20.254/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
 192.168.20.255/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
255.255.255.255/32  Direct  0    0           D   127.0.0.1       InLoopBack0

5、测试主机PC-1与PC-2间的通信

PC>ping 192.168.20.1

Ping 192.168.20.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.20.1: bytes=32 seq=2 ttl=125 time=31 ms
From 192.168.20.1: bytes=32 seq=3 ttl=125 time=15 ms
From 192.168.20.1: bytes=32 seq=4 ttl=125 time=32 ms
From 192.168.20.1: bytes=32 seq=5 ttl=125 time=46 ms

--- 192.168.20.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/31/46 ms

说明1:配置针对相同目的地址相同但优先级值不同的静态路由,可以在路由器上实现路径备份的功能。而通过配置针对目的地址相同且优先级值相同的静态路由,不仅互为备份还能实现负载均衡。 说明2:当路由器路由表中存在到达同一目的地的多条等价路径时,路由器在转发到达该目的地的数据包时根据逐包、逐流、逐目的等负载均衡算法将数据包分布在相应的链路上发送。

3.3 思考1

在本实验的步骤3和步骤4中,如果不在R3上做和R1同样的对称配置,会产生什么样的现象?为什么? 答:R3上如果不配的话回程数据就不会负载均衡了。

3.4 思考2

完成负载均衡的配置之后,可以在R1上的S4/0/0和S4/0/1两个接口上启用抓包工具,且在主机PC-1上Ping主机PC-2,观察R1的两个接口上的现象,解释为什么会产生这样的现象? 答:会看到数据走一路,因为华为设备默认基于流负载均衡,同样的数据只走一路,开启基于包负载均衡就可以看到效果。