配置IS-IS的负载分担配置实例
组网需求
如下图所示:
路由器RouterA、RouterB、RouterC和RouterD之间通过IS-IS协议达到IP网络互连的目的。
路由器RouterA、RouterB、RouterC和RouterD同属于区域10,都是Level-2路由器。
要求配置负载分担,使得路由器RouterA的流量,可以分别通过路由器RouterB和RouterC发送到路由器RouterD。
配置IS-IS的负载分担组网图
| router | interface | IP address |
| RouterA | GE3/0/0 | 172.16.1.1./24 |
| POS1/0/0 | 10.1.1.1/24 | |
| POS2/0/0 | 10.1.2.1/24 | |
| RouterC | POS1/0/0 | 10.1.2.2/24 |
| POS2/0/0 | 192.168.1.1/24 | |
| RouterB | POS1/0/0 | 10.1.1.2/24 |
| POS2/0/0 | 192.168.1.2/24 | |
| RouterD | GE3/0/0 | 172.17.1.1/24 |
| POS2/0/0 | 192.168.0.1/24 | |
| POS1/0/0 | 192.168.0.2/24 |
配置思路
采用如下的思路配置IS-IS的负载分担:
在各路由器上使能IS-IS基本功能,实现互连。
取消负载分担,查看路由表信息。
在RouterA上配置负载分担功能,查看路由表信息。
在RouterA上配置负载分担方式。
在RouterA上配置等价路由优先级(可选配置)。
数据准备
为完成此配置例,需准备如下的数据:
四台路由器的级别和所属区域号。
RouterA上负载分担数目为1。
RouterA的路由负载分担方式。
RouterC的等价路由优先级权值为1。
配置步骤
步骤 1 配置各接口的IP地址(略)
步骤 2 配置IS-IS的基本功能(略)
步骤 3 在RouterA上取消负载分担
[RouterA] isis 1
[RouterA-isis-1] maximum load-balancing 1
# 查看RouterA的路由表。
[RouterA] display isis route
Route information for ISIS(1)
-----------------------------
ISIS(1) Level-2 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------
192.168.1.0/24 20 NULL P2/0/0 10.1.2.2 R/-/-
10.1.1.0/24 10 NULL P1/0/0 Direct D/L/-
172.16.1.0/24 10 NULL GE3/0/0 Direct D/L/-
172.17.1.0/24 30 NULL P1/0/0 10.1.1.2 R/-/-
10.1.2.0/24 10 NULL P2/0/0 Direct D/L/-
192.168.0.0/24 20 NULL P1/0/0 10.1.1.2 R/-/-
Flags: D-Direct, R-Added to RM, L-Advertised in LSPs, U-Up/Down Bit Set
从路由表中可以看出,当配置负载分担最大等价路由条数为1后,到达目标网段172.17.1.0的下一跳为10.1.1.2,这是由于RouterB的System ID较小,所以IS-IS优先选择下一跳为10.1.1.2为唯一最优路由。
步骤 4 在RouterA上恢复负载分担路由的缺省数量
[RouterA] isis 1
[RouterA-isis-1] undo maximum load-balancing
# 查看RouterA的路由表。
[RouterA] display isis route
Route information for ISIS(1)
-----------------------------
ISIS(1) Level-2 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------
192.168.1.0/24 20 NULL P2/0/0 10.1.2.2 R/-/-
10.1.1.0/24 10 NULL P1/0/0 Direct D/L/-
172.16.1.0/24 10 NULL GE3/0/0 Direct D/L/-
172.17.1.0/24 30 NULL P1/0/0 10.1.1.2 R/-/-
P2/0/0 10.1.2.2
10.1.2.0/24 10 NULL P2/0/0 Direct D/L/-
192.168.0.0/24 20 NULL P1/0/0 10.1.1.2 R/-/-
Flags: D-Direct, R-Added to RM, L-Advertised in LSPs, U-Up/Down Bit Set
从路由表可以看出,当取消负载分担设置即恢复缺省配置后,由于最大等价路由条数的缺省值为6,因此路由器RouterA的两个下一跳10.1.1.2(RouterB)和10.1.2.2(RouterC)均成为有效路由。
说明
不同的产品,不同协议,最大等价路由条数可能会不同,这个最大值可以通过购买许可证文件来调整。
步骤 5 配置RouterA的负载分担方式
负载分担支持两种方式,逐包负载分担和逐流负载分担。
# 逐包负载分担。
[RouterA] load-balance packet
# 检查配置结果。
[RouterA] acl 3000
[RouterA -acl-adv-3000] rule permit icmp destination 172.17.1.1 0
[RouterA -acl-adv-3000] quit
[RouterA] quit
<RouterA> debugging ip packet acl 3000
<RouterA> terminal debugging
<RouterA> terminal monitor
<RouterA> ping 172.17.1.1
PING 172.17.1.1: 56 data bytes, press CTRL_C to break
*0.3207850 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 8, offset = 0, ttl = 255, protocol = 1,
checksum = 909, s = 10.1.1.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=1 ttl=254 time=70 ms
*0.3208320 RouterA IP/8/debug_case:
Sending, interface = pos2/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 9, offset = 0, ttl = 255, protocol = 1,
checksum = 652, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos2/0/0
Reply from 172.17.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms
*0.3208840 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 10, offset = 0, ttl = 255, protocol = 1,
checksum = 907, s = 10.1.1.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=3 ttl=254 time=40 ms
*0.3209340 RouterA IP/8/debug_case:
Sending, interface = pos2/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 11, offset = 0, ttl = 255, protocol = 1,
checksum = 650, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos2/0/0
Reply from 172.17.1.1: bytes=56 Sequence=4 ttl=254 time=70 ms
*0.3209820 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 12, offset = 0, ttl = 255, protocol = 1,
checksum = 905, s = 10.1.1.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=5 ttl=254 time=40 ms
--- 172.17.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/54/70 ms
从上面的debugging信息中,我们可以看出,到达目标地址172.17.1.1的报文分别从RouterA的Pos1/0/0接口和Pos2/0/0接口轮流发送出去,即基于报文的负载分担。
# 逐流负载分担。
[RouterA] load-balance flow
# 检查配置结果。
[RouterA] acl 3000
[RouterA -acl-adv-3000] rule permit icmp destination 172.17.1.1 0
[RouterA -acl-adv-3000] quit
[RouterA] quit
<RouterA> debugging ip packet acl 3000
<RouterA> terminal debugging
<RouterA> terminal monitor
<RouterA> ping 172.17.1.1
PING 172.17.1.1: 56 data bytes, press CTRL_C to break
*0.2542700 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 3, offset = 0, ttl = 255, protocol = 1,
checksum = 658, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=1 ttl=254 time=810 ms
Reply from 172.17.1.1: bytes=56 Sequence=2 ttl=254 time=40 ms
*0.2542930 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 4, offset = 0, ttl = 255, protocol = 1,
checksum = 657, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
*0.2543400 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 5, offset = 0, ttl = 255, protocol = 1,
checksum = 656, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=3 ttl=254 time=60 ms
*0.2543900 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 6, offset = 0, ttl = 255, protocol = 1,
checksum = 655, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=4 ttl=254 time=60 ms
*0.2544400 RouterA IP/8/debug_case:
Sending, interface = pos1/0/0, version = 4, headlen = 20, tos = 0,
pktlen = 84, pktid = 7, offset = 0, ttl = 255, protocol = 1,
checksum = 654, s = 10.1.2.1, d = 172.17.1.1
prompt: Sending the packet from local at pos1/0/0
Reply from 172.17.1.1: bytes=56 Sequence=5 ttl=254 time=80 ms
--- 172.17.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/210/810 ms
从上面的debugging信息中,我们可以看出,到达目标地址172.17.1.1的报文全部从RouterA的Pos1/0/0接口发送出去,即基于流的负载分担。
说明
因为基于流的负载分担的选路原则为:到达同一个目的地址,它总是选择以前走过的路径。由于上一次到达目的地址是从Pos1/0/0接口发出,所以基于流的负载分担时也选择从Pos1/0/0发送报文。
步骤 6 在RouterA上配置等价路由优先级(可选配置)
如果我们不希望RoterB和RouterC形成负载分担,可以配置等价路由优先级,指定下一跳。
[RouterA] isis
[RouterA-isis-1] nexthop 10.1.2.2 weight 1
步骤 7 验证配置结果
# 查看RouterA的路由表。
[RouterA] display isis route
Route information for ISIS(1)
-----------------------------
ISIS(1) Level-2 Forwarding Table
--------------------------------
IPV4 Destination IntCost ExtCost ExitInterface NextHop Flags
--------------------------------------------------------------------------------
192.168.1.0/24 20 NULL P2/0/0 10.1.2.2 R/-/-
10.1.1.0/24 10 NULL P1/0/0 Direct D/L/-
172.16.1.0/24 10 NULL GE3/0/0 Direct D/L/-
172.17.1.0/24 30 NULL P1/0/0 10.1.2.2 R/-/-
10.1.2.0/24 10 NULL P2/0/0 Direct D/L/-
192.168.0.0/24 20 NULL P1/0/0 10.1.1.2 R/-/-
Flags: D-Direct, R-Added to RM, L-Advertised in LSPs, U-Up/Down Bit Set
从路由表中可以看出,当配置等价路由的优先级后,由于下一跳为10.1.2.2(RouterC)的优先级(权值为1)高于下一跳为10.1.1.2(RouterB)的优先级,所以IS-IS优先选择下一跳为10.1.2.2为唯一最优路由。





