详解BSCI实验三、配置OSPF与EIGRP的路由再发布

本文涉及的产品
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
云数据库 Tair(兼容Redis),内存型 2GB
简介:
实验三、配置Ospf与Eigrp的路由再发布
 
环境:三台路由器串口相连,接口配置如图
要求:1.配置EIGRP和关闭自动路由汇总
2.在R1上配置LOOP口的EIGRP手工路由汇总
3.在R2和R3配置Ospf 接口验证
4.在ASBR(R2)上做eigrp和ospf双向再发布
5.在R3上将所有loopback 口再发布到ospf中,但loopback2不能被R2,R3学到,不允许使用network命令
6.练习本课所有show命令
 
 
步骤一:配置三个路由器接口使其连通。
 
R1的配置
R1(config)# interface Loopback0
R1(config-if)#ip address 172.168.1.1 255.255.255.0
R1(config)# interface Loopback1
R1(config-if)#ip address 172.168.2.1 255.255.255.0
R1(config)#interface Loopback2
R1(config-if)#ip address 172.168.3.1 255.255.255.0
R1(config)# interface s0
R1(config-if)# ip address  10.1.1 .1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
 
R2的配置
R2(config)#interface s0
R2(config-if)#ip address  20.1.1 .1 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface s1
R2(config-if)# ip address  10.1.1 .1 255.255.255.0
R2(config-if)#no shutdown
 
R3的配置
R3(config)# interface Loopback0
R3(config-if)#ip address 192.168.1.1 255.255.255.0
R3(config)# interface Loopback1
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config)#interface Loopback2
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config)# interface s1
R3(config-if)# ip address  20.1.1 .2 255.255.255.0
R3(config-if)#clock rate 64000
R3(config-if)#no shutdown
 
 
步骤二: 配置Eigrp ,Ospf
 
R1的配置
R1(config)# router eigrp 100  à启用EIGRP
R1(config-router)# network  10.1.1 .0 0.0.0.255  à发布相应接口
R1(config-router)#network 172.168.1.0  0.0.0 .255
R1(config-router)#network 172.168.2.0  0.0.0 .255
R1(config-router)#network 172.168.3.0  0.0.0 .255
R1(config-router)# no auto-summary  à关闭自动汇总
 
R2的配置
R2(config)# router eigrp 100
R2(config-router)# network  10.1.1 .0 0.0.0.255
R2(config-router)# no auto-summary
R2(config)# router ospf 10  àR2上即启用EIGRP并且启用OSPF
R2(config-router)# network  20.1.1 .0 0.0.0.255 area 0
 
R3的配置
R3(config)# router ospf 10
R3(config-router)# network  20.1.1 .0 0.0.0.255 area 0
 
 
步骤三:配置EIGRP手工路由汇总和Ospf接口验证
 
R1的配置
R1(config)# interface s0
R1(config-if)# ip summary-address eigrp 100 172.168.0.0 255.255.252.0 à手工汇总
 
R2的配置
R2(config)# interface s0
R2(config-if)# ip ospf authentication message-digest  à启用接口验证
R2(config-if)# ip ospf message-digest-key 1 md5 cisco
 
R3的配置
R3(config)# interface s1
R3(config-if)# ip ospf authentication message-digest  à启用接口认证
R3(config-if)# ip ospf message-digest-key 1 md5 cisco
 
 
步骤四:在R2,R3上做路由再发布并控制loopback2不能被R1,R2学到
 
R2的配置
R2(config)# router eigrp 100
R2(config-router)# redistribute ospf 10 metric 10000 100 255 1 1500àospf重分发进eigrp
R2(config)# router ospf 10
R2(config-router)# redistribute eigrp 100 subnets  àeigrp路由重分发到ospf
 
R3的配置
R3(config)# access-list 1 permit 192.168.1.0  0.0.0 .255  à定义分发条件列表
R3(config)# access-list 1 permit 192.168.2.0  0.0.0 .255
R3(config)# access-list 2 permit 192.168.3.0  0.0.0 .255
R3(config)# route-map o-e permit 10   à做映射列表允许相应条目
R3 (config-route-map)# match ip address 1  à将列表加载
R3(config)# route-map o-e deny 20  à拒绝相应条目的映射列表
R3 (config-route-map)# match ip address 2  à将列表加载
R3(config)# route-map o-e permit 25  à最后允许其它所有
R3(config)# router ospf 10
R3(config-router)# redistribute connected subnets route-map o-e
 
 
步骤五:查看路由表
 
