设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 1680|回复: 6
收起左侧

OSPF详细配置

[复制链接]
发表于 2010-8-20 23:10:10 | 显示全部楼层 |阅读模式
启用OSPF动态路由协议
  router ospf 进程号
  
  进程号可以随意设置,只标识ospf为本路由器内的一个进程
  
  定义参与ospf的子网.该子网属于哪一个OSPF路由信息交换区域。
  network ip 子网号 通配符 area 区域号
  
  路由器将限制只能在相同区域内交换子网信息,不同区域间不交换路由信息。另外,区域0为主干OSPF区域。不同区域交换路由信息必须经过区域0。一般地,某一区域要接入OSPF0路由区域,该区域必须至少有一台路由器为区域边缘路由器,即它既参与本区域路由又参与区域0路由。
  
  OSPF区域间的路由信息总结
  如果区域中的子网是连续的,则区域边缘路由器向外传播给路由信息时,采用路由总结功能后,路由器就会将所有这些连续的子网总结为一条路由传播给其它区域,则在其它区域内的路由器看到这个区域的路由就只有一条。这样可以节省路由时所需网络带宽。
  
  设置对某一特定范围的子网进行总结:area 区域号 range 子网范围掩码
  
  指明网络类型 在需要进行OSPF路由信息的端口中,设置:
  ip ospf network broadcast或non-broadcast或point-to -mutlipoint
  
  一般地,对于 DDN,帧中继和X.25属于非广播型的网络,即non-broadcast
  
  对于非广播型的网络连接,需指明路由器的相邻路由器
  neighbor 相邻路由器的相邻端口的IP地址
  
  通过以上配置,路由器之间就可以完成交换路由信息了,其它设置,为了防止路由信息被窃取,可以对OSPF进行安全设置,只有合法的同一区域的路由器之间才能交换路由信息。
  
   
  设置步骤
  
  设置某区域使用安全设置MD5方式
  area 区域标号 autherfication message-digest
  
  可以采用明文方式 ,但建议采用MD5方式,较安全。
  
  设置某端口验证其相邻路由器相邻端口时的MD5口令,在端口设置模式下
  ip ospf message-digest-key 口令标号 MD5 口令字符串
  
  其中,在同一区域的相邻路由器的相邻端口的口令标号及口令字符串必须相同,同一路由器的不同端口的MD5口令可以不同,也可以某些端口使用安全设置,某些端口不使用安全设置。
  
   
  
  实例1 无安全,无路由总结的OSPF设置
  
  
  2511-1的设置
  
  Current configuration:
  
  !
  
  version 11.3
  
  no service password-encryption
  
  !
  
  hostname 2511-1
  
  !
  
  enable password cisco
  
  !
  
  interface Ethernet0
  
  ip address 192.4.1.1 255.255.255.0
  
  !
  
  interface Serial0
  
  ip address 192.3.1.1 255.255.255.0
  
  encapsulation frame-relay IETF
  
  no ip mroute-cache
  
  bandwidth 2000
  
  frame-relay map ip 192.3.1.2 100 broadcast
  
  frame-relay lmi-type cisco
  
  !
  
  interface Serial1
  
  ip address 192.1.1.1 255.255.255.0
  
  encapsulation ppp
  
  bandwidth 64
  
  !
  
  router ospf 1
  
  passive-interface Ethernet0
  
  network 192.1.1.0 0.0.0.255 area 0
  
  network 192.3.1.0 0.0.0.255 area 0
  
  network 192.4.1.0 0.0.0.255 area 0
  
  neighbor 192.1.1.2 priority 1
  
  neighbor 192.3.1.2 priority 1
  
  !
  
  ip classless
  
  !
  
  line con 0
  
  line 1 8
  
  line aux 0
  
  line vty 0 4
  
  !
  
  end
  
  2505的设置
  
  Current configuration:
  
  !
  
  version 11.2
  
  no service udp-small-servers
  
  no service tcp-small-servers
  
  !
  
  hostname 2505
  
  !
  
  enable secret 5 $1$GbYT$OR05giiLZxI4hEAO0F8kV1
  
  !
  
  hub ether 0 1
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 2
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 3
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 4
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 5
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 6
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 7
  
  link-test
  
  auto-polarity
  
  !
  
  hub ether 0 8
  
  link-test
  
  auto-polarity
  
  !
  
  interface Ethernet0
  
  ip address 192.1.4.1 255.255.255.0
  
  !
  
  interface Serial0
  
  ip address 192.1.2.1 255.255.255.0
  
  ip ospf network non-broadcast
  
  bandwidth 2000
  
  clockrate 2000000
  
  !
  
  interface Serial1
  
  ip address 192.1.1.2 255.255.255.0
  
  enpsuration ppp
  
  ip ospf network non-broadcast
  
  bandwidth 64
  
  clockrate 64000
  
  !
  
  router ospf 1
  
  passive-interface Ethernet0
  
  network 192.1.1.0 0.0.0.255 area 0
  
  network 192.1.2.0 0.0.0.255 area 2
  
  network 192.1.4.0 0.0.0.255 area 2
  
  neighbor 192.1.1.1 priority 1
  
  neighbor 192.1.2.2 priority 1
  
  !
  
  no ip classless
  
  ip ospf name-lookup
  
  !
  
  line con 0
  
  line aux 0
  
  line vty 0 4
  
  login
  
  !
  
  end
  
  internal -2的设置
  
  Current configuration :
  
  !
  
  version 11.2
  
  no service udp-small-servers
  
  no service tcp-small-servers
  
  !
  
  hostname internal-2
  
  !
  
  enable secret 5 $1$KX00$rTI/2TvDokWxT4xC6wvmi/
  
  !
  
  interface Ethernet0
  
  no ip address
  
  shutdown
  
  !
  
  interface Serial0
  
  ip address 192.1.2.2 255.255.255.0
  
  ip ospf network non-broadcast
  
  !
  
  interface Serial1
  
  no ip address
  
  shutdown
  
  !
  
  router ospf 1
  
  network 192.1.2.0 0.0.0.255 area 2
  
  neighbor 192.1.2.1 priority 1
  
  !
  
  no ip classless
  
  !
  
  line con 0
  
  line 1 16
  
  line aux 0
  
  line vty 0 4
  
  !
  
  end
  
   
  
  2514的设置
  
  Current configuration :
  
  !
  
  version 11.2
  
  no service udp-small-servers
  
  no service tcp-small-servers
  
  !
  
  hostname 2514
  
  !
  
  enable secret 5 $1$uoHU$Vks/lY CRi33z4TXs4qekI0
  
  !
  
  frame-relay switching
  
  !
  
  interface Ethernet0
  
  ip address 192.5.1.1 255.255.255.0
  
  !
  
  interface Ethernet1
  
  no ip address
  
  shutdown
  
  !
  
  interface Serial0
  
  ip address 192.3.1.2 255.255.255.0
  
  encapsulation frame-relay IETF
  
  bandwidth 2000
  
  clockrate 2000000
  
  frame-relay map ip 192.3.1.1 100 broadcast
  
  frame-relay intf-type dce
  
  !
  
  interface Serial1
  
  ip address 192.2.1.1 255.255.255.0
  
  no ip mroute-cache
  
  encapsulation X25 dce
  
  bandwidth 64
  
  x25 address 1234
  
  x25 htc 16
  
  x25 nvc 4
  
  x
发表于 2011-6-10 12:34:33 | 显示全部楼层
沙发 2011-6-10 12:34:33 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2011-6-21 01:29:02 | 显示全部楼层
板凳 2011-6-21 01:29:02 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2011-8-1 22:18:51 | 显示全部楼层
地板 2011-8-1 22:18:51 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-9-7 09:36:06 | 显示全部楼层
5# 2012-9-7 09:36:06 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2012-12-16 16:57:11 | 显示全部楼层
6# 2012-12-16 16:57:11 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-7-29 20:40:58 | 显示全部楼层
7# 2013-7-29 20:40:58 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-5-12 03:53 , Processed in 0.063394 second(s), 9 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表