路由映射实战二
本篇博文和上一篇是紧密结合的,只是在上个试验的基础上作了改动,达到其他的试验效果。
试验二:
在R1上增加一个网段,并发布路由。这里采用三种方法。
如下是第一种,是在试验一的基础上直接增加一个网段,发布路由。
 
A(config)#int lo2
A(config-if)#ip addr 192.168.30.1 255.255.255.0
A(config-if)#exit
A(config)#router eigrp 100
A(config-router)#net 192.168.30.0
分别在R2 ,R3上做测试:
正常情况下,
R2上是能学习到路由,R3上不能学到路由。
 
B#
B#show ip ro
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
 
D    192.168.30.0/24 [90/2297856] via 202.110.100.1, 00:00:21, Serial1/0    //新学到的路由。
C    202.110.100.0/24 is directly connected, Serial1/0
C    202.110.101.0/24 is directly connected, Serial1/1
D    192.168.10.0/24 [90/2297856] via 202.110.100.1, 00:16:44, Serial1/0
D    192.168.20.0/24 [90/2297856] via 202.110.100.1, 00:16:44, Serial1/0
 
 
C>en
C#show ip ro
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
 
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:18, Serial1/1
R    192.168.20.0/24 [120/5] via 202.110.101.1, 00:00:18, Serial1/1
解决方案:在B上重新做路由映射,及路由的再发布。
 
B(config)#route-map abc permit 30
B(config-route-map)#match ip addr 3
B(config-route-map)#set metric 10
B(config-route-map)#exit
B(config)#access-list 3 permit 192.168.30.0 0.0.0.255
B(config)#router rip
B(config-router)#redistribute eigrp 100 route-map abc
在C上做测试;
 
C#show ip ro
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
 
R    192.168.30.0/24 [120/10] via 202.110.101.1, 00:00:10, Serial1/1
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:10, Serial1/1
R    192.168.20.0/24 [120/5] via 202.110.101.1, 00:00:10, Serial1/1
 
第二种方法
在访问控制列表中做文章,一个列表放两个路由,
 B(config)#route-map abc permit 20
B(config-route-map)#match ip addr 2
B(config-route-map)#set metric 5
B(config-route-map)#exit
B(config)#access-list 2 permit 192.168.30.0  0.0.0.255
B(config)#
B(config)#router rip
B(config-router)#redistribute eigrp 100 route-map abc
B(config-router)#
在C上再次做测试:
 
C#show ip ro
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
 
R    192.168.30.0/24 [120/5] via 202.110.101.1, 00:00:12, Serial1/1
注意:学到的路由种子度量和20网段的种子度量相同。
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:12, Serial1/1
R    192.168.20.0/24 [120/5] via 202.110.101.1, 00:00:12, Serial1/1
 
方法三:
路由再发布时,满足1号表的路由,修改度量值为3,不满足1号表的路由,修改度量值为5.(即对有set无match的应用)
B(config)#route-map abc permit 10
B(config-route-map)#match ip addr 1
B(config-route-map)#set metric 3
 
B(config)#route-map abc permit 20
B(config-route-map)#no match ip addr 2
B(config-route-map)#set metric 5
这里还可以采用不配置20网段的访问控制列表,效果是一样的,并不冲突。
在C路由器上做测试:
 
R    192.168.30.0/24 [120/5] via 202.110.101.1, 00:00:12, Serial1/1
R    202.110.100.0/24 [120/5] via 202.110.101.1, 00:00:12, Serial1/1
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:12, Serial1/1
R    192.168.20.0/24 [120/5] via 202.110.101.1, 00:00:12, Serial1/1
因为利用上一种方法时30网段的种子度量是5,此时30网段种子度量也是5,显然有点不清楚,下面利用同样的方法将30网段的种子度量该为3。由于利用再发布是一样的,所以只需要将10网段和20网段对应的match和set 调整一下即可。
在R2做操作:
 
B(config)#route-map abc permit 20
B(config-route-map)# match ip addr 2     //启用20网段的match
B(config-route-map)#set metric 5
 
R3上测试:
 
R    192.168.30.0/24 [120/3] via 202.110.101.1, 00:00:23, Serial1/1   //试验结果在我们预料之中。
R    202.110.100.0/24 [120/3] via 202.110.101.1, 00:00:23, Serial1/1
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:23, Serial1/1
R    192.168.20.0/24 [120/3] via 202.110.101.1, 00:00:23, Serial1/1
 
试验三:在发布过程中,满足1号表的路由,修改种子度量为3,满足2号表的路由,使用默认属性正常发布。
R2上修改:(理解默认属性:即match和set均不配置)
 
B(config-route-map)#route-map abc permit 10
B(config-route-map)#no  match ip addr 1   
B(config-route-map)#set metric 3
 
B(config)#route-map abc permit 20
B(config-route-map)#no  match ip addr 2
B(config-route-map)#no set metric 5
由于10网段在route-map abc permit 10  ,它里面包含的match和set语句,正常情况下,R3应该只能学到10网段的路由,而20,30网段属于默认属性,满足表2,应该学习不到路由。
 