R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, 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
 
      20.0.0 .0/24 is subnetted, 1 subnets
D EX     20.1.1 .0 [170/2195456] vi a 10.1.1 .2, 00:03:50, Serial0  à外部路由条目
     172.168.0.0/16 is variably subnetted, 4 subnets, 2 masks
D       172.168.0.0/22 is a summary, 00:03:56, Null0
C       172.168.1.0/24 is directly connected, Loopback0
C       172.168.2.0/24 is directly connected, Loopback1
C       172.168.3.0/24 is directly connected, Loopback2
      10.0.0 .0/24 is subnetted, 1 subnets
C        10.1.1 .0 is directly connected, Serial0
D EX 192.168.1.0/24 [170/2195456] vi a 10.1.1 .2, 00:01:53, Serial0
D EX 192.168.2.0/24 [170/2195456] vi a 10.1.1 .2, 00:01:53, Serial0
 
R2#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, 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
 
      20.0.0 .0/24 is subnetted, 1 subnets
C        20.1.1 .0 is directly connected, Serial0
     172.168.0.0/22 is subnetted, 1 subnets
D       172.168.0.0 [90/2297856] vi a 10.1.1 .1, 00:05:39, Serial1
      10.0.0 .0/24 is subnetted, 1 subnets
C        10.1.1 .0 is directly connected, Serial1
O E2 192.168.1.0/24 [110/20] vi a 20.1.1 .2, 00:03:42, Serial0  àospf外部路由条目类型2
O E2 192.168.2.0/24 [110/20] vi a 20.1.1 .2, 00:03:42, Serial0
 
R3#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, 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
 
      20.0.0 .0/24 is subnetted, 1 subnets
C        20.1.1 .0 is directly connected, Serial1
     172.168.0.0/22 is subnetted, 1 subnets
O E2    172.168.0.0 [110/20] vi a 20.1.1 .1, 00:04:48, Serial1
      10.0.0 .0/24 is subnetted, 1 subnets
O E2     10.1.1 .0 [110/20] vi a 20.1.1 .1, 00:04:48, Serial1
C    192.168.1.0/24 is directly connected, Loopback0
C    192.168.2.0/24 is directly connected, Loopback1
C    192.168.3.0/24 is directly connected, Loopback2
 
 
步骤六:用ping命令测试连通性
R1#ping 192.168.2.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/64 ms
 
R3#ping 172.168.1.1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/60/60 ms
 
 
步骤七:查看配置
 
R1#sh run
hostname R1
!
interface Loopback0
 ip address 172.168.1.1 255.255.255.0
!
interface Loopback1
 ip address 172.168.2.1 255.255.255.0
!
interface Loopback2
 ip address 172.168.3.1 255.255.255.0
!
interface Serial0
 ip address  10.1.1 .1 255.255.255.0
 ip summary-address eigrp 100 172.168.0.0 255.255.252.0 5
 clockrate 64000
!
router eigrp 100
 network  10.1.1 .0 0.0.0.255
 network 172.168.1.0  0.0.0 .255
 network 172.168.2.0  0.0.0 .255
 network 172.168.3.0  0.0.0 .255
 no auto-summary
!
end
 
R2#sh run
hostname R2
!
interface Serial0
 ip address  20.1.1 .1 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 cisco
!
interface Serial1
 ip address  10.1.1 .2 255.255.255.0
!
router eigrp 100
 redistribute ospf 10 metric 10000 100 255 1 1500
 network  10.1.1 .0 0.0.0.255
 no auto-summary
!
router ospf 10
redistribute eigrp 100 subnets
 network  20.1.1 .0 0.0.0.255 area 0
!
end
 
R3#sh run
hostname R3
!
interface Loopback0
 ip address 192.168.1.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback1
 ip address 192.168.2.1 255.255.255.0
 ip ospf network point-to-point
