●配置实例 配置目标:
1)在所有接口上激活EIGRP(R1,R2,R4,R5)。 2)设置K值,使metric只考虑延迟。 3)配置R5为EIGRP桩路由器。 4)使R2的LAN接口使用的Hello和Hold定时器值分别为2和6。 5)配置R4以使其75%的接口带宽用于EIGRP更新。 6)广播R4的LAN子网,但在该LAN中不发送和接收EIGRP更新。 具体配置: 1)R1的配置: router eigrp 1 network 172.31.0.0 metric weights 0 0 0 1 0 0 2)R2的配置: interface FastEthernet0/0 ip hello-interval eigrp 1 2 ip hold-time eigrp 1 6 ! router eigrp 1 network 10.0.0.0 network 172.31.11.2 0.0.0.0 network 172.31.24.0 0.0.1.255 metric weights 0 0 0 1 0 0 3)R4的配置: interface Serial0/0.1 point-to-point bandwidth 64 ip bandwidth-percent eigrp 1 150 ! router eigrp 1 passive-interface Ethernet0/0 network 172.31.0.0 metric weights 0 0 0 1 0 0 4)R5的配置: router eigrp 1 network 172.31.0.0 metric weights 0 0 0 1 0 0 eigrp stub connected summary ●eigrp stub命令的选项: 1)connected:广播连通的路由,仅限于那些匹配network命令的接口。 2)summary:广播自动汇总或静态配置汇总的路由。 3)static:广播静态路由(假定已经配置了redistribute static命令)。 4)redistributed:广播重分布路由(假定已配置重分布功能)。 5)receive-only:不广播任何路由。 注意:虽然stub不转发Query消息,但仍然要与其他路由器建立邻接关系。 ●EIGRP的负载均衡 与RIP一样,EIGRP最多允许6条等metric路由同时装入路由表。不过,由于metric计算的复杂性,可能几条路由的metric只是非常接近,而并不会完全相等。这时可以使用variance multiplier命令来调整。multiplier定义为FD的乘数因子,如果有其它路由的metric小于variance*FD,那么可将它们看作等metric路由同时加入路由表(注意,这些路由必须首先是FS路由)。 一旦将到同一目的多条路由加入路由表,EIGRP就可以实现负载均衡。以下是一些与负载均衡相关的EIGRP子命令(在router eigrp下配置): 1)variance:任何metric小于variance值乘以FD的FS路由可以加入路由表(但必须在maximum-paths命令限制之内)。 2)maximum-paths {1...6}:到同一目的最多路由条数(默认为4)。 3)traffic-share balanced:路由器在多条路由间执行负载均衡,metric值越低,分载流量越多。 4)traffic-share min:尽管装入了多条路由,仍然使用最小metric路由发送流量。 5)traffic-share balanced across-interfaces:如果有超出maximum-paths设置的路由存在,路由器会针对外发接口的不同来选择路由,这样可以更好地均衡负载。 6)未配置traffic-share命令:平均负载到多条路由,而不考虑其metric大小。 ●EIGRP认证 EIGRP的认证方式与OSPF很类似,要求基于每个端口创建密钥和激活认证。 EIGRP也允许多个密钥组成密钥链,其含义与设置和RIP类似。 Cisco激活EIGRP认证的接口子命令是:ip authentication mode eigrp asn md5,如果使用密钥链,命令为:ip authentication key-chain eigrp asn key_name。 ●EIGRP的自动汇总 EIGRP默认使用自动汇总,可以在router eigrp process下使用no auto-summary命令屏蔽它(建议你这么做)。 ●EIGRP分割范围 EIGRP会使用分割范围来限制其更新,可以使用no ip split-horizon eigrp asn接口子命令来屏蔽分割范围(一般不建议你这么做)。 ●EIGRP路由过滤 外发和进入的EIGRP更新可以基于每个接口过滤,也可以过滤整个EIGRP进程。要过滤路由,在router eigrp asn下使用distribute-list命令,它将引用ACL来匹配路由。 EIGRP分发列表的完整命令格式: distribute-list {access-list-number | name} {in | out} [interface-type interface-number] EIGRP的分发列表也可以引用前缀列表,其命令格式如下: distribute-list {prefix list-name} {in | out} [interface-type interface-number] 注意:对进入路由的过滤不会直接影响路由表,但是会阻止拓扑信息进入EIGRP拓扑表,这样仍然可以间接影响路由表的更新。 ●EIGRP偏移列表 与RIP的偏移列表一样,EIGRP的偏移列表也可以用来增加路由的metric。偏移列表引用ACL来匹配路由。需要注意的是,偏移列表对RIP更有用,而并不太适合EIGRP使用,因为EIGRP已经有复杂的metric计算方法了,偏移列表作用十分有限。 ●清除IP路由表 对于EIGRP,用常规的clear ip route *命令来清除路由并不那么有效。因为它还有一张拓扑表,如果仅仅清除路由表,新的路由会依旧使用已有拓扑表信息重新填入。所以必须同时使用clear ip eigrp neighbor清除所有邻接关系,这样就相当于清除了整个拓扑表,其命令格式如下: clear ip eigrp neighbors [ip-address | interface-type interface-number] EIGRP高级配置(1)本节主要针对EIGRP协议配置申的被动接口和不等度量值负载均衡的配置进行演示和讲解。
1.实验目的
通过本实验,读者可以掌握以下技能 配置EIGRP被动接口; 配置不等度量值负载均衡; 监测EIGRP协议相关信息。
2.设备需求
本实验需要以下设备。 ●Cisco路由器3台,分别命名为R1、R2和R3。其中R1具有1个串行接口;R2具有 ●2个串行接口和1个以太网接口;R3具有1个串行接口和2个以太网接口。 ●2条DCE电缆和2条DTE电缆,或2条DCE转DTE电缆。 ●1条交叉线序双绞线。 ●1台终端服务器,如Cisco2509路由器,及用于反向Telnet的相应电缆。 ●1台带有超级终端程序的PC机,以及Console电缆及转接器。
3.拓扑结构及配置说明
实验的拓扑结构如图6-3所示。首先把DCE申缆和DTE电缆进行对接,组成2对电缆,然后用这2对电缆把R1和R3,R2和R3连接起来。然后通过交叉线序双绞线把R2和R3连接起来。
各路由器使用的接口及其编号见图6-3中的标注。 各接口IP地址分配如下: R1: 51 201.1.13.1/30, L0 192.1.1.1/24 R2: 50 201.1.23.1/30, E0 200.1.1.2/24, L0 192.1.2.2/24 R3: 50 201.1.23.2/30, S1 201.1.13.2/30, E0 200.1.1.3/24 实验中R1、R3之间和R2、R3之间的串行线路速率设置为2000kbit/s。
4.实验配置及监测结果
首先对3台路由器进行接口配置和EIGRP基本配置,各路由器的配置见配置清单6-2。
配置清单6-2实验3路由器基本配置
R1#sh runn Building configuration...
Current configuratptime service timestamps log uptime no service password-encryption ! hostname R1 ! ip subnet-zero ! interface Loopback0 ip address 192.1.1.1255.255.255.0 ! interface Serial 1 bandwidth 2000 ip address 201.1.13.1 255.255.255.252 clockrate 2000000 ! router EIGRP 200 network 192.1.1.0 network 201.1.13.0 0.0.0.3 no auto-summary no EIGRP Sog-neighbor-chailges ! ip classless ip http server ! line con 0 line aux 0 line vty 0 4 password Cisco login ! end R1# 第2段:R2路由器配置清单 R2#sh run Building configuration...
Current configuration : 733 bytes ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 ! no logging console ip subnet-zero no ip finger! ! interface Loopback0 ip address 192.1.2.2 255.255.255.0 ! interface Ethemet0 ip address 200.1.1.2 255.255.255.0 ! interface Serial0 bandwidth 2000 ip address 201.1.23.1 255.255.255.252 ! router EIGRP 200 network 192.1.2.0 network 200.1.1.0 network 201.1.23.0 0.0.0.3 no auto-summary no EIGRP log-neighbor-changes ! ip classless ip http server ! line con 0 line aux 0 line vty 0 4 ! end R2# 第3段:R3路由器配置清单 R3#sh runn Building configuration... Current configuration : 744 bytes ! version 12.1 service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R3 ! ip subnet-zero no ip finger ! interface Ethemet0 ip address 200.1.1.3 255.255.255.0 ! interface Serial0 bandwidth 2000 ip address 201.1.23.2 255.255.255.252 no fair-queue clockrate 2000000 ! interface Serial 1 bandwidth 2000 ip address 201.1.13.2 255.255.255.252 ! router EIGRP 200 network 200.1.1.0 network 201.1.13.0 0.0.0.3 network 201.1.23.0 0.0.0.3 no auto-summary no EIGRP log-neighbor-changes ! ip classless ip http server ! line con 0 line aux 0 line vty 04 ! end 对于上述配置,没有太多需要说明的,请读者注意串行接口配置和网络声明语句两处容易出现错误的部分。 在以上EIGRP路由正常配置的基础上,我们来进行被动接口和不等度量值负载均衡方面的实验。监测清单6-3记录了实验的全过程。
监测清单6-3设置EIGRP被动接口及不等度量值负载均衡
第1段:设置被动接口 R3#sh ip route EIGRP D 192.1.1.0/24[90/40640000]via 201.1.13.1,00:01:40,Serial1 D 192.1.2.0/24[90/409600]via 200.1.12.1,00:03:36,Ethernet0 R3#sh ip EIGRP neighbor IP-EIGRP neighbors for process 200 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 1 201.1.13.1 Se1 10 00:01:51 810 4860 0 10 2 201.1.23.1 Se0 12 00:34:57 224 1344 0 23 0 200.1.1.2 Et0 12 00:38:57 12 200 0 24 R3#sh Enter configuration commands,one per line.End with CNTL/Z. R3(config)#router EIGRP 200 R3(config-router)#passive-interface s1 R3(config-router)#^Z R3#sh 01:40:23:%SYS-5-CONFIG_I:Configured from console by console R3:sh ip route EIGRP D 192.1.2.0/24[90/409600]via 200.1.12.1,00:04:16,Ethernet0 R3#sh ip eigr neighbor IP-EIGRP neighbor IP-EIGRP neighbors for process 200 H Address Interface Hold Uptime SRTT RTO Q Seq Type (sec) (ms) Cnt Num 2 201.1.13.1 Se0 11 00:35:35 149 894 0 28 0 200.1.1,2 Et0 11 00:39:36 11 200 0 27 R3#sh ip protocol Routing Protocol is "EIGRP 200" Outgoing update filter list for all interfaces is Incoming update filter list for all interfaces is Default networks flagged in outgoing updates Default networks accepted from incoming updates EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0 EIGRP maximum hopcount 100 EIGRP maximum metric variance 1 Redistributing: EIGRP 200 Automatic network summarization is not in effect Routing for Networks: 200.1.1.0 201.1.13.0/30 201.1.23.0/30 Passive lnterface(s): Serial1 Routing Information Sources: Gateway Distance Last Update 201.1.13.1 90 00:02:39 200.1.1.2 90 00:00:27 201.1.23.1 90 00:00:27 Distance: internal 90 external 170 第2段:设置不等度量值负载均衡 R3# R3#sh ip EIGRP topology IP-EIGRP Topology Table for AS(200)/ID(201.1.23.2) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 192.1.2,0/24, 1 successors, PD is 409600 via 200.1.1.2(409600/128256),Ethernet0 P201.1.13.1/30,1 successors,FD is 40512000 via Connected, Serial1 P 200.1,1.0/24, 1 successors,FD is 281600) via Connected,Ethernet0 P201.1,23.0/30,1 successors,FD is 1792000 via Connected, Setial0 R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#router EIGRP 200 R3(config-router)#variance 5 R3(config-router)#no passive-int si R3(config-router)#^Z R3#sh ip route Codes: C - connected, S - static, I - igrp, R - RIP, M - mobile, B - BGP D - EIGRP, EX - external, 0 - 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, E - EGP i - IS-IS, 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 201.1.23.0/30 is subnetted, i subnets C 201.1.23.01s directly connected, Serial0 C 200.1.1.0/24 is directly connected, Ethernet0 201.1.13.0/30 is subnetted, 1 subnets C 201.1.13.0 is directly connected, Serial1 D 192.1.2.0/24[90/1920000]via 201.1.13.2,00:00:43, Serial1 D 192.1.2.0/24[90/409600]via 200.1.1.2,00:00:43, Ethernet0 R3#cle ip route * R3#sh ip route Codes: C - connected, S - static, I - igrp, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, 0 - 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, E - EGP i - IS-IS, 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 201.1.23.0/30 is subnetted, 1 subnets C 201.1.23.01s directly connected, Serial0 C 200.1.1.0/24 is directly connected, Ethemet0 201.1.13.0/30 is subnetted, 1 subnets C 201.1.13.01s directly connected. Serial 1 D 192.1.1.0/24[90/1920000]via 201.1.13.1,00:00:02,Serial1 D 192.1.2.0/24[90/409600]via 200.1.1.2,00:00:02,Ethernet0 [90/1920000]via 201.1.23.1,00:00:02,Serial0 R3# Term_Server>2 [Resuming connection 2 to R2 ... ] R2#sh ip EIGRP topology IP-EIGRP Topology Table for AS(200)/ID( 192.1.2.2) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status
P 192.1.1.0/24,1 successors,FD is 1945600 via 200.1.1.3(1945600/1920000),Ethernet0 via 201.1.23.2(2432000/1920000),Serial0 P 192.1.2.0/24, 1 successors, FD is 128256 via Connected, Loopback0 P 201.1.13.0/30, 1 successors, FD is 1817600 via 200.1.1.3(1817600/1792000),Ethernet0 via 201.1.23.2(234000/1792000),Serial0 P 200.1.1.0/24, 1 successors, FD is 281600 via Connected, Ethemet0 P 201.1.23.0/30, 1 successors, FD is 1792000 via Connected, Serial0 R2#sh ip route ei 201.1.13.0/30 is subnetted, 0 subnets D 201.1.13.0[90/1817600]via 200.1.1.3,00:05:12,Ethernet0 D 192.1.1.0/24[90/1945600]via 200.1.1.3,00:05:12,Ethernet0 R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router EIGRP 200 R2(config-router)#variance 5 R2(ccmfig-router)#^Z R2#cle ip route * R2#sh ip route EIGRP 201.1.13.0/30 is subnetted, 1 subnets D 201.1.13.0 [90/1817600] via 200.1.1.3, 00:00:05, Ethernet0 [90/2304000] via 201.1.23.2, 00:00:05, Serial0 D 192.1.1.0/24 [90/1945600] via 200.1.1.3, 00:00:05,Ethernet0 [90/2432000] via 201.1.23.2, 00:00:05, Serial0 R2# R2#conft Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router EIGRP 200 R2(config-router)#maximum-paths 1 R2(config-router)#^Z R2#sh ip route EIGRP 201.1.13.0/30 is subnetted, 1 subnets D 201.1.13.0 [90/1817600] via 200.1.1.3,00;00:06, Ethern
使用EIGRP的监测和诊断命令有一些Show和Debug命令是监测和诊断EIGRP协议的配置时常用的,熟悉这些俞令,将有利于对EIGRP进行配置和排障。本节对这些命令进行演示和讲解。
1.实验目的
通过本实验,读者可以掌握以下技能 查看EIGRP的流量信息; 查看EIGRP拓扑信息, 监测EIGRP相关信息。
2.设备需求及拓扑结构
本实验是在实验1配置成功的基础上进行的,设备和拓扑结构与实验1完全相同。为了阅读上的方便,现将拓扑结构图复制到这里,见图6-2。
3.实验配置及监测结果
本实验主要演示show ip EIGRP topoTogy、show ip EIGRP traffic、debug ip EIGRP和debug EIGRP packet等命令的用法和输出结果。 监测清单6-2记录了实验的全过程,随后有对相应内容的讲解。
监测清单6-2 使用EIGRP常用的监测和诊断命令
R1# R1#sh ip EIGRP ? interfaces IP-EIGRP mterfaces neighbors IP-Bigrp neighbors topology IP-EIGRP Topology Table traffic IP-EIGRP Traffic Statistics R1#sh ip EIGRP topology IP-EIGRP Topology Table for AS(100)/ID(10.1.1.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 10..1.1.O/24, 1 successors, FD is 128256 via Connected, Loopback0 P 201.1.12.0/30, 1 successors, FD is 1792000 via Coimected, Serial0 P 201,1.13.0/30, 1 successors.FD is 1792000 via Connected, Serial 1 P 200.1.1.0/24, 2 successors, 3FT>is 1817600 via 201,1.13,2 (181760028160), Serial1 via 201.1.12.2 (1817600/281101, Serial0 R1#sh ip EIGRP traffic IP-EIGRP Traffic Statistics for process 100 Hellos sent/received:2469/2341 Updates :seBt/received:8/8 Queries seBt/received: 0/0 Replies seat/received: 0/0 Acks sent/received: 4/4 Input queue high water mark 2, 0 drops SIA-Queries sent/received: 0/0 SIA-Replies sent/received: 0/0 R1#conft Enter configuration commands, one per line. End with CNTL/Z. R1(config)#logg console R1(config)#^Z 01:44:12: %SYS-5-CONFIG_1: Configured from console by console R1#debug ip EIGRP IP-EIGRP Route Events debugging is on R1# R1#conft Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int si R1(config-if)#shut R1(config-if)#^Z R1# 01:47:45:IP-EIGRP: 201.1.13.0/30 -do advertise out Serial0 01:47:45: IP"EIGRP: Int 201,1,13.0/30 metric 4294967295-04294967295 01:47:45: IP-EIGRP: Processiag incoming REPLY packet 01:47:45: IP-EIGRP: Int 201.1,13.0/30 M 2329600-1280000 1049600 SM 1817600 - 1280000537600 01:47:45: IP-EIGRP: 201.1.13.0/30 routing table not updated 01:47:45: IP-EIGRP: Int 201.1.13.0/30 metric 2329600- 1280000 1049600 R1# 01:47:47: %LINK-5-CHANGED: Interface Seriall, changed state to administratively down R1# R1#imdebug all All possible debugging has been turned off R1#debug EIGRP packet EIGRP Packets debugging is on (UPSTATE, REQUEST, QUBRY, REPLY, HELLO, IPXSAP, PROBE, ACK, STUB, SIAQUERY,SIAREPLY) R1# 01:48:17: EIGRP: Sending HELLO onLoopback0 01:48:17: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQun/rely 0/0 01:48:17: EIGRP: Received HELLO on LoopbackO nbr 10.1.1.1 01:48:17: AS 100, Flags 0x0, Seq O/OidbQ 0/0 01:48:17: EIGRP: Packet from ourselves ignored R1# 01:48:19: Sending HELLO on Serial0 01:48:19: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 R1# 01:48:20: EIGRP: Received HELLO on nbr 201.1.12.2 01:48:20: AS 100, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0 R1#undebug all R1# R1#sh ip route D 200.L 1.0/24[90/1817600} via 201.1.12.2, 01:02:29, Serial0 (1)show ip EIGRP命令下有4个子命令,即interfaces、neighbors、topology和traffic,分别查看EIGRP协议的接口、邻居。拓扑和流量等信息。本实验中重点考察topology和traffic。两个子命令。 (2)show ip EIGRP topology命令列出从EIGRP协议所获取的所有路由信息。 实验中给出了在R1路由器上使用此命令的结果,其中前3项(10.1.1.0/24、201.1.12.0/30和201.1.13.0/30)是直连接口上的网段。最后1项(200.1.1.0/24)有2个路由信息源,即R2和R3的IP地址。 show ip EIGRP topology命令给出所有EIGRP路由信息,但并不是说所有这些信息都进入路由表而被路由器所使用,只有最佳的路由才被使用。最佳的路由就是度量值最小的路由。 (3)show ip EIGRP traffic命令显示了EIGRP协议所产生和使用的各种信息包的发送和接收情况,其中主要有Hello、Update(更新)、Query(查询)。Reply(应答)、ACK(确认)几种包的类型。缺省情况下Hello包每5s钟发送1次,所以它的收发数最多;在一个稳定运行的网络中,其他各种包都较少。 (4)debu ip EIGRP监测IP EIGRP路由事件信息。为了查看路由变化的情况,我们手工把R1路由器的S1接口关闭,查看输出的Debug信息。监测表明有关201.1.13.0/30网段的路由信息己经出现变化。 (5)debug EIGRP packet命令主要监测EIGRP使用的各种信息包的收发情况,实验记录中主要是Hello包的信息。 (6)最后我们看到,关闭了S1接口后,R1路由器的路由表中只有通过201.1.12.2到达200.1.1.0/24网段这一条路由。
|
|