博威---云架构决胜云计算

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4379|回复: 4

cisco随笔六强烈建议精华帖子

[复制链接]
发表于 2007-4-27 00:51:02 | 显示全部楼层 |阅读模式
今天花了一天时间把ospf的基本命令都总结了.绝对心血啊.今天bj的wolf又有两个去考笔试的挂了.可怜啊.明天wolf组织去长城.不能睡的太晚了..大家看一下我总结的命令吧.
OSPF配置命令
Router(config)#router ospf 10  进程号只在本地有效
Router(config)#network 192.168.10.0 0.0.0.255 area 0  正反掩码均可
Show ip protocols
Show ip route        查看路由表
Show ip route ospf     查看路由表中的OSPF路由项
Show ip ospf neighbors [detail]  显示OSPF邻居
Show ip ospf      显示OSPF路由器的各项信息
Show ip ospf interface f0/1 [brief] 显示接口的OSPF信息
Show ip ospf database [router]  显示各类LSA
Show ip ospf database router 192.168.20.2  
Debug ip ospf adj     显示邻居关系的建立
Show ip ospf border-routers  可以看到ASBR和ABR,但不能看到自已的角色,只能看到其它路由器的角色
Show ip ospf database-summary   LSDB的汇总信息
查看各类LSA的方法:
Show ip ospf database router 查看一类LSA 域内
Show ip ospf database network 查看二类LSA  MA网络
Show ip ospf database summary 查看三类LSA  域间
Show ip ospf database asbr-summary 查看四类LSA
Show ip ospf database external 查看五类LSA  域外
Show ip ospf database nssa-external 查看七类LSA
指定RID、修改路由器优先级、修改hello间隔、dead时间、接口带宽、ospf接口的cost值,修改cost计算公式的分子
Router(config-router)#router-id 1.1.1.1     指定RID
Router(config-if)#ip ospf priority 0-255 注意在接口下改
Router(config-router)#clear ip ospf process  重新启动OSPF路由选择进程,如果希望本路由器成为DR,则在更改优先级后用这一命令重新启动进程才能成为DR
Router(config-if)#ip ospf hello-interval 10
Router(config-if)#ip ospf dead-interval 40默认是hello间隔的四倍
Router(config-if)#bandwidth 5000 修改带宽,可通过修改带宽实现修改cost值的目的,这个属性是接口本身的属性。不起OSPF也能进行修改,且对其它路由进程同时产生效果
Router(config-if)#ip ospf cost 30 直接修改本接口在OSPF中的cost值
Router(config-router)#auto-cost reference-bandwidth 1000 修改COST计算公式的分子,单位是Mbps,即十的六次方
路由汇总:
Router(config-router)#area 0 range 172.16.32.0 255.255.254.0 域间汇总,area 0 是被汇总的区域,建议在本区域所有ABR上都做
Router(config-router)#summary-address 10.0.0.0 255.0.0.0 域外汇总,在ASBR的进程中做
下发默认路由:有两种方法
Router(config)#ip route 0.0.0.0 0.0.0.0 serial 0
Router(config-router)#default-information originate
如果没有写默认路由,用下面这种:
Router(config-router)#default-information originate always [metric-type 1 metric 3] 实际上这条命令也只能吸引路由,并不能指向一个网关,所以还是要配一个默认网关
配置stub区域区域内的每台路由器都要打上命令
Router(config-router)#area 2 stub 将area2配置为stub区域
Router(config-router)#area 2 default-cost 5 将自动下发的默认路由的cost值改为5,默认情况下是1
配置totally stub区域
Router(config-router)#area 2 stub no-summary 只需在ABR上配
配置NSSA区域
Router(config-router)#area 2 nssa
R2(config-router)#area 2 nssa default-information-originate 在ABR上做,会向nssa区域下发一条LSA7的默认路由
R2(config-router)#area 2 default-cost 6 (在ABR上做,改Seed Cost=6)
R2(config-router)#area 2 nssa default-information-originate metric 6 metric-type 1
Metric-type 1的作用是将N2类型的路由改为N1类型的路由
R2(config-router)#area 2 nssa no-redistribution 在ABR上做,阻止ABR上所直连的其它外部区域的路由进入nssa区域
R2(config-router)#area 2 nssa no-summary 把三类的LSA也干掉,同时也下发一条LSA3默认路由,并且会取代 default-information-originate所下发的N2的默认路由
<OSPF区域问题>
1)在ABR上起不同OSPF进程,进行OSPF之间的重分布。
   例如:R3的s1口在area 1中,进程号是10,s0口在area 3中,进程号是20
   Router ospf 10                           router ospf 20
   Redistribute ospf 20 subnets             redistribute ospf 10 subnets
2)tunnel
  Int tunnel 1                      int tunnel 3
  Tunnel source s1                  tunnel source s1
  Tunnel destination 13.1.1.3       tunnel destination 13.1.1.1
  Ip add 111.1.1.1 255.255.255.0    Ip add 111.1.1.3 255.255.255.0
  Router ospf 10                    router ospf 10
  Net 111.1.1.0 0.0.0.255 area 0    net 111.1.1.0 0.0.0.255 area 0