Gateway of last resort is not set
 
C    202.110.101.0/24 is directly connected, Serial1/1
R    192.168.10.0/24 [120/3] via 202.110.101.1, 00:00:08, Serial1/1
试验现象和我们的理论分析完全吻合。
 
有set无match的情况我们看到了,那么有match无set会怎样呢???
R3只能学到匹配10网段的路由。呵呵,学习!其乐无穷啊!!加油吧!
     本文转自shenleigang 51CTO博客,原文链接:http://blog.51cto.com/shenleigang/151090,如需转载请自行联系原作者

CCNP精粹系列之十八--路由映射实战二,博主推荐文章相关推荐

  1. CCNP精粹系列之三十二--BGP下一跳问题,推荐

                       Bgp的下一跳 R1:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:off ...

  2. CCNP精粹系列之十六--实现三层交换的vlan间通信和路由器的配合使用

    实现三层交换的vlan间通信和路由器的配合使用 Switch 实验4:三层交换机上配置 VLAN间通信和上外网的路由A1和B1在VLAN1内,A2和B2在VLAN2内,实现VLAN1和VLAN2通信, ...

  3. CCNP精粹系列之十三-----OSPF路由汇总

    一.路由器中OSPF的汇总 1)各个路由器的配置 R1 R1(config)#int lo0 R1(config-if)#ip addr 172.16.8.1 255.255.255.0 R1(con ...

  4. CCNP精粹系列之十七--路由映射实战,博主推荐

    路由映射实战   试验环境: 在R1上配置三个环回口,模拟路由器R1的其他网段,R2为边缘路由器   在A上做:(A的环境是eigrp环境)<?xml:namespace prefix = o ...

  5. Go入门系列(十八) 反射、包和测试工具

    本系列文章目录 展开/收起 Go入门系列(一) 初识Go语言 Go入门系列(二) 变量.指针.数据类型简介和作用域 Go入门系列(三) 基础类型--整型.浮点型.布尔类型和字符串 Go入门系列(四) ...

  6. 【SQL开发实战技巧】系列(十八):数据仓库中时间类型操作(进阶)INTERVAL、EXTRACT以及如何确定一年是否为闰年及周的计算

    系列文章目录 [SQL开发实战技巧]系列(一):关于SQL不得不说的那些事 [SQL开发实战技巧]系列(二):简单单表查询 [SQL开发实战技巧]系列(三):SQL排序的那些事 [SQL开发实战技巧] ...

  7. Debezium报错处理系列之三十八:Timeout expired while fetching topic metadata

    Debezium报错处理系列之三十八:'trace': 'org.apache.kafka.common.errors.TimeoutException: Timeout expired while ...

  8. Oracle数据库从入门到精通系列之十八:Oracle进程

    Oracle数据库从入门到精通系列之十八:Oracle进程 一.Oracle进程 二.服务器进程server process 三.后台进程background process 四.从属进程(slave ...

  9. ComicEnhancerPro 系列教程十八:JPG文件长度与质量

    作者:马健 邮箱:stronghorse_mj@hotmail.com 主页:http://www.comicer.com/stronghorse/ 发布:2017.07.23 教程十八:JPG文件长 ...

最新文章

  1. Guice:最好用的依赖注入框架
  2. LeetCode 274. H指数(排序,哈希)
  3. java复制arraylist_Java - 复制ArrayList
  4. RabbitMQ实现(并发)多线程处理消息
  5. 删除时存在依赖_npm依赖管理那些事
  6. window certutil查看文件md5,校验文件MD5
  7. 常用原型图绘制工具比较
  8. 马云:中国企业不缺创新缺管理思想
  9. 求素数(质数)算法的N种境界 - 试除法和初级筛法
  10. excel打开密码忘记了_Excel工作表保护密码忘记了怎么办?这一招轻松去除密码...
  11. oracle发生20001,Oracle10g重建EM 报ORA-20001: SYSMAN already exists
  12. “无法识别的USB设备”如何解决
  13. oracle中12560,Oracle ORA-12560解决方法
  14. 使用iso安装linux系统安装教程,使用光盘iso实现Linux操作系统的自动安装部署
  15. typora 分割线_最全Typora语法大全(含详细数学表达式及流程图)
  16. PHP全栈学习笔记17
  17. 公积金为何会沦为穷人的“鸡肋”?
  18. 工业智能网关BL110应用之七十二: 实现西门子S7-300 PLC 接入华为云平台
  19. 搭建ZeroTier的Moon服务器
  20. This app has crashed because it attempted to access privacy-sensitive data without a usage

热门文章

  1. java有 号_JAVA揭竿而起总要有名号
  2. python常用的包_Python3之常用包汇总
  3. python csv读写方法_python中csv文件的若干读写方法小结
  4. DICOM的常用Tag分类和说明
  5. nginx配置静态文件过期时间
  6. 【openssl】利用openssl完成X509证书和PFX证书之间的互转
  7. Bishops Alliance—— 最大上升子序列
  8. css如何实现背景透明,文字不透明?
  9. C# 与 VC Dll 传输信息
  10. 序列元素IT面试题——判断合法出栈序列