OSPF高级配置实操——大型公司环境部署

一、路由重分发概念

定义:即将一种路由协议中的路由条目转换为另一种路由协议的路由条目,达到多路由环境下的网络互通
理解路由重分发
1、一个单一IP路由协议是管理网络中IP路由的首选方案

2、Cisco ISO能执行多个路由协议,每一个路由协议和该路由协议所服务的网络属于同一个自治系统

3、Cisco ISO使用路由重分发特性以交换不同协议创建的路由信息
路由重分发的考虑
1、度量值

2、管理距离
重分发到OSPF域中路由的路径类型
1、类型1的外部路径(type1 external path,E1)

2、类型2的外部路径(type2 external path,E2)

二、路由重分发配置

1、配置命令

Router(config-router)#redistribute protocol 【metric metric-value】 【metric-type type-value】【 subnets】

2、OSPF与RIP重分发配置实例

router rip                               //在rip协议中注入ospf协议
 redistribute ospf metric 10            //metric为度量值,这里标准为跳数
router ospf 1                            //在ospf协议中注入rip协议
redistribute rip metric 200 subnets    //度量值为带宽

3、OSPF重分发静态路由配置实例

router ospf 1
redistribute static metric 100 subnets metric-type  2

4、OSPF重分发默认路由配置实例

router ospf 1
   network 192.168.0.0   0.0.0.255 area 0
   default-information  originate  metric  10  netric-type  1

ip route 0.0.0.0   0.0.0.0 10.0.1.1

三、实操