!
interface Loopback2
 ip address 192.168.3.1 255.255.255.0
 ip ospf network point-to-point  à定义网络类型,否则为主机路由32位
!
interface Serial1
 ip address  20.1.1 .2 255.255.255.0
 ip ospf authentication message-digest
 ip ospf message-digest-key 1 md5 cisco
 clockrate 64000
!
router ospf 10
redistribute connected subnets route-map o-e
 network  20.1.1 .0 0.0.0.255 area 0
!
access-list 1 permit 192.168.1.0  0.0.0 .255
access-list 1 permit 192.168.2.0  0.0.0 .255
access-list 2 permit 192.168.3.0  0.0.0 .255
route-map o-e permit 10
 match ip address 1
!
route-map o-e deny 20
 match ip address 2
!
route-map o-e permit 25
!
end



    本文转自hexianguo 51CTO博客,原文链接: http://blog.51cto.com/xghe110/89992 ,如需转载请自行联系原作者
相关文章
|
存储 弹性计算 运维
数据灾备中心:创新性企业灾备管理服务
阿里云数据灾备中心旨在提供创新的灾备解决方案,确保企业业务连续性和数据安全。面对数据风险,如误删、勒索软件等,即使在公共云上,企业仍需灾备措施。数据灾备中心提供统一管理,通过3-2-1法则实现全面保护,特色包括统一覆盖多种资源、直观的星级评分和3D展示、简化运维流程。未来将推出更多功能,如资源分组评分、一体化策略中心、定制报表和消息中心,以支持不同行业的高要求,如金融、医疗等。
24993 8
数据灾备中心:创新性企业灾备管理服务
|
消息中间件 关系型数据库 MySQL
Flink CDC 最佳实践(以 MySQL 为例)
Flink CDC 最佳实践(以 MySQL 为例)
3559 0
|
Java 关系型数据库 数据库连接
MyBatis逆向生成工具EasyCode(很强大)
MyBatis逆向生成工具EasyCode(很强大)
457 0
|
SQL 分布式计算 资源调度
大数据问题排查系列-大数据集群开启 kerberos 认证后 HIVE 作业执行失败
大数据问题排查系列-大数据集群开启 kerberos 认证后 HIVE 作业执行失败
|
Java 应用服务中间件 nginx
Java Web 实现文件上传和下载接口功能
Java Web 实现文件上传和下载接口功能
580 0
Java Web 实现文件上传和下载接口功能
|
弹性计算 运维 监控
【视频】实验二:ECS通过SNAT访问CLB|学习笔记
快速学习【视频】实验二:ECS通过SNAT访问CLB。
【视频】实验二:ECS通过SNAT访问CLB|学习笔记
|
JSON Java 数据库连接
SpringBoot 集成cas5.3 实现自定义认证策略
如果CAS框架提供的方案还是不能满足我们的需要,比如我们不仅需要用户名和密码,还要验证其他信息,比如邮箱,手机号,但是邮箱,手机信息在另一个数据库,还有在一段时间内同一IP输入错误次数限制等。这里就需要我们自定义认证策略,自定义CAS的web认证流程。
1521 0
|
数据处理 区块链
数字藏品平台需要办理哪些资质许可证?
数字藏品平台需要办理哪些资质许可证?
644 1
数字藏品平台需要办理哪些资质许可证?
|
JSON 算法 安全
金润·核验通-银行卡三要素验证接口文档
银行卡三要素验证接口介绍:不限银行,比对姓名、身份证号、银行卡号的一致性,核验持卡人信息真实性 更新时间:实时 接口类型:API接口 数据优势:直连官方数据,合法合规、权威、精确 数据安全:仅确认通过与不通过,保护个人信息安全 计费方式:核验计费,详情请咨询
金润·核验通-银行卡三要素验证接口文档
|
安全 关系型数据库 芯片
全面认识MOS管,一篇文章就够了
础知识中 MOS 部分迟迟未整理,实际分享的电路中大部分常用电路都用到了MOS管,今天势必要来一篇文章,彻底掌握mos管!
1955 1
全面认识MOS管,一篇文章就够了