华为eNSP配置实例10——OSPF单区域路由配置_第1页
华为eNSP配置实例10——OSPF单区域路由配置_第2页
华为eNSP配置实例10——OSPF单区域路由配置_第3页
华为eNSP配置实例10——OSPF单区域路由配置_第4页
华为eNSP配置实例10——OSPF单区域路由配置_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、十十. OSPF单区域单区域路由路由配置配置场景场景 你是公司的网络管理员。现在公司的网络准备使用OSPF协议来进行路由信息的传递。规划网络中所有路由器属于OSPF的区域0实际使用中需要向OSPF发布默认路由,此外你也希望通过这次部署了解DR/BDR选举的机制。 网络拓扑10.0.12.2/2410.0.12.1/24Loopback 010.0.2.2/24Loopback 010.0.1.1/24Loopback 010.0.3.3/2410.0.23.2/2410.0.23.1/24注:loopback不是一个设备,是在路由器里设置出来的Loopback 2172.0.16.1/24步骤

2、一步骤一. 基本配置与基本配置与IP编址编址R1的基本配置undo ter monsysHuaweisysname R1R1int s0/0/0R1-Serial0/0/0ip addr 10.0.12.1 24R1-Serial0/0/0undo shutR1-Serial0/0/0int loopback 0R1-LoopBack0ip addr 10.0.1.1 24R2的基本配置undo ter monsysHuaweisysname R2R2int s0/0/0R2-Serial0/0/0ip addr 10.0.12.2 24R2-Serial0/0/0undo shutR2-Se

3、rial0/0/0int s0/0/1R2-Serial0/0/1ip addr 10.0.23.2 24R2-Serial0/0/1undo shutR2-Serial0/0/1int loopback 0R2-LoopBack0ip addr 10.0.2.2 24R3的基本配置undo ter monsysHuaweisysname R3R3int s0/0/1R3-Serial0/0/1ip addr 10.0.23.1 24R3-Serial0/0/1undo shutR3-Serial0/0/1int loopback 0R3-LoopBack0ip addr 10.0.3.3 2

4、4步骤二步骤二. OSPF配置配置 定义R1的Loopback0接口地址10.0.1.1作为R1的Router ID,使用默认的OSPF进程号1,将10.0.12.0/24、10.0.1.0/24网段定义到OSPF区域0。R1ospf 1 router-id 10.0.1.1 设置OSPF进程号1,路由器的身份编号(ID)为10.0.1.1R1-ospf-1area 0 设置ospf的区域0R1-ospf-1-area-0.0.0.0network 10.0.1.0 0.0.0.255 将网络10.0.1.0 通告给OSPF协议, 0.0.0.255是该网络的反掩码R1-ospf-1-area

5、-0.0.0.0network 10.0.12.0 0.0.0.255R1-ospf-1-area-0.0.0.0quitR1-ospf-1解释:同一个路由器可以开启多个OSPF进程,默认进程号为1,由于进程号只具有本地意义,所以同一路由域的不同路由器可以使用相同或不同的OSPF进程号;network命令后面需使用反掩码。 定义R2的Loopback0接口地址10.0.2.2作为R2的Router ID,配置使用OSPF进程号10,将10.0.12.0/24、 10.0.23.0/24和10.0.2.0/24两个网段定义到OSPF区域0。R2ospf 10 router-id 10.0.2.2

6、R2-ospf-10area 0R2-ospf-10-area-0.0.0.0network 10.0.2.0 0.0.0.255R2-ospf-10-area-0.0.0.0network 10.0.12.0 0.0.0.255R2-ospf-10-area-0.0.0.0network 10.0.23.0 0.0.0.255R2-ospf-10-area-0.0.0.0quitR2-ospf-10quit定义R3的Loopback0接口地址10.0.3.3作为R3的Router ID,配置使用OSPF进程号100,将10.0.23.0/24和10.0.3.0/24两个网段定义到OSPF区域

7、0。R3ospf 100 router-id 10.0.3.3 R3-ospf-100area 0R3-ospf-100-area-0.0.0.0network 10.0.3.0 0.0.0.255R3-ospf-100-area-0.0.0.0network 10.0.23.0 0.0.0.255R3-ospf-100-area-0.0.0.0quitR3-ospf-100quitR3步骤三步骤三. 检查路由无误检查路由无误查看R1、R2和R3的路由表,确认各路由器已经学习到以下红色突出显示部分的RIP路由。 R1display ip routing-tableRoute Flags: R

8、- relay, D - download to fib- 10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack0 10.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0 10.0.2.2/32 OSPF 10 1562 D 10.0.12.2 Serial0/0/0 10.0.3.3/32 OSPF 10 3124 D 10.0.12.2 Serial0/0/0 10.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial0/0/0 10.0.12.1/32 Direct 0 0 D 127.0.0.1

