OSPF的简易模拟配置第二篇

OSPF配置实例
本文详细介绍了一个使用OSPF协议进行路由器配置的例子。通过四个路由器R1、R2、R3和R4的配置步骤,展示了如何设置IP地址及进行OSPF区域配置。此配置实现了不同子网间的通信。

拓扑图如下:

 

先设置好各路由器的IP地址等

R1配置

  

  en      进入特权模式

  conf t     进入全局配置模式

  hostname R1  修改路由器名称为R1

  no ip domain-lookup  去除域名解析

  int g0/0 

  ip addr 192.168.12.1 255.255.255.0

  no shut

  int l0

  ip addr 1.1.1.1 255.255.255.0

  no shut

R2配置

  

  en      进入特权模式

  conf t     进入全局配置模式

  hostname R2   修改路由器名称为R2

  no ip domain-lookup  去除域名解析

  int g0/0 

  ip addr 192.168.12.2 255.255.255.0

  no shut

  int g0/1

  ip addr 192.168.23.1 255.255.255.0

  no shut

  int l0

  ip addr 2.2.2.2 255.255.255.0

  no shut

R3配置

  

  

  en      进入特权模式

  conf t     进入全局配置模式

  hostname R3   修改路由器名称为R3

  no ip domain-lookup  去除域名解析

  int g0/1

  ip addr 192.168.23.2 255.255.255.0

  no shut

  int g0/0

  ip addr 192.168.34.1 255.255.255.0

  no shut

  int l0

  ip addr 3.3.3.3 255.255.255.0

  no shut

R4配置

  

  en      进入特权模式

  conf t     进入全局配置模式

  hostname R4   修改路由器名称为R4

  no ip domain-lookup  去除域名解析

  int g0/0 

  ip addr 192.168.34.2 255.255.255.0

  no shut

  int l0

  ip addr 4.4.4.4 255.255.255.0

  no shut

接下来是路由配置

R1配置

  en

  conf t

  router ospf 1

  router-id 1.1.1.1

  network 192.168.12.0 0.0.0.255 area 0

  network 1.1.1.1 0.0.0.255 area 0

R2配置

  

  en

  conf t

  router ospf 1

  router-id 2.2.2.2

  network 192.168.12.0 0.0.0.255 area 0

  network  192.168.23.0 0.0.0.255 area 0

  network 2.2.2.2 0.0.0.255 area 0

R3配置

  

  en

  conf t

  router ospf 1

  router-id 3.3.3.3

  network 192.168.34.0 0.0.0.255 area 0

  network  192.168.23.0 0.0.0.255 area 0

  network 3.3.3.3 0.0.0.255 area 0

R4配置

  

  en

  conf t

  router ospf 1

  router-id 4.4.4.4

  network 192.168.34.0 0.0.0.255 area 0

  network 4.4.4.4 0.0.0.255 area 0

转载于:https://www.cnblogs.com/LilacStrawberry/p/9230070.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值