1、实验中包含静态路由、默认路由以及动态路由
2、准备环境:GNS3中的6台路由器、四台PC机
(1):按照拓扑图完成路由间的连接(注意:R3路由需要右键点击选择configure,在Slots中添加两块NM-1FE-TX工作单板。
(2):将R6路由图标样式修改为cloud云样式,这里将R6路由模拟为移动ISP。
(3):将各个设备连接并开启。
3、实验配置图
《OSPF高级配置实操——大型公司环境部署》

第一、配置端口环境

R1

  R1#conf t
  R1(config)#int f0/0    
  R1(config-if)#ip add 192.168.10.1 255.255.255.0
  R1(config-if)#no shut
  R1(config-if)#int f0/1
  R1(config-if)#ip add 192.168.20.1 255.255.255.0
  R1(config-if)#no shut
  R1(config-if)#ex
  R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.20.0                  //末梢网络环境配置默认路由出去,指向下一跳地址

R2

  R2#conf t
  R2(config)#int f0/1
  R2(config-if)#ip add 192.168.20.2 255.255.255.0
  R2(config-if)#no shut
  R2(config-if)#ex
  R2(config)#int f0/0
  R2(config-if)#ip add 192.168.30.1 255.255.255.0
  R2(config-if)#no shut
  R2(config-if)#ex
  R2(config)#router ospf 1                                                                  //启用OSPF进程1
  R2(config-router)#router-id 2.2.2.2                                                 //标注router-id
  R2(config-router)#network 192.168.30.0 0.0.0.255 area 1             //宣告30段落的网段,在area1中
  R2(config-router)#ex
  R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.20.1      //做静态路由
  R2(config)#router ospf 1                                                                  //启用OSPF进程1
  R2(config-router)#redistribute connected subnets                         //直连网段20段落注入
  R2(config-router)#redistribute static subnets                                 //静态网段10段落注入
  R2(config-router)#ex

R3

  R3#conf t
  R3(config)#int f0/0
  R3(config-if)#ip add 192.168.30.2 255.255.255.0
  R3(config-if)#no shut
  R3(config-if)#int f0/1
  R3(config-if)#ip add 192.168.40.1 255.255.255.0
  R3(config-if)#no shut
  R3(config-if)#int f1/0
  R3(config-if)#ip add 12.0.0.1 255.255.255.0
  R3(config-if)#no shut
  R3(config-if)#int f2/0
  R3(config-if)#ip add 192.168.70.1 255.255.255.0
  R3(config-if)#no shut
  R3(config-if)#do show ip int b
  Interface                  IP-Address      OK? Method Status                Protocol
  FastEthernet0/0            192.168.30.2    YES manual up                    up      
  FastEthernet0/1            192.168.40.1    YES manual up                    up      
  FastEthernet1/0            12.0.0.1        YES manual up                    up      
  FastEthernet2/0            192.168.70.1    YES manual up                    up      
  R3(config-if)#ex
  R3(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2                               //配置默认路由出去,指向下一跳
  R3(config)#router ospf 1                                                            //启用OSPF进程1
  R3(config-router)#router-id 3.3.3.3                                            //标注router-id
  R3(config-router)#network 192.168.30.0 0.0.0.255 area 1        //在area1中宣告30段
  R3(config-router)#network 192.168.40.0 0.0.0.255 area 0        //在area0中宣告40段
  R3(config-router)#network 192.168.70.0 0.0.0.255 area 0        //在area0中宣告70段
  R3(config-router)#default-information originate                         //注入外部默认路由 
  R3(config-router)#ex

R4

  R4#conf t
  R4(config)#int f0/0
  R4(config-if)#ip add 192.168.40.2 255.255.255.0
  R4(config-if)#no shut
  R4(config-if)#int f0/1
  R4(config-if)#ip add 192.168.50.1 255.255.255.0
  R4(config-if)#no shut
  R4(config-if)#ex
  R4(config)#router rip                                                         //配rip协议
  R4(config-router)#ver 2
  R4(config-router)#no auto-summary
  R4(config-router)#network 192.168.50.0
  R4(config-router)#redistribute ospf 1 metric 5                  //注入ospf协议包含进程号和度量值
  R4(config-router)#ex
  R4(config)#router ospf 1                                                  //启用OSPF进程1
  R4(config-router)#router-id 4.4.4.4                                  //标注router-id
  R4(config-router)#network 192.168.40.0 0.0.0.255 area 0
  R4(config-router)#redistribute rip subnets                       //注入rip协议
  R4(config-router)#ex

R5

  R5#conf t
  R5(config)#int f0/0
  R5(config-if)#ip add 192.168.50.2 255.255.255.0
  R5(config-if)#no shut
  R5(config-if)#int f0/1
  R5(config-if)#ip add 192.168.60.1 255.255.255.0
  R5(config-if)#no shut
  R5(config-if)#ex
  R5(config-if)#router rip                                                           //配rip协议 
  R5(config-router)#ver 2
  R5(config-router)#no auto-summary
  R5(config-router)#network 192.168.50.0
  R5(config-router)#network 192.168.60.0
  R5(config-router)#ex

R6

  R6#conf t
  R6(config)#int f0/0
  R6(config-if)#ip add 12.0.0.2 255.255.255.0
  R6(config-if)#no shut
  R6(config-if)#int f0/1
  R6(config-if)#ip add 13.0.0.1 255.255.255.0
  R6(config-if)#no shut
  R6(config-if)#ex
  R6(config)#ip route 192.168.0.0 255.255.0.0 12.0.0.1          //配静态路由

pc机

客户机1:ip 192.168.10.2 192.168.10.1
客户机2:ip 192.168.70.2 192.168.70.1
客户机3:ip 13.0.0.13 13.0.0.1
客户机4:ip 192.168.60.2 192.169.60.1

第二、进行测试连接

测试pc1是否能与pc2互联互通
《OSPF高级配置实操——大型公司环境部署》
测试pc1是否能与pc4互联互通
《OSPF高级配置实操——大型公司环境部署》
测试pc1是否能与pc3互联互通
《OSPF高级配置实操——大型公司环境部署》

实验到此就结束了,欢迎大家浏览观看!!!

    原文作者:wx5d3faba330584
    原文地址: https://blog.51cto.com/14475593/2438095
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