相关协议及标准:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

1OSPFv2RFC 2328

2OSPF的不透明LSA选项:RFC 2370

3OSPF的次桩区域(NSSA)选项:RFC 3101

4OSPF的桩路由器广播:RFC 3137

5OSPFv2的流量工程扩展:RFC 3630

6)平稳OSPF重启:RFC 3623

 

相关命令汇总:

命令

命令模式和描述

router ospf process-id

全局配置模式;进入对应PIDOSPF配置模式

network ip-address [wildcard-mask] area area-id

OSPF配置模式;定义匹配参数,将接口IP地址与其比较,如相符,即在该接口激活OSPF

ip ospf process-id area area-id [secondaries none]

接口配置模式;在接口激活OSPF的另一种方法

neighbor ip-address [priority number] [poll-interval seconds] [cost number] [database-filter all]

OSPF配置模式;当需要定义邻接路由器的时候使用,定义了邻接路由器的IP地址、优先权、开销和查询间隔

auto-cost reference-bandwidth ref-bw

OSPF配置模式;修改OSPF参考带宽

router-id ip-address

OSPF配置模式;静态设置RID

ospf log-neighbor-changes [detail]

OSPF配置模式;显示邻接路由器状态改变的日志,默认启动

passive-interface [default] {interface-type interface-number}

OSPF配置模式;使OSPF在指定接口上停止发送HelloOSPF会广播该子网为桩网络

area area-id stub [no-summary]

OSPF配置模式;设置区域类型为桩区域或完全桩区域

area area-id nssa [no-redistribution] [default-information-originate [metric] [metric-type]] [no-summary]

OSPF配置模式;设置区域类型为NSSA或完全NSSA

area area-id default-cost cost

OSPF配置模式;设置ABR创建的默认路由的开销并将其发送到桩区域

area area-id nssa translate type7 suppress-fa

OSPF配置模式;要求NSSAABR将由7类型LSA转换的5类型LSA的转发地址设为0.0.0.0

area area-id range ip-address mask [advertise | not-advertise] [cost cost]

OSPF配置模式;在ABR上汇总路由为更大前缀。若使用not-advertise选项,则可过滤3类型LSA

area {area-id} filter-list prefix {prefix-list-name in | out}

OSPF配置模式;在ABR上过滤3类型LSA

distribute-list [ACL] | [route-map map-tag] in [int-type | int-number]

OSPF配置模式;配置ACL或前缀列表来过滤OSPF置入路由表的路由

area area-id virtual-link router-id [authentication [message-digest | null]] [hello-interval seconds] [retransmit-interval seconds] [transmit-delay seconds] [dead-interval seconds] [[authentication-key key] | [message-digest-key key-id md5 key]]

OSPF配置模式;创建虚链路,并配置接口

ip ospf hello-interval seconds

接口子命令;设置Hello的间隔

ip ospf dead-interval {seconds | minimal hello-multiplier multiplier}

接口子命令;设置dead间隔,或者设置为最小间隔(1秒),同时可配置是Hello间隔的多少倍

ip ospf name-lookup

全局模式;使路由器使用DNS来关联RID和主机名,以用于show命令输出

ip ospf cost interface-cost

接口子命令;设置接口开销

ip ospf mtu-ignore

接口子命令;设置路由器在发送DD包时忽视对等值MTU的检查

ip ospf network {broadcast | non-broadcast | {point-to-multipoint [non-broadcast] | point-to-point}}

接口子命令;设置接口的OSPF网络类型

ip ospf priority number-value

接口子命令;设置接口的OSPF优先权

ip ospf retransmit-interval seconds

接口子命令;设置接口上LSA重传的间隔

ip ospf transmit-delay seconds

接口子命令;设置接口上LSU传输的期望时间

max-metric router-lsa [on-startup {announce-time | wait-for-bgp}]

OSPF配置模式;配置桩路由器,延迟其成为过境路由器

show ip ospf border-routers

用户模式;显示ABRASBR隐藏的LSA

show ip ospf [process-id [area-id]] database

用户模式;显示OSPFLSDB

show ip ospf neighbor [interface-type interface-number] [neighbor-id] [detail]

用户模式;显示关于OSPF邻接路由器的信息

show ip ospf [process-id] summary-address

用户模式;显示OSPF汇总的信息

show ip ospf virtual-links

用户模式;显示虚链路的状态信息

show ip route ospf

用户模式;显示IP路由表中的OSPF路由

show ip ospf interface [interface-type interface-number] [brief]

用户模式;显示每接口的OSPF协议定时器及状态信息

show ip ospf statistics [detail]

用户模式;显示OSPFSPF计算统计信息

clear ip ospf [pid] {process | redistribution | counters [neighbor [neighbor-interface] [neighbor-id]]}

激活模式;重启OSPF进程,清除重分发路由,或清除OSPF计数器

debug ip ospf hello

激活模式;显示关于Hello的消息

debug ip ospf adj

激活模式;显示关于邻接关系的消息

 

OSPF中的定时器

1MaxAgeLSA可停留在LSDB中的最长时间,默认3600秒。

2LSRefreshLSA重新洪泛的间隔,默认1800秒。

3Hello:每接口设置,Hello发送的时间间隔,根据接口类型的不同,默认为1030秒。

4Dead:每接口设置,等待接收邻接路由器Hello的最长时间,如果超时,即认为邻接路由器失效,默认是Hello4倍。

5Wait:每接口设置,与Dead间隔一样值,表示路由器等待接收声明DRHello的最长时间。

6Retransmission:每接口设置,LSU重新传送的等待时间,默认为5秒。

7Inactivity:递减定时器,每邻接路由器设置,用来监测邻接路由器在Dead间隔内是否发送Hello消息,其起始值等于Dead间隔的时长,随时间递减,如果在Dead间隔内收到Hello,则重置为Dead间隔的时长。

8Poll Interval:在NBMA网络中,当邻接路由器停止时,发送Hello消息的间隔,默认60秒。

9FloodPacing):每接口设置,在洪泛LSA时连续LSU发送的间隔,默认33毫秒。

10RetransmissionPacing):每接口设置,定义重传包的间隔,默认66毫秒。

11Lsa-groupPacing):每OSPF进程设置,独立的LSALSRefresh超时间隔,通过将在该间隔内LSRefresh超时的多个LSA一起洪泛,可以提升LSU重洪泛的效率,默认是240秒。

 

OSPF邻接路由器状态

1Down:超过Dead间隔时间没接收到邻接路由器的Hello消息。

2Attempt:路由器发送Hello到手工配置的邻接路由器。

3Init:接收到邻接路由器的一个Hello,但该Hello中不包含路由器的RID,这是在Hello参数不匹配下的状态。

42WAY:接收到邻接路由器的一个Hello,且该Hello中包含路由器的RID,这是两台非DR邻接路由器的稳定状态。

5ExStart:正在协商DD序列号和主/从关系。

6Exchange:完成协商,并正在交换DD包。

7Loading:所有DD包交换完毕,并正在通过LSU包交换完整LSDB记录。

8Full:邻接路由器建立邻接关系(完全邻接),同一区域的LSDB记录一致,路由表计算开始。

 

OSPF的一些数值范围

1)单接口开销:165535216-1

2)完整路由开销:116777215224-1

3)无穷路由开销:16777215

4)参考带宽(单位:Mbps):14294967

5OSPFPID165535