9、 Serial0/0/0 10.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial0/0/0 10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0查看R2的路由表R2dis ip routDestination/Mask Proto Pre Cost Flags NextHop Interface 10.0.1.1/32 OSPF 1

10、0 1562 D 10.0.12.1 Serial0/0/0 10.0.2.0/24 Direct 0 0 D 10.0.2.2 LoopBack0 10.0.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0 10.0.3.3/32 OSPF 10 1562 D 10.0.23.1 Serial0/0/1 10.0.12.0/24 Direct 0 0 D 10.0.12.2 Serial0/0/0 10.0.12.1/32 Direct 0 0 D 10.0.12.1 Serial0/0/0 10.0.12.2/32 Direct 0 0 D 127.0.0.1

11、 Serial0/0/0 10.0.23.0/24 Direct 0 0 D 10.0.23.2 Serial0/0/1 10.0.23.1/32 Direct 0 0 D 10.0.23.1 Serial0/0/1 10.0.23.2/32 Direct 0 0 D 127.0.0.1 Serial0/0/1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0查看R3的路由表R3dis ip routRoute Flags: R - relay, D -

12、download to fib-10.0.1.1/32 OSPF 10 3124 D 10.0.23.2 Serial0/0/1 10.0.2.2/32 OSPF 10 1562 D 10.0.23.2 Serial0/0/1 10.0.3.0/24 Direct 0 0 D 10.0.3.3 LoopBack0 10.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack0 10.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial0/0/1 10.0.23.0/24 Direct 0 0 D 10.0.23.1 Serial0/0/1

13、 10.0.23.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/1 10.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial0/0/1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0用ping来测试连通性ping 10.0.1.1 PING 10.0.1.1: 56 data bytes, press CTRL_C to break Reply from 10.0.1.1: bytes=56 Se

14、quence=1 ttl=254 time=50 ms Reply from 10.0.1.1: bytes=56 Sequence=2 ttl=254 time=50 ms Reply from 10.0.1.1: bytes=56 Sequence=3 ttl=254 time=60 ms Reply from 10.0.1.1: bytes=56 Sequence=4 ttl=254 time=50 ms Reply from 10.0.1.1: bytes=56 Sequence=5 ttl=254 time=60 ms - 10.0.1.1 ping statistics - 5 p

15、acket(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 50/54/60 ms步骤四步骤四. 查看其他信息查看其他信息使用display ip routing-table protocol ospf命令可以查看通过OSPF学到的路由,同样可以在R2和R3上进行相同操作。dis ip rout protocol ospfRoute Flags: R - relay, D - download to fib-Public routing table : OSPF Destination

16、s : 3 Routes : 3 OSPF routing table status : Destinations : 3 Routes : 3Destination/Mask Proto Pre Cost Flags NextHop Interface 10.0.2.2/32 OSPF 10 1562 D 10.0.12.2 Serial0/0/0 10.0.3.3/32 OSPF 10 3124 D 10.0.12.2 Serial0/0/0 10.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial0/0/0OSPF routing table status

17、 : Destinations : 0 Routes : 0使用display ospf peer命令查看OSPF邻居状态。display ospf peer OSPF Process 10 with Router ID 10.0.2.2 Neighbors Area 0.0.0.0 interface 10.0.12.2(Serial0/0/0)s neighbors Router ID: 10.0.12.1 Address: 10.0.12.1 State: Full Mode:Nbr is Master Priority: 1 DR: None BDR: None MTU: 0 Dead

18、 timer due in 34 sec Retrans timer interval: 5 Neighbor is up for 00:21:43 Authentication Sequence: 0 续下页接上页Neighbors Area 0.0.0.0 interface 10.0.23.2(Serial0/0/1)s neighbors Router ID: 10.0.3.3 Address: 10.0.23.1 State: Full Mode:Nbr is Master Priority: 1 DR: None BDR: None MTU: 0 Dead timer due in

19、 29 sec Retrans timer interval: 5 Neighbor is up for 00:21:32 Authentication Sequence: 0 使用display ospf peer命令可以显示邻居的详细信息,由上输出可以看出,R2有两个邻居R1(Router ID: 10.0.12.1)和R2(Router ID: 10.0.3.3),而且邻居状态都是完全邻接状态。也可以使用display ospf peer brief命令以更简洁的方式查看邻居状态。 dis ospf peer brief OSPF Process 10 with Router ID 10.0.2.2 Peer Statistic Information - Area Id Interface Neighbor id State 0.0.0.0 Serial0/0/0 10.0.12.1 Full 0.0.0.0 Serial0/0/1 10.0.3.3 Full 步骤五步骤五. OSPF缺省路由发布及验证缺省路由发布及验证 1.先给R3增加1个loopback接口,设置IP为172.0.16.1/24 R3 int loopback 2R3-LoopBack2ip addr 172.0.16.1 2

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论