CCNP-2 EIGRP试验2
实验拓扑:
试验要求:
1-R1
到
R4
全部起
EIGRP
路由协议,配置
bandwidth
,观察
EIGRP
的等价负载均衡和非等价负载均衡。
试验目的:掌握
EIGRP
等价负载均衡和非等价负载均衡的基本配置。
试验配置:
R1
:
R1(config)#int s1/0
R1(config-if)#ip add 199.99.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shu
R1(config-if)#bandwidth 56
R1(config-if)#exit
R1(config)#int s1/1
R1(config-if)#ip add 199.99.2.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#bandwidth 56
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#router eigrp 100
R1(config-router)#net
R1(config-router)#network 199.99.1.0
R1(config-router)#network 199.99.2.0
R2
:
R2(config)#int s1/0
R2(config-if)#ip add 199.99.1.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#bandwidth 56
R2(config-if)#exit
R2(config)#int s1/1
R2(config-if)#ip add 199.99.3.1 255.255.255.0
R2(config-if)#no shu
R2(config-if)#bandwidth 56
R2(config-if)#exit
R2(config)#router eigrp 100
R2(config-router)#net 199.99.1.0
R2(config-router)#net 199.99.3.0
R3
:
R3(config)#int s1/0
R3(config-if)#ip add 199.99.2.2 255.255.255.0
R3(config-if)#bandwidth 56
R3(config-if)#no shu
R3(config-if)#exit
R3(config)#int s1/1
R3(config-if)#ip add 199.99.4.1 255.255.255.0
R3(config-if)#no shu
R3(config-if)#bandwidth 56
R3(config-if)#exit
R3(config)#router eigrp 100
R3(config-router)#net 199.99.2.0
R3(config-router)#net 199.99.4.0
R4
:
R4(config)#int s1/0
R4(config-if)#ip add 199.99.3.2 255.255.255.0
R4(config-if)#bandwidth 56
R4(config-if)#clock rate 64000
R4(config-if)#no shu
R4(config-if)#exit
R4(config)#int s1/1
R4(config-if)#ip add 199.99.4.2 255.255.255.0
R4(config-if)#bandwidth 56
R4(config-if)#clock rate 64000
R4(config-if)#no shu
R4(config-if)#exit
R4(config)#int loop0
R4(config-if)#ip add 100.100.100.100 255.255.255.0
R4(config-if)#exit
R4(config)#router eigrp 100
R4(config-router)#net 199.99.3.0
R4(config-router)#net 199.99.4.0
R4(config-router)#net 100.100.100.0
以上是基本配置,我们在没个接口上都用到了一条命令
bandwidth 56
来指定带宽为
56Kbps
,下面我们在
R1
上
show ip route
查看路由表:
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
D 100.0.0.0/8 [90/46866176] via 199.99.2.2, 00:00:02, Serial1/1
[90/46866176] via 199.99.1.2, 00:00:02, Serial1/0
D 199.99.3.0/24 [90/46738176] via 199.99.1.2, 00:00:04, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
D 199.99.4.0/24 [90/46738176] via 199.99.2.2, 00:00:04, Serial1/1
可以看到有两条到
100.0.0.0/8
的路由
(EIGRP
自动汇总
)
,再用
show ip eigrp topology
查看拓扑表:
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(199.99.2.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 100.0.0.0/8, 2 successors, FD is 46866176
via 199.99.1.2 (46866176/46354176), Serial1/0
via 199.99.2.2 (46866176/46354176), Serial1/1
P 199.99.4.0/24, 1 successors, FD is 46738176
via 199.99.2.2 (46738176/46226176), Serial1/1
P 199.99.1.0/24, 1 successors, FD is 46226176
via Connected, Serial1/0
P 199.99.2.0/24, 1 successors, FD is 46226176
via Connected, Serial1/1
P 199.99.3.0/24, 1 successors, FD is 46738176
via 199.99.1.2 (46738176/46226176), Serial1/0
可以发现到
100.0.0.0/8
的两条路径的
FD
都是
46354176
,这样就可以实现等价负载均衡的目的,注意:
EIGRP
等价负载均衡默认启用,并且支持
4
条不同的等价路径,可以使用路由协议配置模式下的
maximum-paths
命令修改,最多支持
6
条;
下面在
R1
上起
loopback
接口,并用
eigrp
宣告接口
IP
地址,再进行
ping
测试:
R1(config)#int loop0
R1(config-if)#ip add 200.200.200.200 255.255.255.0
R1(config)#end
R1#ping
Protocol [ip]:
Target IP address: 100.100.100.100
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 200.200.200.200
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]: r
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.100, timeout is 2 seconds:
Packet sent with a source address of 200.200.200.200
Packet has IP options: Total option bytes= 39, padded length=40
Record route: <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
Reply to request 0 (136 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 1 (232 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.1.1)
(199.99.3.1)
(100.100.100.100)
(199.99.3.2)
(199.99.1.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 2 (88 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 3 (232 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.1.1)
(199.99.3.1)
(100.100.100.100)
(199.99.3.2)
(199.99.1.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 4 (136 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Success rate is 100 percent (5/5), round-trip min/avg/max = 88/164/232 ms
注意结果中用红色标记的部分说明了通过两条路径都可以到达目的
下面我们把
R1
到
R3
的带宽修改为
55
:
R1(config)#int s1/1
R1(config-if)#bandwidth 55
过一会我们可以发现
R1
到
100.0.0.0/8
的路由就剩下
1
条了,就是通过
R2
的路由,为了实现非等价负载均衡,我们需要用到
variance
命令在路由协议配置模式下修改(有关非等价负载均衡的计算方法这里略),如下:
R1(config-router)#variance 2
修改完等一会后,使用命令
show ip route
查看路由表:
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF , IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 200.200.200.0/24 is directly connected, Loopback0
D 100.0.0.0/8 [90/
47697408
] via 199.99.2.2, 00:00:03, Serial1/1
[90/
46866176
] via 199.99.1.2, 00:00:03, Serial1/0
D 199.99.3.0/24 [90/46738176] via 199.99.1.2, 00:00:03, Serial1/0
C 199.99.2.0/24 is directly connected, Serial1/1
C 199.99.1.0/24 is directly connected, Serial1/0
D 199.99.4.0/24 [90/47569408] via 199.99.2.2, 00:00:03, Serial1/1
[90/47250176] via 199.99.1.2, 00:00:03, Serial1/0
可以看到有两条到
100.0.0.0/8
的路由,并且它们的
metric
值是不相等的,通过
199.99.2.2
的路由得
metric
要比通过
199.99.1.2
的路由的
metric
大,因为我们把出口带宽改成了
55
,在看一下
show ip eigrp topology
R1#show ip eigrp topology
IP-EIGRP Topology Table for AS(100)/ID(200.200.200.200)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status
P 100.0.0.0/8, 1 successors, FD is 46866176
via 199.99.1.2 (46866176/46354176), Serial1/0
via 199.99.2.2 (47697408/46354176), Serial1/1
P 199.99.4.0/24, 1 successors, FD is 47250176
via 199.99.1.2 (47250176/46738176), Serial1/0
via 199.99.2.2 (47569408/46226176), Serial1/1
P 199.99.1.0/24, 1 successors, FD is 46226176
via Connected, Serial1/0
P 199.99.2.0/24, 1 successors, FD is 47057408
via Connected, Serial1/1
P 199.99.3.0/24, 1 successors, FD is 46738176
via 199.99.1.2 (46738176/46226176), Serial1/0
P 200.200.200.0/24, 1 successors, FD is 128256
via Connected, Loopback0
然后进行
ping
测试:
R1#ping
Protocol [ip]:
Target IP address: 100.100.100.100
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 200.200.200.200
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]: r
Number of hops [ 9 ]:
Loose, Strict, Record, Timestamp, Verbose[RV]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.100, timeout is 2 seconds:
Packet sent with a source address of 200.200.200.200
Packet has IP options: Total option bytes= 39, padded length=40
Record route: <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
Reply to request 0 (236 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 1 (280 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.3.2)
(199.99.1.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 2 (112 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 3 (112 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.3.2)
(199.99.1.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Reply to request 4 (160 ms). Received packet has options
Total option bytes= 40, padded length=40
Record route:
(199.99.2.1)
(199.99.4.1)
(100.100.100.100)
(199.99.4.2)
(199.99.2.2)
(200.200.200.200) <*>
( 0.0.0 .0)
( 0.0.0 .0)
( 0.0.0 .0)
End of list
Success rate is 100 percent (5/5), round-trip min/avg/max = 112/180/280 ms
我们可以与前面等价负载均衡的
ping
结果相比较,发现走的路径不同。
特别注意:在
EIGRP
进行负载均衡的时候,如果是
PROCESS-SWITCHING
的话,那么是根据每个数据包来进行负载均衡的,如果是
FAST-SWITCHING
的话,则是根据目的地进行负载均衡的!
实验总结:通过本试验可以掌握在
EIGRP
中进行等价负载均衡和非等价负载均衡的基本配置方法。还应该知道
EIGRP
的
metric
的计算是根自己接口的带宽和链路上总的延迟计算出来的。(书上说带宽是链路上的最小带宽,但是在做试验的时候发现试验结果与书上说的有冲突,请读者自己证实!)。