R1:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#line con 0
Router(config-line)#logg sy
Router(config-line)#exec-t 0 0
Router(config-line)#exi
Router(config)#no ip domain-lo
Router(config)#host R1
R1(config)#int s 1
R1(config-if)#ip add 10.10.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#clo ra 64000
R1(config-if)#exi
R1(config)#
*Mar 1 00:23:29.347: %LINK-3-UPDOWN: Interface Serial1, changed state to up
R1(config)#
*Mar 1 00:23:30.351: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to up
R1(config)#
R2:
R2#en
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int s 1
R2(config-if)#ip add 10.10.10.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#int s 0
R2(config-if)#ip add 20.20.20.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#clo ra 64000
R2(config-if)#exi
R2(config)#
R3:
R3>en
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int s 1
R3(config-if)#ip add 20.20.20.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exi
R3(config)#
以上的配置已经可以完成由R2分别与R1和R3的通信,测试结果如下:
R2#ping 10.10.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/34/36 ms
R2#ping 20.20.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 20.20.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/34/36 ms
R2#
回R1启动EIGRP协议。
R1(config)#router eigrp ?
<1-65535> Autonomous system number ←实则为EIGRP的进程号,也可被用来用自治系统号进行分配。
R1(config)#router eigrp 1
R1(config-router)#net 10.10.10.0 ? ←宣告网络
A.B.C.D EIGRP wild card bits ←EIGRP支持VLSM,可以在这里输入通配符掩码进行精确匹配。
<cr> ←直接确定
R2、R3同时都需要运行EIGRP使R1可以与R3相互交换信息,R2、R3的配置如下:
R2:
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router eigrp 1
R2(config-router)#net 10.10.10.0
*Mar 1 01:10:21.591: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 10.10.10.1 (Serial1) is up: new adjacency ←与邻居10.10.10.1建立邻接关系成功,如何建立的细节请参阅IT傻博士课程。
R2(config-router)#net 20.20.20.0
R2(config-router)#exi
R2(config)#
*Mar 1 01:10:37.699: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 20.20.20.2 (Serial0) is up: new adjacency ←与邻居20.20.20.2建立邻接关系。
R2(config)#
R3:
R3(config)#
R3(config)#router eigrp 1
R3(config-router)#net 20.20.20.0
R3(config-router)#exi
R3(config)#
*Mar 1 01:09:13.887: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 20.20.20.1 (Serial1) is up: new adjacency ←与邻居20.20.20.1建立邻接关系。
R3(config)#
我们接着在R3上查看路由表可以看见到达R1的路由已经出现,如下。
R3#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
20.0.0.0/24 is subnetted, 1 subnets
C 20.20.20.0 is directly connected, Serial1
D 10.0.0.0/8 [90/2681856] via 20.20.20.1, 00:39:05, Serial1
R3#
首先我们来分解看一下本条通过EIGRP学习到的路由条目。
D 10.0.0.0/8 [90/2681856] via 20.20.20.1, 00:39:05, Serial1
D: 代表EIGRP。
0.0.0.0/8: 为我们宣告的网络,在此的形式为主类,因为EIGRP在通过边界路由的时候将进行自动汇总。
[90/2681856]: 括号内的90表明EIGRP的管理距离为90,2681856为到达10.0.0.0/8这条链路的开销值。
via 20.20.20.1: 下一跳邻居接口。
01:07:51: 时间标记。
Serial1: 本地接口。
在[90/2681856]一项内管理距离的值各协议不同,并且随厂家的不同也有不同,定义管理距离值除了各企业以外IETF工程小组也有相关定义。
2681856为到达目的地的Metric值(度量)其计算公式如下:
BW igrp metric = 10000000/带宽(kbit/s)
DLY igrp metric = 延迟总和(微秒microseconds)/10
BW eigrp metric = 10000000/带宽(kbit/s)* 256
DLY eigrp metric = 延迟总和(微秒microseconds)/10 * 256
通过show ip route 10.10.10.0 可查看相关路由的详细参数。
R3#show ip route 10.10.10.0
Routing entry for 10.0.0.0/8
Known via "eigrp 1", distance 90, metric 2681856, type internal
Redistributing via eigrp 1
Last update from 20.20.20.1 on Serial1, 01:17:54 ago
Routing Descriptor Blocks:
* 20.20.20.1, from 20.20.20.1, 01:17:54 ago, via Serial1
Route metric is 2681856, traffic share count is 1
Total delay is 40000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
R3#
从以上R3#show ip route 10.10.10.0命令输入的相关信息可以看到到达目的地10.10.10.0的延迟总和为4000微秒,而Eigrp的带宽用整个链路的最小带宽为1544Kbit/s,经过计算,算出来的metric的值为2681856,而直接套用如上公式进行计算,计算的结果有一定的偏差,实际的链路带宽应为1544.163063619518221124Kb通过此值进行运算即可得到metric为2681856。图示如下:
