当前位置: 首页 > news >正文

CCNP课程实验-03-Route_Path_Control_CFG

目录

  • 实验条件
    • 网络拓朴
    • 需求
  • 基础配置
  • 需求实现
    • 1.A---F所有区用Loopback模拟,地址格式为:XX.XX.XX.XX/32,其中X为路由器编号。根据拓扑宣告进对应协议。A1和A2区为特例,A1:55.55.55.0/24,A2:55.55.66.0/24
    • 2.照拓扑图配置EIGRP/OSPF路由协议,关闭所有自动汇总。OSPF手动指明RID为Loopback 0地址。
    • 3.R4做双向重分布,R6把OSPF重分布到EIGRP,要求全网ping通。如无明确说明,禁止使用静态路由,禁止直接使用ACL过滤数据。
    • 4. A1区网段为55.55.55.0/24,配置R6使其禁止从R7学到此网段(要求:使用前缀列表)
    • 5. 在R4上配置,要求EIGRP重分布到OSPF时,B区Metric值为100,类型为E1;C区Metric值为200,类型为E1。 其他路由按照默认设置。
    • 6. 在R1的Area 0中增加以下网段:11.11.1.0/24、11.11.2.0/24 (用Loopback模拟),要求在R2上配置最精确的路由汇总,并且只允许在III区学到该汇总路由。
    • 7. 要求A1到F区的数据流走R4,A2到E区的数据流走R6(R5带A1和A2的源地址采用Traceroute测试)
    • 8. 在R7上配置,使其路由表中显示去往E、F区的下一跳是R6。
    • 9. 在R4上配置,使其访问E区走 I 区 --> III 区,其他路线不变 (要求:不允许策略路由和分发列表)

实验条件

网络拓朴

在这里插入图片描述
拓扑中的IP地址段采用:172.8.AB.X/24,其中AB为两台路由器编号组合,
例如:R3-R6之间的AB为36,X为路由器编号,例如R3的X=3
所有路由器都有一个Loopback 0接口,地址格式为:X.X.X.X/32,其中X为路由器编号。
没有特殊要求,不允许使用静态路由。

需求

  1. A—F所有区用Loopback模拟,地址格式为:XX.XX.XX.XX/32,其中X为路由器编号。根据拓扑宣告进对应协议。A1和A2区为特例,A1:55.55.55.0/24,A2:55.55.66.0/24。
  2. 照拓扑图配置EIGRP/OSPF路由协议,关闭所有自动汇总。OSPF手动指明RID为Loopback 0地址。
  3. R4做双向重分布,R6把OSPF重分布到EIGRP,要求全网ping通。如无明确说明,禁止使用静态路由,禁止直接使用ACL过滤数据。
  4. A1区网段为55.55.55.0/24,配置R6使其禁止从R7学到此网段(要求:使用前缀列表)
  5. 在R4上配置,要求EIGRP重分布到OSPF时,B区Metric值为100,类型为E1;C区Metric值为200,类型为E1。 其他路由按照默认设置。
  6. 在R1的Area 0中增加以下网段:11.11.1.0/24、11.11.2.0/24 (用Loopback模拟),要求在R2上配置最精确的路由汇总,并且只允许在III区学到该汇总路由。
  7. 要求A1到F区的数据流走R4,A2到E区的数据流走R6(R5带A1和A2的源地址采用Traceroute测试)
  8. 在R7上配置,使其路由表中显示去往E、F区的下一跳是R6。
  9. 在R4上配置,使其访问E区走 I 区 --> III 区,其他路线不变 (要求:不允许策略路由和分发列表)

基础配置

R1

R1#show run | s interface
interface Loopback0ip address 1.1.1.1 255.255.255.255ip ospf 89 area 2
interface Ethernet0/0ip address 14.1.1.1 255.255.255.0ip ospf 89 area 2duplex auto
interface Ethernet0/1ip address 12.1.1.1 255.255.255.0ip ospf 89 area 0duplex auto
R1#show run | s rout 
router ospf 89router-id 1.1.1.1

R2

R2#show run | s interface 
interface Loopback0ip address 2.2.2.2 255.255.255.255ip ospf 89 area 0
interface Loopback1ip address 22.22.22.22 255.255.255.255
interface Ethernet0/0ip address 23.1.1.2 255.255.255.0ip ospf 89 area 3duplex auto
interface Ethernet0/1ip address 12.1.1.2 255.255.255.0ip ospf 89 area 0duplex auto
R2#show run | s route
router ospf 89router-id 2.2.2.2

R3

R3(config-if)#do show run | s interface
interface Loopback0ip address 3.3.3.3 255.255.255.255ip ospf 89 area 3
interface Loopback1ip address 33.33.33.33 255.255.255.255
interface Ethernet0/0ip address 23.1.1.3 255.255.255.0ip ospf 89 area 3duplex auto
interface Ethernet0/1ip address 36.1.1.3 255.255.255.0ip ospf 89 area 3duplex auto
R3(config-if)#do show run | s route
router ospf 89router-id 3.3.3.3

R4

R4(config-route-map)#do show run | s interface  
interface Loopback0ip address 4.4.4.4 255.255.255.255ip ospf 89 area 2
interface Loopback1ip address 44.44.44.44 255.255.255.255
interface Ethernet0/0ip address 14.1.1.4 255.255.255.0ip ospf 89 area 2duplex auto
interface Ethernet0/1ip address 47.1.1.4 255.255.255.0duplex auto
R4(config-route-map)#do show run | s route
router eigrp 1network 44.44.44.44 0.0.0.0network 47.1.1.4 0.0.0.0eigrp router-id 4.4.4.4
router ospf 89router-id 4.4.4.4

R5

R5(config-router)#do show run | s interface 
interface Loopback0ip address 5.5.5.5 255.255.255.255
interface Loopback1ip address 55.55.55.55 255.255.255.0
interface Loopback2ip address 55.55.66.66 255.255.255.0
interface Ethernet0/2ip address 57.1.1.5 255.255.255.0duplex auto
R5(config-router)#do show run | s route
router eigrp 1network 0.0.0.0eigrp router-id 5.5.5.5
R5(config-router)#

R6

R6(config-router)#do show run | s interface 
interface Loopback0ip address 6.6.6.6 255.255.255.255ip ospf 89 area 3
interface Loopback1ip address 66.66.66.66 255.255.255.255
interface Ethernet0/0ip address 67.1.1.6 255.255.255.0duplex auto
interface Ethernet0/1ip address 36.1.1.6 255.255.255.0ip ospf 89 area 3duplex auto
R6(config-router)#do show run | s route
router eigrp 1distribute-list prefix A1 in network 66.66.66.66 0.0.0.0network 67.1.1.6 0.0.0.0eigrp router-id 6.6.6.6
router ospf 89router-id 6.6.6.6
R6(config-router)#

R7

R7(config-router)#do show run | s route
router eigrp 1network 0.0.0.0eigrp router-id 7.7.7.7
R7(config-router)#do show run | s interface 
interface Loopback0ip address 7.7.7.7 255.255.255.255
interface Loopback1ip address 77.77.77.77 255.255.255.255
interface Ethernet0/0ip address 67.1.1.7 255.255.255.0duplex auto
interface Ethernet0/1ip address 47.1.1.7 255.255.255.0duplex auto
interface Ethernet0/2ip address 57.1.1.7 255.255.255.0duplex auto
R7(config-router)#do show run | s route
router eigrp 1network 0.0.0.0eigrp router-id 7.7.7.7
R7(config-router)#

需求实现

1.A—F所有区用Loopback模拟,地址格式为:XX.XX.XX.XX/32,其中X为路由器编号。根据拓扑宣告进对应协议。A1和A2区为特例,A1:55.55.55.0/24,A2:55.55.66.0/24

基础配置中已完成

2.照拓扑图配置EIGRP/OSPF路由协议,关闭所有自动汇总。OSPF手动指明RID为Loopback 0地址。

基础配置中已完成

3.R4做双向重分布,R6把OSPF重分布到EIGRP,要求全网ping通。如无明确说明,禁止使用静态路由,禁止直接使用ACL过滤数据。

R4:

router eigrp 1
redistribute ospf 89 metric 10000 100 255 1 1500router ospf 89
redistribute eigrp 1 subnets

R6:

router eigrp 1
redistribute ospf 89 metric 10000 100 255 1 1500

4. A1区网段为55.55.55.0/24,配置R6使其禁止从R7学到此网段(要求:使用前缀列表)

R6:

ip prefix-list A1 deny 55.55.55.0/24
ip prefix-list A1 permit 0.0.0.0/0 le 32
router eigrp 1
distribute-list prefix A1 in Ethernet0/0

5. 在R4上配置,要求EIGRP重分布到OSPF时,B区Metric值为100,类型为E1;C区Metric值为200,类型为E1。 其他路由按照默认设置。

R4:

access-list 1 permit 44.44.44.44
access-list 2 permit 66.66.66.66route-map BCarea permit 10match ip address 1set metric 100set metric-type type-1
route-map BCarea permit 20match ip address 2set metric 200set metric-type type-1
route-map BCarea permit 30router ospf 89
redistribute eigrp 1 subnets route-map BCarea

6. 在R1的Area 0中增加以下网段:11.11.1.0/24、11.11.2.0/24 (用Loopback模拟),要求在R2上配置最精确的路由汇总,并且只允许在III区学到该汇总路由。

R1:

interface Loopback1ip address 11.11.1.1 255.255.255.0
interface Loopback2ip address 11.11.2.1 255.255.255.0
router ospf 89network 11.11.1.1 0.0.0.0 area 0network 11.11.2.1 0.0.0.0 area 0

R2:

router ospf 89area 0 range 11.11.0.0 255.255.252.0

现在要将这个汇总的路由限制在III区内,那就是要在R6上重分布到I区时,拦截该条汇总路由,不让他分布进I区的eigrp协议中
R6:

ip prefix-list R1-summary permit 11.11.0.0/22	// 精确匹配这条路由route-map R1-summary deny 10		//拒绝match的路由match ip address prefix-list R1-summary
route-map R1-summary permit 20router eigrp 1redistribute ospf 89 metric 10000 100 255 1 1500 route-map R1-summary

7. 要求A1到F区的数据流走R4,A2到E区的数据流走R6(R5带A1和A2的源地址采用Traceroute测试)

这个需求可以使用策略路由来实现这个功能, 根据源地址来决定路由走向,先定义两个ACL
R7:

access-list 155 permit 55.55.55.0 0.0.0.255 host 22.22.22.22 // 扩展ACL
access-list 166 permit 55.55.66.0 0.0.0.255 host 33.33.33.33route-map PBR permit 10match ip address 155set ip next-hop 47.1.1.4
route-map PBR permit 20match ip address 166set ip next-hop 67.1.1.6A1A2区进入R7的时候,配置策略路由
interface ethernet 0/2ip policy route-map PBR

测试结果
R5:

R5#traceroute 22.22.22.22 source 55.55.55.55
Type escape sequence to abort.
Tracing the route to 22.22.22.22
VRF info: (vrf in name/id, vrf out name/id)1 57.1.1.7 0 msec 1 msec 0 msec2 47.1.1.4 0 msec 1 msec 0 msec3 14.1.1.1 1 msec 0 msec 1 msec4 12.1.1.2 0 msec *  1 msec
R5#traceroute 33.33.33.33 source 55.55.66.66
Type escape sequence to abort.
Tracing the route to 33.33.33.33
VRF info: (vrf in name/id, vrf out name/id)1 57.1.1.7 0 msec 1 msec 0 msec2 67.1.1.6 1 msec 0 msec 0 msec3 36.1.1.3 1 msec *  0 msec

8. 在R7上配置,使其路由表中显示去往E、F区的下一跳是R6。

去往E、F区的路由是 22.22.22.22 33.33.33.33
R7: 路由表

      22.0.0.0/32 is subnetted, 1 subnets
D EX     22.22.22.22 [170/307200] via 67.1.1.6, 04:00:32, Ethernet0/0[170/307200] via 47.1.1.4, 04:00:32, Ethernet0/133.0.0.0/32 is subnetted, 1 subnets
D EX     33.33.33.33 [170/307200] via 67.1.1.6, 03:46:12, Ethernet0/0[170/307200] via 47.1.1.4, 03:46:12, Ethernet0/1

从路由表上得到的信息是,等价负载均衡的,现在只需增大去往R4的metric值,使的R6的metric优先,就可以达到目的
R7:

access-list 10 permit 22.22.22.22
access-list 10 permit 33.33.33.33
router eigrp 1offset-list 10 in 1 ethernet 0/1	//从R4通告过来的,通过ethernet 0/1接口 进来的方向

路由表结果

      22.0.0.0/32 is subnetted, 1 subnets
D EX     22.22.22.22 [170/307200] via 67.1.1.6, 00:00:02, Ethernet0/023.0.0.0/24 is subnetted, 1 subnets
D EX     23.1.1.0 [170/307200] via 67.1.1.6, 00:00:02, Ethernet0/0[170/307200] via 47.1.1.4, 00:00:02, Ethernet0/133.0.0.0/32 is subnetted, 1 subnets
D EX     33.33.33.33 [170/307200] via 67.1.1.6, 00:00:02, Ethernet0/0
R7(config-router)#do show ip eigrp topology 22.22.22.22/32
EIGRP-IPv4 Topology Entry for AS(1)/ID(7.7.7.7) for 22.22.22.22/32State is Passive, Query origin flag is 1, 1 Successor(s), FD is 307200Descriptor Blocks:67.1.1.6 (Ethernet0/0), from 67.1.1.6, Send flag is 0x0Composite metric is (307200/281600), route is ExternalVector metric:Minimum bandwidth is 10000 KbitTotal delay is 2000 microsecondsReliability is 255/255Load is 255/255Minimum MTU is 1500Hop count is 1Originating router is 6.6.6.6External data:AS number of route is 89External protocol is OSPF, external metric is 21Administrator tag is 0 (0x00000000)47.1.1.4 (Ethernet0/1), from 47.1.1.4, Send flag is 0x0Composite metric is (307201/281600), route is ExternalVector metric:Minimum bandwidth is 10000 KbitTotal delay is 2000 microsecondsReliability is 255/255Load is 255/255Minimum MTU is 1500Hop count is 1Originating router is 4.4.4.4External data:AS number of route is 89External protocol is OSPF, external metric is 21Administrator tag is 0 (0x00000000)
  67.1.1.6 (Ethernet0/0), from 67.1.1.6, Send flag is 0x0Composite metric is (307200/281600), route is External47.1.1.4 (Ethernet0/1), from 47.1.1.4, Send flag is 0x0Composite metric is (307201/281600), route is External

R4上的路由metric FD值为307201,比R6上的307200大了1

9. 在R4上配置,使其访问E区走 I 区 --> III 区,其他路线不变 (要求:不允许策略路由和分发列表)

R4上查询路由表得到

      33.0.0.0/32 is subnetted, 1 subnets
O IA     33.33.33.33 [110/31] via 14.1.1.1, 00:20:20, Ethernet0/0

查询Eigrp拓扑表可以查到以下记录

R4#show ip eigrp topology 33.33.33.33/32                 
EIGRP-IPv4 Topology Entry for AS(1)/ID(4.4.4.4) for 33.33.33.33/32State is Passive, Query origin flag is 1, 1 Successor(s), FD is 281600Descriptor Blocks:14.1.1.1, from Redistributed, Send flag is 0x0Composite metric is (281600/0), route is ExternalVector metric:Minimum bandwidth is 10000 KbitTotal delay is 1000 microsecondsReliability is 255/255Load is 255/255Minimum MTU is 1500Hop count is 0Originating router is 4.4.4.4External data:AS number of route is 89External protocol is OSPF, external metric is 31Administrator tag is 0 (0x00000000)47.1.1.7 (Ethernet0/1), from 47.1.1.7, Send flag is 0x0Composite metric is (332800/307200), route is ExternalVector metric:Minimum bandwidth is 10000 KbitTotal delay is 3000 microsecondsReliability is 255/255Load is 255/255Minimum MTU is 1500Hop count is 2Originating router is 6.6.6.6External data:AS number of route is 89External protocol is OSPF, external metric is 11Administrator tag is 0 (0x00000000)

我的想法是通过在eigrp里修改distance,达到目的,具体是这样的

access-list 33 permit 33.33.33.33 router eigrp 1distance 109 47.1.1.7 0.0.0.0 33

但是可惜没有能达到目的,因为33.33.33.33是eigrp外部路由,不能生效。 所以就改将ospf OIA的AD值为110的那条记录。修改成171,因为eigrp外部路由的AD值为170,这样的话,ospf的那条路由记录就会竞争RIB失效。从而达到我们的目的,从I区,III区走。

access-list 33 permit 33.33.33.33 router ospf 89distance 171 0.0.0.0 255.255.255.255 33

查询路由表得到

      33.0.0.0/32 is subnetted, 1 subnets
D EX     33.33.33.33 [170/332800] via 47.1.1.7, 00:00:07, Ethernet0/1测试路径
R4#traceroute 33.33.33.33
Type escape sequence to abort.
Tracing the route to 33.33.33.33
VRF info: (vrf in name/id, vrf out name/id)1 47.1.1.7 0 msec 0 msec 0 msec2 67.1.1.6 1 msec 0 msec 0 msec3 36.1.1.3 0 msec *  1 msec
R4#
http://www.lryc.cn/news/272070.html

相关文章:

  • STM32 学习(二)GPIO
  • 安卓作业001 - 显示学生信息
  • ARM CCA机密计算硬件架构之内存管理
  • MySQL--安装与配置与向日葵的基本操作使用
  • Vue - 多行文本“展开、收起”功能
  • Linux操作系统基础(6):Linux的文件颜色
  • LeetCode 1758. 生成交替二进制字符串的最少操作数【字符串,模拟】1353
  • Spring-IOC-xml方式
  • HUAWEI华为荣耀MagicBook X 15酷睿i5-10210U处理器集显(BBR-WAH9)笔记本电脑原装出厂Windows10系统
  • React使用动态标签名称
  • Java异常篇----第二篇
  • 微服务(1)
  • 195.【2023年华为OD机试真题(C卷)】5G 网络建设(最小生成树—JavaPythonC++JS实现)
  • 2024年1月1日答案
  • 【算法】dp题单
  • Verilog视频信号图形显示 FPGA(iCE40)
  • 【LeetCode 面试经典150题】26. Remove Duplicates from Sorted Array 在有序数组中移除重复元素
  • linux系统下sql脚本的执行与导出
  • MyBatis学习一:快速入门
  • 零售业物流这个防漏水技术,居然没有翻车!
  • 主浏览器优化之路1——你现在在用的是什么浏览器?Edge?谷歌?火狐?360!?
  • gitlab请求合并分支
  • 使用Vue3开发学生管理系统模板1
  • 【cmake实战:番外】交叉编译——Linaro
  • 2024年年初Java5年实战面试题(北京)
  • 【Apache-2.0】springboot-openai-chatgpt超级AI大脑产品架构图
  • 如何在iPhone设备中查看崩溃日志
  • 对接第三方接口鉴权(Spring Boot+Aop+注解实现Api接口签名验证)
  • 微服务-理论(CAP,一致性协议)
  • CTFshow web入门web128-php特性31