会计考友 发表于 2012-8-3 20:28:11

菜鸟学习CCNA-OSPF

 OSPF(Open Shortest Path First,开放最短链路优先)路由协议是典型的链路状态路  由协议。OSPF 作为一种内部网关协议(Interior Gateway Protocol,IGP),用于在同一个自治系统(AS)中的路由器之间交换路由信息。,OSPF 将网络划分为四种类型:广播多路访问型(BMA)、非广播多路访问型(NBMA)、点到点型(Point-to-Point)、点到多点型(Point-to-MultiPoint)。
  点到点链路上的OSPF拓扑图:
  具体配置:
  R1(config)#router ospf 1               //启用ospf协议
  R1(config-router)#router-id 1.1.1.1      //定义路由id
  R1(config-router)#network 1.1.1.0 255.255.255.0 area 0 //通告网络
  R1(config-router)#network 192.168.12.0 255.255.255.0 area 0
  R2(config)#router ospf 1
  R2(config-router)#router-id 1.1.1.1
  R2(config-router)#network 192.168.12.0 255.255.255.0 area 0
  R2(config-router)#network 192.168.23.0 255.255.255.0 area 0
  R2(config-router)#network 2.2.2.0 255.255.255.0 area 0
  R3(config)#router ospf 1
  R3(config-router)#router-id 3.3.3.3
  R3(config-router)#network 192.168.23.0 255.255.255.0 area 0
  R3(config-router)#network 192.168.34.0 255.255.255.0 area 0
  R3(config-router)#network 3.3.3.0 255.255.255.0 area 0
  R4(config)#route ospf 1
  R4(config-router)#router-id 4.4.4.4
  R4(config-router)#network 192.168.34.0 255.255.255.0 area 0
  R4(config-router)#network 4.4.4.0 255.255.255.0 area 0
  R1#show ip router
  1.0.0.0/24 is subnetted, 1 subnets
  C       1.1.1.0 is directly connected, FastEthernet0/1
  4.0.0.0/24 is subnetted, 1 subnets
  O       4.4.4.0 via 192.168.12.2, 00:54:54, Serial0/0
  C    192.168.12.0/24 is directly connected, Serial0/0
  O    192.168.23.0/24 via 192.168.12.2, 00:55:05, Serial0/0
  192.168.34.0/24 via 192.168.12.2, 00:54:54, Serial0/0
  输出结果表明同一个区域内通过OSPF 路由协议学习的路由条目用代码“O”表示。
  R#show ip ospf database         拓扑结构数据库的信息
  R#show ip ospf neighbor         邻居路由表
  R#show ip ospf interface ospf    接口详细信息
  R#show ip ospf                         该命令显示OSPF 进程及区域的细节
页: [1]
查看完整版本: 菜鸟学习CCNA-OSPF