OSPF多区域配置

2023-06-08,,

1、配置三台路由器IP
R1(config)#INTER S1/0
R1(config-if)#IP ADDress 192.1.12.1 255.255.255.0
R1(config-if)#no shut

R1(config)#inter lo 1
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#no shut

(注意:IP OSPF NETWORK POINT-TO-POINT 意思是不要指定1.1.1.1为32位)

R1(config-if)#inter s1/1
R1(config-if)#ip address 192.1.13.1 255.255.255.0
R1(config-if)#no shut

R2(config)#inter s1/0
R2(config-if)#ip address 192.1.12.2 255.255.255.0
R2(config-if)#no shut

R2(config-if)#inter lo 1
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#ip ospf network point-to-point  //不让它认为这是一条主机路由

R3(config)#inter s1/1
R3(config-if)#ip address 192.1.13.3 255.255.255.0
R3(config-if)#no shut

R3(config-if)#inter lo 1
R3(config-if)#ip address 3.3.3.3 255.255.255.0
R3(config-if)#ip ospf network point-to-poin
完成配置后在R1上测试两边的连通性

2、启用OSPF协议
R1(config)#router ospf ?
  <1-65535>  Process ID
R1(config)#router ospf 100
手工指定ROUTE-ID
R1(config-router)#router-id 1.1.1.1
指定区域

R1(config-router)#network 192.1.12.0 0.0.0.255 ?
  area  Set the OSPF area ID
R1(config-router)#network 192.1.12.0 0.0.0.255 a 0
R1(config-router)#network 192.1.13.0 0.0.0.255 a 0
R1(config-router)#network 1.1.1.1 0.0.0.0 a 0

R2(config)#router ospf 100   //可以不一制
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 192.1.12.0 0.0.0.255 a 0
R2(config-router)#network 2.2.2.0 0.0.0.255 a 1

R3(config)#router ospf 100
R3(config-router)#router-id 3.3.3.
R3(config-router)#network 192.1.13.0 0.0.0.255 a 0
R3(config-router)#network 3.3.3.0 0.0.0.255 a 2

3、查看邻居关系
R1#show ip ospf neighbor
4、查看路由表
R1#show ip route

5、在R1上PING下区域1的环回地址(2.2.2.2),可以通
PING区域2(3.3.3.3),也可以通
6、可以查看数据库
R1#show ip ospf database
7、几个OSPF常用命令
R1#show ip ospf ?
show ip ospf border-routers (查看路由器的角色等)
R1#show ip ospf(查看基本信息,比如进程号)
R1#show ip protocols(查看运行的协议)

OSPF多区域配置的相关教程结束。

《OSPF多区域配置.doc》

下载本文的Word格式文档,以方便收藏与打印。