EIGRP 负载均衡实验R1:iinterface Serial2/0ip address 12.1.1.1 255.255.255.0serial restart-delay 0clock rate 64000!interface Serial2/1ip address 13.1.1.1 255.255.255.0serial restart-delay 0clock rate 64000router eigrp 100network 0.0.0.0no auto-summaryR2:interface FastEthernet0/0ip address 23.1.1.1 255.255.255.0 duplex autospeed autointerface Serial2/0ip address 12.1.1.2 255.255.255.0 serial restart-delay 0router eigrp 100network 0.0.0.0no auto-summaryR3:interface FastEthernet0/0ip address 23.1.1.2 255.255.255.0 duplex autospeed autointerface Serial2/1ip address 13.1.1.2 255.255.255.0 serial restart-delay 0router eigrp 100network 0.0.0.0no auto-summaryR3路由表:R3#show ip rouGateway of last resort is not set23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/2172416] via 23.1.1.1, 00:01:06, FastEthernet0/0 //去12.1.1.0网段via f0/013.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Serial2/1R3#show ip eigrp toIP-EIGRP Topology Table for AS(100)/ID(23.1.1.2)Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,r - reply Status, s - sia StatusP 12.1.1.0/24, 1 successors, FD is 2172416via 23.1.1.1 (2172416/2169856), FastEthernet0/0via 13.1.1.1 (2681856/2169856), Serial2/1P 13.1.1.0/24, 1 successors, FD is 2169856via Connected, Serial2/1P 23.1.1.0/24, 1 successors, FD is 28160via Connected, FastEthernet0/0//拓扑表中有两条可以到12.1.1.0网段的路径,F0/0和S1/1,经过s1/1那条路径的AD小于正在使用路由条目的FD2172416,所以被选为FS放在拓扑表中.要想实验负载均衡,可以用的办法:等价负载均衡(1):使得metric值相同1.改带宽(不推荐,因为改带宽要用107 去除,会得到小数,)2.改延迟,在R3上改f0/0 或s1/1其中的一个R3#show inter f0/0FastEthernet0/0 is up, line protocol is upHardware is AmdFE, address is cc02.07fc.0000 (bia cc02.07fc.0000) Internet address is 23.1.1.2/24MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,-----------------------------------------------------------------------R3#show int s2/1Serial2/1 is up, line protocol is upHardware is M4TInternet address is 13.1.1.2/24MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,先改s2/1R3(config-if)#delay ?<1-16777215> Throughput delay (tens of microseconds)延迟路由器会自动乘以10所以这里要改成和f0/0 的DLY一样只需R3(config-if)#delay 10R3#clear ip eigrp neighbors邻居关系重新建立R3#show ip eigrp toIP-EIGRP Topology Table for AS(100)/ID(23.1.1.2)Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia StatusP 12.1.1.0/24, 2 successors, FD is 2172416via 13.1.1.1 (2172416/2169856), Serial2/1via 23.1.1.1 (2172416/2169856), FastEthernet0/0P 13.1.1.0/24, 1 successors, FD is 1660416via Connected, Serial2/1P 23.1.1.0/24, 1 successors, FD is 28160via Connected, FastEthernet0/0R3#show ip routeGateway of last resort is not set23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/2172416] via 23.1.1.1, 00:01:08, FastEthernet0/0 [90/2172416] via 13.1.1.1, 00:01:08, Serial2/113.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Serial2/1metric值已经相同,路由表中有两条路由,负载均衡成功!当然也可以修改f0/0R3(config)#int f0/0R3(config-if)#delay 2000 一样可能达到负载均衡的效果等价负载均衡(2): offset-listP 12.1.1.0/24, 1 successors, FD is 2172416via 23.1.1.1 (2172416/2169856), FastEthernet0/0via 13.1.1.1 (2681856/2169856), Serial2/1R3(config)#access-list 1 permit 12.1.1.0R3(config)#router eigrp 100R3(config-router)#offset-list 1 in 509440 f0/0在这里只能改小的,大的减小的即为偏移的值,其中有个参数”in”,如果对自己产生影响用”in”如果对外面产生影响用”out”,509440是偏移值,后面还有个接口,是说,在这个接口上加上偏移值,如果不定义接口,默认在所有接口加偏移值.R3#show ip routGateway of last resort is not set23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/2681856] via 23.1.1.1, 00:00:04, FastEthernet0/0 [90/2681856] via 13.1.1.1, 00:00:04, Serial2/113.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Serial2/1不等价负载均衡:varianceP 12.1.1.0/24, 1 successors, FD is 2172416via 23.1.1.1 (2172416/2169856), FastEthernet0/0via 13.1.1.1 (2681856/2169856), Serial2/1R3(config)#router eigrp 100R3(config-router)#varR3(config-router)#variance ?<1-128> Metric variance multiplierR3(config-router)#variance 2R3#show ip rouGateway of last resort is not set23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/012.0.0.0/24 is subnetted, 1 subnetsD 12.1.1.0 [90/2172416] via 23.1.1.1, 00:00:45, FastEthernet0/0[90/2681856] via 13.1.1.1, 00:00:45, Serial2/113.0.0.0/24 is subnetted, 1 subnetsC 13.1.1.0 is directly connected, Serial2/1Variance 默认为1,以最小的取一个倍数大于或者等于最大的.就可以实现不等价负载均衡负载均衡默认时最大支持4条,修改后最大支持6条路径当两条路负载均衡的时候,是不是各走一个包呢?不是,以前是按6:1算,即一条走6个另外一条走1个,现在新版本的IOS按实际的带宽得出一个比例R3#show ip route 12.1.1.0Routing entry for 12.1.1.0/24Known via "eigrp 100", distance 90, metric 2172416, type internal Redistributing via eigrp 100Last update from 13.1.1.1 on Serial2/1, 00:02:12 agoRouting Descriptor Blocks:* 23.1.1.1, from 23.1.1.1, 00:02:12 ago, via FastEthernet0/0Route metric is 2172416, traffic share count is 120Total delay is 20100 microseconds, minimum bandwidth is 1544 Kbit Reliability 255/255, minimum MTU 1500 bytesLoading 1/255, Hops 113.1.1.1, from 13.1.1.1, 00:02:12 ago, via Serial2/1Route metric is 2681856, traffic share count is 97Total delay is 40000 microseconds, minimum bandwidth is 1544 Kbit Reliability 255/255, minimum MTU 1500 bytesLoading 1/255, Hops 1带”*”说明下一个包走这个路,关掉快速转发R3(config)#no ip cef用扩展PING当PING到第N个包时就会走下面的13.1.1.1为了只要我们PING的目的网段的包,可以加一条扩展的ACLR3(config)#access-list 100 permit icmp any anyR3#debug ip packet 100*Mar 1 01:04:54.543: IP: s=23.1.1.1 (FastEthernet0/0), d=23.1.1.2 (FastEthernet0/0), len 100, rcvd 3*Mar 1 01:04:55.367: IP: s=13.1.1.2 (local), d=12.1.1.0 (Serial2/1), len 100, sending*Mar 1 01:04:55.427: IP: tableid=0, s=13.1.1.1 (Serial2/1), d=13.1.1.2 (Serial2/1), routed via RIB*Mar 1 01:04:55.431: IP: s=13.1.1.1 (Serial2/1), d=13.1.1.2 (Serial2/1), len 100, rcvd 3*Mar 1 01:04:55.475: IP: tableid=0, s=13.1.1.2 (local), d=12.1.1.0 (Serial2/1), routed via RIB。