这个实验并不重要,但这个理念很好R1、R2、R3预配置R1(config)#int lo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)
.
这个实验并不重要,但这个理念很好
R1、R2、R3预配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s2/1
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int f0/0
R1(config-if)#ip add 13.0.0.1 255.255.255.0
R1(config-if)#no sh
R2(config)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#int s2/1
R2(config-if)#ip ad 12.0.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s2/2
R2(config-if)#ip add 23.0.0.2 255.255.255.0
R2(config-if)#no sh
R3(config)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#int s2/1
R3(config-if)#ip add 23.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int f0/0
R3(config-if)#ip add 13.0.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#
实验过程:
第一步:在各路由器上启用EIGRP
R1(config)#router eigrp 11
R1(config-router)#net 1.1.1.1
R1(config-router)#net 12.0.0.0
R1(config-router)#net 13.0.0.0
R1(config-router)#no au
R2(config)#router eigrp 11
R2(config-router)#net 2.2.2.2
R2(config-router)#net 12.0.0.0
R2(config-router)#net 23.0.0.0
R2(config-router)#no au
R3(config)#router eigrp 11
R3(config-router)#net 3.3.3.3
R3(config-router)#net 13.0.0.0
R3(config-router)#no au
第二步:查看R3的路由表和拓朴表
R3#sh ip rou
……………………
12.0.0.0/24 is subnetted, 1 subnets
D 12.0.0.0 [90/2172416] via 13.0.0.1, 00:01:11, FastEthernet0/0
13.0.0.0/24 is subnetted, 1 subnets
C 13.0.0.0 is directly connected, FastEthernet0/0
R3#sh ip eigrp topology
……………………
P 12.0.0.0/24, 1 successors, FD is 2172416
via 13.0.0.1 (2172416/2169856), FastEthernet0/0
via 23.0.0.2 (2681856/2169856), Serial2/1
P 13.0.0.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 23.0.0.0/24, 1 successors, FD is 2169856
via Connected, Serial2/1
第一种:通过修改延迟来使之实现等价负载均衡
第一步:查看R3上f0/0的延迟信息
R3#sh int f0/0
FastEthernet0/0 is up, line protocol is up
Hardware is DEC21140, address is ca93.0b98.0000 (bia ca93.0b98.0000)
Internet address is 13.0.0.3/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
……………………………………
第二步:修改S2/1的延迟并查看
R3(config)#int s2/1
R3(config-if)#delay 10 (更改后,接口会down)
R3(config-if)#do sh int s2/1
Serial2/1 is up, line protocol is up
Hardware is M4T
Internet address is 23.0.0.3/24
MTU 1500 bytes, BW 1544 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
第三步:关闭cef并ping12.0.0.1
R3(config)#no ip cef
*R3#p 12.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/28/72 ms
R3#
Nov 17 15:28:57.751: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3
Nov 17 15:28:57.799: ICMP: echo reply rcvd, src 12.0.0.1, dst 23.0.0.3(不同的路径)
Nov 17 15:28:57.815: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3
Nov 17 15:28:57.823: ICMP: echo reply rcvd, src 12.0.0.1, dst 23.0.0.3
Nov 17 15:28:57.839: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3*
第二种:通过offset-list来使之实现负载均衡
第一步:做访问控制列表
R3(config)#access-list 10 permit 12.0.0.0
R3(config)#router eigrp 11
R3(config-router)#offset-list 10 in 509440 f0/0
R3(config-router)#exit
第二步:查看eigrp拓扑
R3#clear ip eigrp nei
R3#sh ip eigrp top
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 1.1.1.0/24, 1 successors, FD is 156160
via 13.0.0.1 (156160/128256), FastEthernet0/0
P 2.2.2.0/24, 1 successors, FD is 2297856
via 23.0.0.2 (2297856/128256), Serial2/1
P 3.3.3.0/24, 1 successors, FD is 128256
via Connected, Loopback0
P 12.0.0.0/24, 2 successors, FD is 2681856
via 23.0.0.2 (2681856/2169856), Serial2/1
via 13.0.0.1 (2681856/2679296), FastEthernet0/0
P 13.0.0.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 23.0.0.0/24, 1 successors, FD is 2169856
via Connected, Serial2/1
R3#
第三步:在R3 Ping 12.0.0.1并看看其结果
R3#ping 12.0.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/36/88 ms
R3#s
Nov 17 15:50:28.151: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3
Nov 17 15:50:28.243: ICMP: echo reply rcvd, src 12.0.0.1, dst 23.0.0.3
Nov 17 15:50:28.271: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3
Nov 17 15:50:28.283: ICMP: echo reply rcvd, src 12.0.0.1, dst 23.0.0.3
Nov 17 15:50:28.295: ICMP: echo reply rcvd, src 12.0.0.1, dst 13.0.0.3
R3#
*
第三种:非等价负载
第一步:在R3上variance
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router eigrp 11
R3(config-router)#variance 2 (此值为 2681856÷2172416取大于此值的整数)
R3(config-router)#end
R3#sh ip rou
Gateway of last resort is not set
1.0.0.0/24 is subnetted, 1 subnets
D 1.1.1.0 [90/156160] via 13.0.0.1, 00:00:04, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0 [90/2297856] via 23.0.0.2, 00:00:04, Serial2/1
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
D 12.0.0.0 [90/2172416] via 13.0.0.1, 00:00:04, FastEthernet0/0
[90/2681856] via 23.0.0.2, 00:00:04, Serial2/1
//我们在这里看到有两条路由
13.0.0.0/24 is subnetted, 1 subnets
C 13.0.0.0 is directly connected, FastEthernet0/0
为什么会有2条路由,我们查看eitgrp的拓扑表
R3#sh ip eigrp topology
……………………
P 12.0.0.0/24, 1 successors, FD is 2172416
via 13.0.0.1 (2172416/2169856), FastEthernet0/0
via 23.0.0.2 (2681856/2169856), Serial2/1
可以看出非等价在这里体现出来了
P 13.0.0.0/24, 1 successors, FD is 28160
via Connected, FastEthernet0/0
P 23.0.0.0/24, 1 successors, FD is 2169856