路由器基础配置之ospf基础配置

 

我们将以上面的拓扑图进行本次ospf的实验,目的是能当三台pc机互通

先配置好pc机的IP地址,注意一定要给pc机设置好网关,接下来配置路由器的IP地址

router4

enable  进入特权模式

config t  进入全局配置模式

interface g0/0

ip address 192.168.1.254 255.255.255.0

no shu

exit

interface s0/3/0

ip address 192.168.10.1 255.255.255.0

no shu

 

router1

enable

config t

interface s0/3/0

ip address 192.168.10.2 255.255.255.0

clock rate 6400  同步时间

no shu

exit

interface s0/3/1

ip address 192.168.20.1 255.255.255.0

clock rate 6400

no shu

exit

interface s0/2/0

ip address 192.168.40.1 255.255.255.0

clock rate 6400

no shu

 

router2

enable

config t

interface s0/3/0

ip address 192.168.50.1 255.255.255.0

clock rate 6400  同步时间

no shu

exit

interface s0/2/1

ip address 192.168.60.2 255.255.255.0

clock rate 6400

no shu

exit

interface s0/2/0

ip address 192.168.40.2 255.255.255.0

clock rate 6400

no shu

 

router0

enable

config t

interface s0/3/0

ip address 192.168.20.2 255.255.255.0

clock rate 6400  同步时间

no shu

exit

interface s0/3/1

ip address 192.168.50.2 255.255.255.0

clock rate 6400

no shu

exit

interface s0/2/0

ip address 192.168.30.2 255.255.255.0

clock rate 6400

no shu

 

router3

enable  

config t  

interface g0/0

ip address 192.168.3.254 255.255.255.0

no shu

exit

interface s0/3/0

ip address 192.168.30.1 255.255.255.0

no shu

 

router5

enable  

config t  

interface g0/0

ip address 192.168.2.254 255.255.255.0

no shu

exit

interface s0/3/0

ip address 192.168.60.1 255.255.255.0

no shu

路由器的IP地址配置完毕

配置ospf

router4

在全局配置模式下

router ospf 1

router-id 1.1.1.1

network 192.168.1.0 0.0.0.255 area 0

network 192.168.10.0 0.0.0.255 area 0

 

router1

在全局配置模式下

router ospf 1

router-id 2.2.2.2

network 192.168.10.0 0.0.0.255 area 0

network  192.168.20.0 0.0.0.255 area 0

network 192.168.40.0 0.0.0.255 area 0

 

router0

在全局配置模式下

router ospf 1

router-id 3.3.3.3

network 192.168.30.0 0.0.0.255 area 0

network  192.168.20.0 0.0.0.255 area 0

network 192.168.50.0 0.0.0.255 area 0

 

router2

在全局配置模式下

router ospf 1

router-id 4.4.4.4

network 192.168.40.0 0.0.0.255 area 0

network  192.168.50.0 0.0.0.255 area 0

network 192.168.60.0 0.0.0.255 area 0

 

router3

在全局配置模式下

router ospf 1

router-id 5.5.5.5

network 192.168.3.0 0.0.0.255 area 0

network  192.168.30.0 0.0.0.255 area 0

 

router5

在全局配置模式下

router ospf 1

router-id 6.6.6.6

network 192.168.2.0 0.0.0.255 area 0

network  192.168.60.0 0.0.0.255 area 0

ospf全部配置完毕,等待路由器之间相互学习,可以在特权模式下使用show ip route来查看路由表的学习情况

学习完毕可以使用ping命令,三台pc机就可以互通了,到此实验完成

 

转载于:https://www.cnblogs.com/wuhaohao/p/9230872.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值