热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

路由器配置_路由器配置——路由重分布2(OSPF)

一、实验目的:使用路由重分布达到全网互通的效果二、拓扑图:

一、实验目的:使用路由重分布达到全网互通的效果

二、拓扑图:

技术分享图片

 

三、具体步骤配置:

1、先给各台主机配置ip地址及网关,以PC1为例:

技术分享图片

 

2、路由器配置:

(1)R1路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostnam R1  --修改路由器名为R1
R1(config)#interface s0/0/0  --进入端口
R1(config-if)#ip address 192.168.32.2 255.255.255.0  --为端口配置ip地址
R1(config-if)#clock rate 64000  --配置时钟速率
R1(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#interface s0/1/0  --进入端口
R1(config-if)#ip address 192.168.12.1 255.255.255.0  --为端口配置ip地址
R1(config-if)#clock rate 64000  --配置时钟速率
This command applies only to DCE interfaces
R1(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
R1(config-if)#interface s0/0/1  --进入端口
R1(config-if)#ip address 192.168.22.1 255.255.255.0  --为端口配置ip地址
R1(config-if)#clock rate 64000  --配置时钟速率
This command applies only to DCE interfaces
R1(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
R1(config-if)#exit  --返回上一级
R1(config)#ip route 192.168.42.0 255.255.255.0 192.168.32.1  --配置静态路由
R1(config)#router ospf 1  --将R1的静态路由重分布到OSPF
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#network 192.168.22.0 0.0.0.255 area 0
R1(config-router)#redistribute static subnet  --重分布静态路由
R1(config-router)#redistribute connected subnet  --重分布直连路由
R1(config-router)#end  --返回特权模式

(2)R2路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2  --修改路由器名为R2
R2(config)#interface s0/1/0  --进入端口
R2(config-if)#ip address 192.168.12.2 255.255.255.0  --为端口配置ip地址
R2(config-if)#clock rate 64000  --配置时钟速率
R2(config-if)#no shutdown  --激活端口

R2(config-if)#interface s0/0/1  --进入端口
R2(config-if)#ip address 192.168.23.2 255.255.255.0  --为端口配置ip地址

R2(config-if)#clock rate 64000  --配置时钟速率

This command applies only to DCE interfaces

R2(config-if)#no shutdown   --激活端口

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
R2(config-if)#interface s0/0/0  --进入端口
R2(config-if)#ip address 192.168.13.1 255.255.255.0  --为端口配置ip地址
R2(config-if)#clock rate 64000  --配置时钟速率
R2(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R2(config-if)#exit  --返回上一级
R2(config)#router ospf 1  --将R2rip的路由信息重分布到OSPF
R2(config-router)#network 192.168.12.0 0.0.0.255 area 0
R2(config-router)#network 192.168.13.0 0.0.0.255 area 0
R2(config-router)#redistribute rip metric 1  --重分布rip路由,必须指定度量值
% Only classful networks will be redistributed  
R2(config-router)#exit  --返回上一级
R2(config)#router rip  --开启rip协议
R2(config-router)#version 2  --版本2
R2(config-router)#network 192.168.23.0  --将直连网段添加到rip
R2(config-router)#redistribute ospf 1 metric 1  --重分布OSPF路由
R2(config-router)#end  --返回特权模式

 

(3)R3路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R3  --修改路由器名为R3
R3(config)#interface s0/0/0  --进入端口
R3(config-if)#ip address 192.168.22.2 255.255.255.0  --为端口配置ip地址

R3(config-if)#clock rate 64000  --配置时钟速率
R3(config-if)#no shutdown  --激活端口

R3(config-if)#interface s0/0/1  --进入端口
R3(config-if)#ip address 192.168.13.2 255.255.255.0  --为端口配置ip地址
R3(config-if)#clock rate 64000  --配置时钟速率
This command applies only to DCE interfaces
R3(config-if)#no shutdown  --激活端口

R3(config-if)#interface s0/1/0  --进入端口
R3(config-if)#ip address 192.168.33.1 255.255.255.0  --为端口配置ip地址
R3(config-if)#clock rate 64000  --配置时钟速率
R3(config-if)#no shutdown  --激活端口

%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
R3(config-if)#exit  --返回上一级
R3(config)#router ospf 1  --将R3EIGRP的路由信息重分布到OSPF
R3(config-router)#network 192.168.12.0 0.0.0.255 area 0
R3(config-router)#network 192.168.13.0 0.0.0.255 area 0
R3(config-router)#redistribute eigrp 1 metric-type 1 subnet  --重分布EIGRP路由
R3(config-router)#exit  --返回上一级
R3(config)#router eigrp 1  --将OSPF的路由信息重分布到EIGRP
R3(config-router)#network 192.168.33.0 0.0.0.255
R3(config-router)#redistribute ospf 1 metric 1000 100 255 1 1500  --重分布EIGRP路由
R3(config-router)#end  --返回特权模式

(4)R4路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R4  --修改路由器名为R4
R4(config)#interface f0/0  --进入端口
R4(config-if)#ip address 192.168.42.254 255.255.255.0  --为端口配置ip地址
R4(config-if)#no shutdown  --激活端口

R4(config-if)#interface s0/0/0  --进入端口
R4(config-if)#ip address 192.168.32.1 255.255.255.0  --为端口配置ip地址
R4(config-if)#clock rate 64000  --配置时钟速率
This command applies only to DCE interfaces
R4(config-if)#no shutdown  --激活端口

R4(config-if)#exit  --返回上一级
R4(config)#ip route 0.0.0.0 0.0.0.0 192.168.32.2  --配置静态路由
R4(config)#end  --返回特权模式

(5)R5路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R5  --修改路由器名为R5
R5(config)#interface s0/0/0  --进入端口
R5(config-if)#ip address 192.168.23.1 255.255.255.0  --为端口配置ip地址
R5(config-if)#clock rate 64000  --配置时钟速率
This command applies only to DCE interfaces
R5(config-if)#no shutdown  --激活端口

R5(config-if)#interface f0/0  --进入端口
R5(config-if)#ip address 192.168.43.254 255.255.255.0  --为端口配置ip地址
R5(config-if)#no shutdown  --激活端口

R5(config-if)#exit  --返回上一级
R5(config)#route rip  --开启rip协议
R5(config-router)#version 2  --版本2
R5(config-router)#network 192.168.43.0  --添加直连网段到rip
R5(config-router)#network 192.168.23.0  --添加直连网段到rip
R5(config-router)#end  --返回特权模式

(6)R6路由器配置

Router>enable  --进入特权模式
Router#configure terminal  --进入全局配模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R6  --修改路由器名为R6
R6(config)#interface s0/0/0  --进入端口
R6(config-if)#ip address 192.168.33.2 255.255.255.0  --为端口配置ip地址

R6(config-if)#clock rate 64000  --配置时钟速率
R6(config-if)#no shutdown  --激活端口

R6(config-if)#interface f0/0  --进入端口
R6(config-if)#ip address 192.168.53.254 255.255.255.0  --为端口配置ip地址
R6(config-if)#no shutdown  --激活端口

R6(config-if)#exit  --返回上一级
R6(config)#route eigrp 1  --开启EIGRP协议
R6(config-router)#network 192.168.33.0
R6(config-router)#network 192.168.53.0
R6(config-router)#end  --返回特权模式

四、验证:三台主机相互ping,看是否全网互通

(1)PC1PC2

技术分享图片

(2)PC2PC3

技术分享图片

(3)PC3PC1

技术分享图片

 

















































































































推荐阅读
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • r2dbc配置多数据源
    R2dbc配置多数据源问题根据官网配置r2dbc连接mysql多数据源所遇到的问题pom配置可以参考官网,不过我这样配置会报错我并没有这样配置将以下内容添加到pom.xml文件d ... [详细]
  • 配置IPv4静态路由实现企业网内不同网段用户互访
    本文介绍了通过配置IPv4静态路由实现企业网内不同网段用户互访的方法。首先需要配置接口的链路层协议参数和IP地址,使相邻节点网络层可达。然后按照静态路由组网图的操作步骤,配置静态路由。这样任意两台主机之间都能够互通。 ... [详细]
  • 本文记录了在vue cli 3.x中移除console的一些采坑经验,通过使用uglifyjs-webpack-plugin插件,在vue.config.js中进行相关配置,包括设置minimizer、UglifyJsPlugin和compress等参数,最终成功移除了console。同时,还包括了一些可能出现的报错情况和解决方法。 ... [详细]
  • 本文介绍了一个Magento模块,其主要功能是实现前台用户利用表单给管理员发送邮件。通过阅读该模块的代码,可以了解到一些有关Magento的细节,例如如何获取系统标签id、如何使用Magento默认的提示信息以及如何使用smtp服务等。文章还提到了安装SMTP Pro插件的方法,并给出了前台页面的代码示例。 ... [详细]
  • tcpdump 4.5.1 crash 深入分析
    tcpdump 4.5.1 crash 深入分析 ... [详细]
  • HSRP热备份路由器协议的应用及配置
    本文介绍了HSRP热备份路由器协议的应用及配置方法,包括设计目标、工作原理、配置命令等。通过HSRP协议,可以实现在主动路由器故障时自动切换到备份路由器,保证网络连通性。此外,还介绍了R1和R2路由器的配置方法以及Sw1和Sw2交换机的配置方法,最后还介绍了测试连通性和路由追踪的方法。 ... [详细]
  • 动态多点××× 单云双HUB
    动态多点是一个高扩展的IPSEC解决方案传统的ipsecS2S有如下劣势1.中心站点配置量大,无论是采用经典ipsec***还是采用greoveripsec多一个分支 ... [详细]
  • vue使用
    关键词: ... [详细]
  • 安装mysqlclient失败解决办法
    本文介绍了在MAC系统中,使用django使用mysql数据库报错的解决办法。通过源码安装mysqlclient或将mysql_config添加到系统环境变量中,可以解决安装mysqlclient失败的问题。同时,还介绍了查看mysql安装路径和使配置文件生效的方法。 ... [详细]
  • 解决VS写C#项目导入MySQL数据源报错“You have a usable connection already”问题的正确方法
    本文介绍了在VS写C#项目导入MySQL数据源时出现报错“You have a usable connection already”的问题,并给出了正确的解决方法。详细描述了问题的出现情况和报错信息,并提供了解决该问题的步骤和注意事项。 ... [详细]
  • HDFS2.x新特性
    一、集群间数据拷贝scp实现两个远程主机之间的文件复制scp-rhello.txtroothadoop103:useratguiguhello.txt推pushscp-rr ... [详细]
  • 解决.net项目中未注册“microsoft.ACE.oledb.12.0”提供程序的方法
    在开发.net项目中,通过microsoft.ACE.oledb读取excel文件信息时,报错“未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序”。本文提供了解决这个问题的方法,包括错误描述和代码示例。通过注册提供程序和修改连接字符串,可以成功读取excel文件信息。 ... [详细]
  • 本文摘要配置目的:寄存器配置用于更改路由器启动过程。配置目的:寄存器配置用于更改路由器启动过程。启动位由4位16进制寄存器组成格式:0xA ... [详细]
  • ! Configuration File for keepalivedglobal_defs {   notification_email {     ... [详细]
author-avatar
xc15212
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有