3)虚链路:
  最简单的方法,只需在区域的两台边界路由器上配就可以了
 R3(config-router)#area 2 virtual-link 2.2.2.2
          (中转区域)   (对方Router-ID)   
·远离Area0 / 分隔的Area 0       
R2#show ip ospf virtual-links
OSPF的认证
Link:同一链路上的路由器之间,在接口下做
 R1(config-router)#int s1
 R1(config-if)#ip ospf authentication-key wolf  (配明文密码)
 R1(config-if)#ip ospf authentication       (启动明文认证)
R1(config-if)#ip ospf message-digest-key 1 md5 wolf (配密文密码)
R1(config-if)#ip ospf authentication message-digest-key(启动密文认证)
Area:接口下配密码,进程下调用
 R1(config-router)#int s0
 R2(config-if)#ip ospf message-digest-key 1 md5 wolf   (配密文密码)
 R2(config-router)#area 0 authentication Message-digest  (启动密文认证)
 区域内的所有路由器都要认证。
Virtual-Link:
 R2(config-router)#area 2 virtual-link 2.2.2.2 message-digest-key 1 md5 wolf (配密文密码)
 R2(config-router)#area 2 virtual-link 2.2.2.2 authentication message-digest (启动密文认证)
 如果Area0启动认证,在Virtual-Link上也要启动相应的认证。
OSPF链路类型
·NON_BROADCAST
 ·3层是NBMA,2层是否让通过广播都无所谓。(FR map后加不加Broadcast皆可)
 在HUB端(R1)单播
 R1(config)#router os 110
 R1(config-router)#neighbor 145.1.1.4
 R1(config-router)#neighbor 145.1.1.5
 确保HUB成为DR,和Spoke交互路由信息。
 R1(config)#int s0
 R1(config-if)#ip ospf priority 2
 R4/R5(config-if)#ip ospf priority 0
 R4: O  5.5.5.0 [110/65] via 145.1.1.5, 00:00:07, Serial
 手工MAP(Spoke 端的互访)
 R4(config-if)#frame-relay map ip 145.1.1.5 401
 R5(config-if)#frame-relay map ip 145.1.1.4 501
·BROADCAST
 ·3层是BMA,2层也一定要让广播通过。(FR map后一定要加Broadcsat)
 R1(config-if)#fram ma ip 145.1.1.4 104 broadcast
 R1(config-if)#fram ma ip 145.1.1.5 105 broadcast
 确保HUB成为DR,和Spoke交互路由信息。
 R1(config)#int s0
 R1(config-if)#ip ospf priority 2
 R4/R5(config-if)#ip ospf priority 0
 R4: O  5.5.5.0 [110/65] via 145.1.1.5, 00:00:07, Serial
 手工MAP
 R4(config-if)#frame-relay map ip 145.1.1.5 401 broadcast
 R5(config-if)#frame-relay map ip 145.1.1.4 501 broadcast
 
·POINT_TO_MULTIPOINT NON_BROADCAST   cisco专有的
 ·3层是NBMA,2层是否让通过广播都无所谓。(FR map后加不加Broadcast皆可)
 在HUB端(R1)单播
 R1(config)#router os 110
 R1(config-router)#neighbor 145.1.1.4
 R1(config-router)#neighbor 145.1.1.5
 R4: O  145.1.1.5/32 [110/128] via 145.1.1.1, 00:00:24, Serial1
 产生/32主机路由,且下一跳指向HUB,所以不需手工MAP。这就是32位的好处。
·POINT_TO_MULTIPOINT    全自动,最好的
 ·3层是允许广播,2层也一定要让广播通过。(FR map后一定要加Broadcsat)

·R1#show ip os neighbor detail
 DR is 0.0.0.0 BDR is 0.0.0.0
 P2P/P2MP/P2MP NBMA都不需要选举DR/BDR,所以DR is 0.0.0.0 BDR is 0.0.0.0
 
·POINT_TO_POINT(做不同网段)
 HUB端起2个P2P子接口:
 interface Serial0
 encapsulation frame-relay
 no frame-relay inverse-arp    关闭反向ARP
 interface Serial0.14 point-to-point
 ip address 14.1.1.1 255.255.255.0
 frame-relay interface-dlci 104   
 interface Serial0.15 point-to-point
 ip address 15.1.1.1 255.255.255.0
 frame-relay interface-dlci 105
发表于 2007-4-27 19:31:56 | 显示全部楼层
绝对支持原创
在加精的基础上,高亮
发表于 2008-7-19 12:40:16 | 显示全部楼层
精华就是精华     LZ辛苦了!!    借鉴一下 自己加几个TP  这不教程有了嘛!
发表于 2008-11-20 14:16:07 | 显示全部楼层
顶起来,加几个TP  收藏  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|boway Inc. ( 冀ICP备10011147号 )

GMT+8, 2024-5-6 07:00 , Processed in 0.095895 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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