eigrp配置实验_【实战演练】Packet Tracer玩转CCNA实验12-路由条目的AD值

#本文欢迎转载,转载请注明出处和作者。

1、理论解释

对于常用的IGP路由(内部网关路由)的动态路由协议,都已经说
过了。

以下是一条路由条目

O 24.1.1.0 [110/128] via 12.1.1.2, 00:00:04, Serial2/0

在show ip route的时候,有没有留意到除了路由类型,目的地址,出站接口外,还有个[110/128]这样的一个中括号呢?

前面的叫AD值,(Administrative Distance,管理距离)

后面的叫Metric值(度量值)

前者,是用来优先选择路由协议的,例如你1台路由器,既收到OSPF协议发来的路由条目,又收到RIP发过来的路由条目,并且到的是同一个地方,那么到底优先选优哪条路由呢?

  • 直连接口 0
  • 静态路由 1
  • EIGRP汇总路由 5
  • EBGP 20
  • EIGRP 90
  • IGRP 100
  • OSPF 110
  • IS-IS 115
  • RIP(v1&v2) 120
  • EGP 140
  • ODR 160
  • ExEIGRP (外部EIGRP) 170
  • IBGP 200

谁的管理距离小,优先选择谁。所以如果EIGRP与OSPF比较,90<110,优先选用EIGRP的路由条目。

Metric我们留下一节再讲。

2、实验配置

2.1拓扑如下:

8f8dd36880557896d885858c60aa8e9b.png

2.2预配置

注意这次除了lo 0 ,外接一台PC进行测试。

R1:

en
conf t
host R1
int lo 0
ip add 1.1.1.1 255.255.255.0
no shut
int se2/0
ip add 12.1.1.1 255.255.255.0
clock rate 64000
no shut
int se3/0
ip add 13.1.1.1 255.255.255.0
clo rate 64000
no shut

R2:

en
conf t
host R2
int lo 0
ip add 2.2.2.2 255.255.255.0
no shut
int se2/0
ip add 12.1.1.2 255.255.255.0
no shut
int se3/0
ip add 24.1.1.2 255.255.255.0
clock rate 64000
no shut

R3:

en
conf t
host R3
int lo 0
ip add 3.3.3.3 255.255.255.0
no shut
int se2/0
ip add 13.1.1.3 255.255.255.0
no shut
int se3/0
ip add 34.1.1.3 255.255.255.0
clock rate 64000
no shut

R4:

en
conf t
host R4
int lo 0
ip add 4.4.4.4 255.255.255.0
no shut
int se2/0
ip add 24.1.1.4 255.255.255.0
no shut
int se3/0
ip add 34.1.1.4 255.255.255.0
no shut
int fa0/0
ip add 192.168.1.254 255.255.255.0
no shut

PC1:

06b257378b4514aadf87904be5082f66.png

2.3配置单边的OSPF

先配置R1到R2到R4的OSPF

怎么做呢,就是启用OSPF进程,然后宣告的时候,注意只把这边的网段宣告进去就好

例如R1,只宣告1.1.1.0/24与12.1.1.0/24,不要宣告13.1.1.0/24进去OSPF进程即可。

R1:

router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0

R2:

router ospf 1
network 2.2.2.0 0.0.0.255 area 0
network 12.1.1.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 0

R4:

router ospf 1
network 4.4.4.0 0.0.0.255 area 0
network 24.1.1.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0

在R1上面show ip route

Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 12.1.1.2, 00:00:36, Serial2/0
     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/129] via 12.1.1.2, 00:00:10, Serial2/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial2/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.1.1.0 is directly connected, Serial3/0
     24.0.0.0/24 is subnetted, 1 subnets
O       24.1.1.0 [110/128] via 12.1.1.2, 00:00:36, Serial2/0
O    192.168.1.0/24 [110/129] via 12.1.1.2, 00:00:10, Serial2/0

能够看到R1已经有192.168.1.0/24的OSPF路由条目,ping 192.168.1.1,测试可达。

**注意此时的管理距离110,metric值129,下一跳接口是se2/0,也就是说R1->R2->R4->PC1

2.4配置单边的EIGRP链路

再配置R1到R3到R4的EIGRP,原理同上,启用EIGRP进程,增加宣告需要的网段。

R1:

router eigrp 1
no auto-summary
network 1.1.1.0 0.0.0.255
network 13.1.1.0 0.0.0.255 

R3:

router eigrp 1
no auto-summary
network 3.3.3.0 0.0.0.255
network 13.1.1.0 0.0.0.255 
network 34.1.1.0 0.0.0.255 

R4:

router eigrp 1
no auto-summary
network 4.4.4.0 0.0.0.255
network 34.1.1.0 0.0.0.255 
network 192.168.1.0 0.0.0.255

重新到R1 show ip route。

Gateway of last resort is not set
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     2.0.0.0/32 is subnetted, 1 subnets
O       2.2.2.2 [110/65] via 12.1.1.2, 00:01:47, Serial2/0
     3.0.0.0/24 is subnetted, 1 subnets
D       3.3.3.0 [90/20640000] via 13.1.1.3, 00:00:30, Serial3/0
     4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       4.4.4.0/24 [90/21152000] via 13.1.1.3, 00:00:20, Serial3/0
O       4.4.4.4/32 [110/129] via 12.1.1.2, 00:01:21, Serial2/0
     12.0.0.0/24 is subnetted, 1 subnets
C       12.1.1.0 is directly connected, Serial2/0
     13.0.0.0/24 is subnetted, 1 subnets
C       13.1.1.0 is directly connected, Serial3/0
     24.0.0.0/24 is subnetted, 1 subnets
O       24.1.1.0 [110/128] via 12.1.1.2, 00:01:47, Serial2/0
     34.0.0.0/24 is subnetted, 1 subnets
D       34.1.1.0 [90/21024000] via 13.1.1.3, 00:00:30, Serial3/0
D    192.168.1.0/24 [90/21026560] via 13.1.1.3, 00:00:20, Serial3/0

可以看到,到192.168.1.0/24.的路由,只剩下D类型的路由(EIGRP路由)。

管理距离90,下一跳地址是Se3/0,即R1->R3->R4->PC1

我们用traceroute命令跟踪一下,traceroute 192.168.1.1

traceroute 192.168.1.1
Type escape sequence to abort.
Tracing the route to 192.168.1.1

  1   13.1.1.3        48 msec   1 msec    1 msec    
  2   34.1.1.4        2 msec    3 msec    2 msec    
  3   192.168.1.1     3 msec    2 msec    2 msec  

为什之前的OSPF路由不见了呢,因为其实R1同时收到来自OSPF协议与来自EIGRP的关于到192.168.1.0/24目的地址的路由的,但是EIGRP的AD值(管理距离)是90,OSPF的AD值是110,所以优选小的,所以优选了EIGRP的路由条目放进了路由表。

下一节我们继续探讨中括号后面的Metric值。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值