本举例介绍基于接口的非等价负载分担的配置示例。组网需求如图1所示,RouterA和RouterB之间通过两条链路连接。RouterA上Eth-Trunk1接口的成员口是GE1/0/0和GE2/0/0;RouterB上Eth-Trunk1接口的成员口是GE1/0/0和GE2/0/0。RouterA的GE0/0/1到RouterB的GE0/0/1是一条实际物理链路。因为Eth-Trunk1接口包含了两个GE接口,所以其带宽是单独一条物理链路的两倍。要求RouterA到RouterB的这两条链路上实现非等价负载分担。图1配置非等价负载分担组网图配置思路非等价负载分担配置思路如下:在RouterA和RouterB上配置静态路由。在RouterA的接口上配置非等价负载分担功能,使RouterA和RouterB之间的流量基于不同的链路进行非等价负载分担。数据准备为完成此配置示例,需准备如下的数据:接口类型和接口编号。各接口的IP地址和子网掩码。Eth-Trunk接口编号。Eth-Trunk接口的带宽值。操作步骤配置各个接口的IP地址(略)。配置静态路由。#在RouterA上配置静态路由。[RouterA]iproute-static2.2.2.23230.1.1.2[RouterA]iproute-static2.2.2.23240.1.1.2#在RouterB上配置静态路由。[RouterB]iproute-static1.1.1.13230.1.1.1[RouterB]iproute-static1.1.1.13240.1.1.1检查路由配置。#在RouterA上查看静态路由信息。displayiprouting-tableRouteFlags:R-relay,D-downloadtofib------------------------------------------------------------------------------RoutingTables:PublicDestinations:3Routes:5Destination/MaskProtoPreCostFlagsNextHopInterface2.1.1.255/32Direct00D127.0.0.1InLoopBack02.2.2.0/24Static600RD30.1.1.1Eth-Trunk1Static600RD40.1.1.1GigabitEthernet0/0/12.2.2.2/32Static600RD30.1.1.1Eth-Trunk1Static600RD40.1.1.1GigabitEthernet0/0/1#在RouterA上可以ping通2.2.2.2。缺省情况下,RouterA的出接口上实现了等价负载分担功能。在RouterA的接口上使能非等价路由负载分担功能。[RouterA]interfaceeth-trunk1[RouterA-Eth-Trunk1]load-balancebandwidth1500000[RouterA-Eth-Trunk1]load-balanceunequal-costenable[RouterA-Eth-Trunk1]quit[RouterA]interfacegigabitethernet0/0/1[RouterA-GigabitEthernet0/0/1]load-balanceunequal-costenable[RouterA-GigabitEthernet0/0/1]quit重启接口,使RouterA上的UCMP配置生效。[RouterA]interfaceeth-trunk1[RouterA-Eth-Trunk1]shutdown[RouterA-Eth-Trunk1]undoshutdown[RouterA-Eth-Trunk1]quit[RouterA]interfacegigabitethernet0/0/1[RouterA-GigabitEthernet0/0/1]shutdown[RouterA-GigabitEthernet0/0/1]undoshutdown[RouterA-GigabitEthernet0/0/1]quit验证配置结果#在RouterA上仍可以ping通20.1.1.1。ping2.2.2.2PING2.2.2.2:56databytes,pressCTRL_CtobreakReplyfrom2.2.2.2:bytes=56Sequence=1ttl=255time=2msReplyfrom2.2.2.2:bytes=56Sequence=2ttl=255time=2msReplyfrom2.2.2.2:bytes=56Sequence=3ttl=255time=2msReplyfrom2.2.2.2:bytes=56Sequence=4ttl=255time=2msReplyfrom2.2.2.2:bytes=56Sequence=5ttl=255time=2ms---2.2.2.2pingstatistics---5packet(s)transmitted5packet(s)received0.00%packetlossround-tripmin/avg/max=2/2/2ms#在用户视图下执行命令displaycurrent-configuration,可以看到接口Eth-trunk1和GigabitEthernet0/0/1已配置非等价负载分担功能。displaycurrent-configuration...interfaceEth-trunk1undoportswitchload-balancebandwidth1500000load-balanceunequal-costenableipaddress30.1.1.1255.255.255.0interfaceGigabitEthernet0/0/1load-balanceunequal-costenableipaddress40.1.1.1255.255.255.0...配置文件RouterA的配置文件。#sysnameRouterA#interfaceEth-trunk1undoportswitchtrunkportGigabitEthernet1/0/0trunkportGigabitEthernet2/0/0load-balancebandwidth1500000load-balanceunequal-costenableipaddress30.1.1.1255.255.255.0#interfaceGigabitEthernet0/0/1load-balanceunequal-costenableipaddress40.1.1.1255.255.255.0#interfaceLoopBack0ipaddress1.1.1.1255.255.255.255#iproute-static2.2.2.23230.1.1.2iproute-static2.2.2.23240.1.1.2#returnRouterB的配置文件。#sysnameRouterB#interfaceEth-trunk1undoportswitchtrunkportGigabitEthernet1/0/0trunkportGigabitEthernet2/0/0ipaddress30.1.1.2255.255.255.0#interfaceGigabitEthernet0/0/1ipaddress40.1.1.2255.255.255.0#interfaceLoopBack0ipaddress2.2.2.2255.255.255.255#iproute-static1.1.1.13230.1.1.1iproute-static1.1.1.13240.1.1.1#return