03-路由命令
本章节下载: 03-路由命令 (342.49 KB)
目 录
1.2.2 display ip route address
1.5.1 default-information originate
1.5.4 ip rip authentication key-chain
1.5.5 ip rip authentication mode
1.5.6 ip rip authentication string
1.6.1 area { ip-address | router-id } authentication
1.6.2 area { ip-address | router-id } range
1.6.5 default-information originate
1.6.7 ip ospf authentication-key
1.6.11 ip ospf message-digest-key
1.6.14 ip ospf retransmit-interval
1.6.21 display ip ospf database
1.6.22 display ip ospf interface
ip route命令用来配置静态路由。
no ip route命令用来删除静态路由。
【命令】
ip route { network/prefix-len | network mask | isp } { nexthop | interface | null0 } [ ad ] [ weight weights ] [track name]
ip route { network/prefix-len } [ nexthop | interface ] blackhole
no ip route { network/prefix-len | network mask | isp } { nexthop | interface | null0 } [ ad ] [ weight weights ]
【缺省情况】
缺省情况下,未配置静态路由。
【视图】
系统视图
【参数】
network:目的网段地址。
prefix-len:网络掩码长度。
mask:网络掩码。
isp:ISP路由址库。
nexthop:下一跳地址。
interface:路由出接口。
null0:无出接口,即该路由为黑洞路由。
blackhole:黑洞路由。
ad:管理距离,范围1~255,静态路由缺省为1,直连路由缺省为0。
weight:路由的权重。
weights:权重值,范围是1~255。缺省是1。
track: 地址探测。
name: 地址探测名称。
【使用指导】
静态路由是由用户配置的路由。当用户确信到达某个网段应该先转发到某个地址时,可以通过ip route 命令配置这个静态路由,同时可以配置该静态路由的权重,用于负载分担。
【举例】
# 配置静态路由,目的网段地址是1.1.1.0、掩码是24位、下一跳是192.168.1.1。
host# system-view
host(config)# ip route 1.1.1.0/24 192.168.1.1
【相关命令】
· display ip route
display ip route命令用来显示系统路由表。
【命令】
display ip route [ summary | connected | static | rip | ospf | supernets-only ]
【视图】
用户视图
【参数】
summary:显示汇总路由。
connected:显示直连路由。
static:显示静态路由。
rip:显示RIP路由。
ospf:显示OSPF路由。
supernets-only:显示超网路由。
【举例】
# 显示系统路由表。
host # display ip route
Codes: C - connected, S - static, R - RIP, O - OSPF,
P - PPPOE route, D - DHCP route, I - ISP route,
L - LLB route, > - selected route, * - FIB route
S>* 1.1.1.0/24 [1/0] via 192.168.1.1 weight 1, ge0
S 3.0.0.0/24 [1/0] via 3.3.3.3 weight 1 inactive
C>* 3.3.3.0/24 is directly connected, ge0
S>* 4.0.0.0/24 [1/0] via 192.168.1.1 weight 1, ge0, bh
S>* 5.0.0.0/24 [1/0] is directly connected, Null0, bh
C>* 127.0.0.0/8 is directly connected, lo
S>* 192.168.0.0/16 [1/0] via 192.168.1.1 weight 1, ge0
C>* 192.168.1.0/24 is directly connected, ge0
表1-1 display ip route 命令显示信息描述表
字段 |
描述 |
|
Codes |
路由类型和状态标示 |
|
C |
直连路由 |
|
S |
静态路由 |
|
R |
RIP路由 |
|
O |
OSPF路由 |
|
P |
PPPOE路由 |
|
D |
DHCP路由 |
|
I |
ISP路由 |
|
> |
路由已经被优选 |
|
* |
路由已经加入FIB表 |
|
X.X.X.X/X |
目的网段 |
|
[X/Y] |
X表示距离矢量,Y表示路由的度量 |
|
via |
下一条地址 |
|
is directly connected |
路由指定了出接口 |
|
weight |
下一跳的权重值 |
|
inactive |
路由没有激活 |
|
interface |
路由出接口 |
|
bh |
黑洞路由 |
# 显示路由汇总信息。
host# display ip route summary
Route Source Routes FIB
connected 3 3
static 6 4
------
Totals 9 7
表1-2 display ip route summary命令显示信息描述表
字段 |
描述 |
Route Source |
路由类型 |
Routes |
路由个数 |
FIB |
已经加入FIB表的路由个数 |
Totals |
总个数 |
display ip route address命令用来显示和特定地址相关的路由表。
【命令】
display ip route { address | network [ longer-prefixes ] }
【视图】
用户视图
【参数】
address:显示地址所属路由表项。
network:显示和网络匹配的路由表项,格式为X.X.X.X/Y。
longer-prefixes:显示和网络掩码最长匹配的路由表项。
【使用指导】
longer-prefixes表示最长匹配。如果network输入3.3.0.0/16,只显示目的网段是3.3.0.0/16的地址。如果加上longer-prefixes参数,可以匹配3.3.3.0/24的地址。因为3.3.3.0和16位掩码相与,结果也是3.3.0.0。
【举例】
# 显示3.3.1.1所属路由表项。
host# display ip route 3.3.1.1
Routing entry for 3.3.0.0/16
Known via "static", distance 1, metric 0, best
* 3.3.3.1, via ge0
表1-3 display ip route address命令显示信息描述表
字段 |
描述 |
Routing entry for |
路由表项 |
Known via |
地址类型 |
distance |
管理距离 |
metric |
度量值 |
best |
路由是否被优选 |
* X.X.X.X |
下一跳地址 |
via |
后接出接口 |
proute命令用来添加策略路由。
no proute命令用来删除策略路由。
【命令】
proute { if_in | any } { sip | any } { dip | any } { sev | any } { user | any } { app | any } { schedule | always } { nexthop | interface } [ id ] [ weight weights ]
no poute id
【缺省情况】
缺省情况下,未配置策略路由。
【视图】
系统视图
【参数】
if_in:流量入接口。
any:任何入接口
sip:流量的源IP地址。
any:任何源地址。
dip:流量的目的IP地址。
any:任何目的地址。
sev:流量匹配的服务组。
any:任何服务组。
user:流量所属用户。
any:任何用户
app:流量所属应用。
any:任何应用。
schedule:流量所属时间对象。
always:任何时间。
nexthop:下一跳地址。
interface:路由出接口。
id:策略路由ID号,范围是1~65535。缺省从1开始分配,依次递增。
weight:策略路由权重。
weights:策略路由的权重值,范围是1~255,默认是1。
【使用指导】
策略路由可以在流量进入设备的时候生效,也可以对于设备本地发起的流量生效,当入接口为any时,可以匹配本地接口发起的流量。
【举例】
# 将来自192.168.1.0/24网段的数据包路由至设备200.0.0.2上。
host# system-view
host(config)# address SRC1
host(config-ge0)# ip subnet 192.168.1.0/24
host(config-ge0)# exit
host(config)# proute any SRC1 any any any any always 200.0.0.2
【相关命令】
· display proute
proute insert命令用来插入一条策略路由。
【命令】
proute insert { if_in | any } { sip | any } { dip | any } { sev | any } { user | any } { app | any } { schedule | always } { nexthop | interface } [ id ] [ weight weights ] before compare-id
【缺省情况】
缺省情况下,未配置策略路由。
【视图】
系统视图
【参数】
if_in:流量入接口。
any:任何入接口
sip:流量的源IP地址。
any:任何源地址。
dip:流量的目的IP地址。
any:任何目的地址。
sev:流量匹配的服务组。
any:任何服务组。
user:流量所属用户。
any:任何用户
app:流量所属应用。
any:任何应用。
schedule:流量所属时间对象。
always:任何时间。
nexthop:下一跳地址。
interface:路由出接口。
id:策略路由ID号,范围是1~65535。缺省从1开始分配,依次递增。
weight:策略路由权重。
weights:策略路由的权重值,范围是1~255,默认是1。
before:在指定ID之前插入ID。
compare-id:要插入位置的ID号。
【使用指导】
策略路由的匹配是有先后顺序的,具体顺序和display proute顺序相同。
【举例】
# 将来自192.168.1.0/24网段的数据包路由至设备200.0.0.2上,并且将此策略路由插入到ID为10的策略路由之前。
host# system-view
host(config)# address SRC1
host(config-ge0)# ip subnet 192.168.1.0/24
host(config-ge0)# exit
【相关命令】
· display proute
proute move命令用来移动策略路由匹配顺序。
【命令】
proute move id { before | after } compare-id
【视图】
系统视图
【参数】
id:策略路由ID号,范围是1~65535。缺省从1开始分配,依次递增。
after: 在指定ID之后插入策略路由。
before:在指定ID之前插入策略路由。
compare-id:要插入位置的ID号。
【使用指导】
策略路由的匹配是有先后顺序的,具体顺序和display proute顺序相同。
【举例】
# 将ID为5的策略路由插入到ID为10的策略路由之前。
host# system-view
host(config)# proute move 5 before 10
【相关命令】
· display proute
display proute命令用来显示配置的策略路由。
【命令】
display proute
【视图】
用户视图
【举例】
# 用来显示配置的策略路由。
host# display proute
proute any ge0 any any any any always 192.168.1.1 1 active
表1-4 display proute命令显示信息描述表
字段 |
描述 |
active |
策略路由是否可以使用 |
isp network命令用来配置ISP路由地址库。
no isp network命令用来删除ISP路由地址库。
【命令】
isp network name
no isp network name
【缺省情况】
缺省情况下,设备内部预置了联通(ChinaUnicom)、移动(ChinaMobile)、电信(ChinaTelecom)和教育网(ChinaMobile)四个ISP路由地址库。
【视图】
系统视图
【参数】
name:ISP路由地址库名称,为1~31个字符组成的字符串,不能与预定义的ChinaUnicom、ChinaMobile 、ChinaTelecom、ChinaMobile相同。
【使用指导】
配置了ISP路由地址库后,会进入ISP路由配置视图。
【举例】
# 配置名字为ISP1的ISP路由。
host# system-view
host(config)# isp network ISP1
host(config-isp)#
【相关命令】
· subnet
subnet命令用来配置ISP路由地址库的子网地址。
no subnet命令用来删除ISP路由地址库的子网地址。
【命令】
subnet networks
no subnet networks
【缺省情况】
缺省情况下,设备内部预置了联通(ChinaUnicom)、移动(ChinaMobile)、电信(ChinaTelecom)和教育网(ChinaMobile)四个ISP路由地址库。
【视图】
ISP路由视图
【参数】
networks:ISP路由的子网地址,为X.X.X.X/Y格式。
【使用指导】
用户自定义的ISP,每个ISP最多有200个地址网段。
【举例】
#在名字为ISP1的ispISP路由址库中,加入子网202.06.0.0/24
host# system-view
host(config)# isp network ISP1
host(config-isp)# subnet 202.106.0.0/24
【相关命令】
· isp network
default-information originate命令用来配置发布一条默认路由。
no default-information originate命令用来删除发布默认路由。
【命令】
default-information originate
no default-information originate
【缺省情况】
缺省情况下,不发布默认路由。
【视图】
RIP配置视图
【举例】
# 配置RIP发送一条默认路由。
host# system-view
host(config)# router rip
host(config-rip)# default-information originate
【相关命令】
· display ip rip status
default-metric命令用来配置重发布路由的默认度量。
no default-metric命令用来恢复重发布路由的默认度量值。
【命令】
default-metric metric
no default-metric [ metric ]
【缺省情况】
缺省情况下,重发布路由的默认度量是1。
【视图】
RIP配置视图
【参数】
metric:度量值,范围是1~16。
【使用指导】
default-metric设置的度量值被redistribute使用,如果redistribute没有配置metric,则按照default-metric重发布。
【举例】
# 配置配置重发布路由的默认度量为2。
host# system-view
host(config)# router rip
host(config-rip)# default-metric 2
【相关命令】
· display ip rip status
distance命令用来配置RIP的管理距离。
no distance命令用来恢复RIP的管理距离的缺省值。
【命令】
distance ad
【缺省情况】
缺省情况下,RIP的管理距离是120。
【视图】
RIP配置视图
【参数】
ad:RIP要配置的管理距离,范围是1~255,缺省是120。
【使用指导】
在路由器中可能会运行多个IGP路由协议,如果想让RIP路由具有比从其它路由协议学来的路由更高的优先级,需要配置小的管理距离。管理距离的高低将最后决定IP路由表中的路由是通过哪种路由算法获取的最佳路由。
【举例】
# 配置RIP的管理距离为100。
host# system-view
host(config)# router rip
host(config-router)# distance 100
【相关命令】
· display ip rip status
ip rip authentication key-chain命令用来配置key的认证钥匙链。
no ip rip authentication key-chain命令用来删除配置key认证钥匙链。
【命令】
ip rip authentication key-chain keychain
no ip rip authentication key-chain keychain
【缺省情况】
缺省情况下,未配置接口认证钥匙链。
【视图】
接口视图
【参数】
keychain:认证钥匙链的名称。
【使用指导】
RIP配置认证是在接口上进行的,首先选择认证方式,然后指定所使用的钥匙链或密文。
接口的key-chain和key-string配置只能二选一。
明文认证时,首选key-string,如果没有key-string,选择key-chain。
密文认证时,首选key-chain,如果没有key-chain,选择key-string。
【举例】
# 配置接口选择认证钥匙链key1认证。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip authentication key-chain key1
【相关命令】
· key chain
· key
· key-string
· ip rip authentication mode
· ip rip authentication string
ip rip authentication mode命令用来配置接口的RIP认证模式。
no ip rip authentication mode命令用来关闭接口的RIP认证。
【命令】
ip rip authentication mode { md5 | text }
no ip rip authentication mode { md5 | text }
【缺省情况】
缺省情况下,接口的RIP没有配置认证。
【视图】
接口视图
【参数】
md5:认证密文以md5方式发送。
text:认证的密文以明文方式发送。
【使用指导】
RIP配置认证是在接口上进行的,首先选择认证方式,然后指定所使用的钥匙链或密文。
RIP中每一个路由更新报文最大可包含25条路由,做了明文认证后只能包含24条,做了MD5认证后只能包含23条。
明文认证时,被认证方发送key chian时,发送最低ID值的key,并且不携带ID;认证方接收到 key后,和自己key chain的全部key进行比较,只要有一个key匹配就通过对被认证方的认证。
密文认证时,被认证方发送key时,发送最低ID值的key,并且携带了ID,认证方接收到key后,首先在自己key chain中查找是否具有相同ID的key,如果有相同ID的key并且key相同就通过认 证,key值不同就不通过认证。如果没有相同ID的key,就查找该ID往后的最近ID的key;如果没有往后的ID,认证失败。
【举例】
# 配置接口ge0的rip认证方式是md5。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip authentication mode md5
【相关命令】
· key chain
· key-string
· key
· ip rip authentication key-chain
· ip rip authentication string
ip rip authentication string命令用来配置key的认证字符串。
no ip rip authentication string命令用来删除配置的key认证字符串。
【命令】
ip rip authentication string key-string
no ip rip authentication string [ key-string ]
【缺省情况】
缺省情况下,未配置接口认证字符串。
【视图】
接口视图
【参数】
key-string:要配置的认证字符串。
【使用指导】
RIP配置认证是在接口上进行的,首先选择认证方式,然后指定所使用的钥匙链或密文。
接口的key-chain和key-string配置只能二选一。
· 明文认证时,首选key-string,如果没有key-string,选择key-chain。
· 密文认证时,首选key-chain,如果没有key-chain,选择key-string。
【举例】
# 配置接口认证字符串为123456。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip authentication string 123456
【相关命令】
· key chain
· key
· key-string
· ip rip authentication mode
· ip rip authentication string
ip rip receive命令用来配置接口报文接收版本。
no ip rip receive命令用来恢复接口接收报文版本的缺省值。
【命令】
ip rip send receive {1 | 2 }
no ip rip send receive {1 | 2 }
【缺省情况】
缺省情况下,接口按照RIP-2发送报文,按照RIP-1和RIP-2接收报文。
【视图】
接口视图
【参数】
1:接口只接收版本号为1的RIP报文。
2:接口只接收版本号为2的RIP报文。
【使用指导】
用户可以在RIP视图下配置RIP版本,也可在接口上配置RIP版本:
· 当全局和接口都没有进行RIP版本配置时,接口发送RIP-1广播报文,可以接收RIP-1广播、单播报文、RIP-2广播/组播/单播报文。
· 如果接口没有进行RIP版本配置,接口运行的RIP版本将以全局配置的版本为准,如果希望接口配置的RIP版本与全局配置的不一样,则进入接口视图配置接口运行的RIP版本。
· 当接口运行的RIP版本为RIP-1时,发送RIP-1广播报文,可以接收RIP-1广播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在组播方式时,发送RIP-2组播报文,可以接收RIP-2广播/组播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在广播方式时,发送RIP-2广播报文,可以接收RIP-1广播/单播报文、RIP-2广播/组播/单播报文。
【举例】
# 配置ge0只接受版本号为1的RIP报文。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip receive version 1
【相关命令】
· display ip rip status
ip rip send命令用来配置接口发送报文版本号。
no ip rip send命令用来恢复接口发送报文版本的缺省值。
【命令】
ip rip send version {1 | 2 }
no ip rip send version {1 | 2 }
【缺省情况】
缺省情况下,接口按照RIP-2发送报文,按照RIP-1和RIP-2接收报文。
【视图】
接口视图
【参数】
1:接口只发送版本号为1的RIP报文。
2:接口只发送版本号为2的RIP报文。
【使用指导】
用户可以在RIP视图下配置RIP版本,也可在接口上配置RIP版本:
· 当全局和接口都没有进行RIP版本配置时,接口发送RIP-1广播报文,可以接收RIP-1广播、单播报文、RIP-2广播/组播/单播报文。
· 如果接口没有进行RIP版本配置,接口运行的RIP版本将以全局配置的版本为准,如果希望接口配置的RIP版本与全局配置的不一样,则进入接口视图配置接口运行的RIP版本。
· 当接口运行的RIP版本为RIP-1时,发送RIP-1广播报文,可以接收RIP-1广播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在组播方式时,发送RIP-2组播报文,可以接收RIP-2广播/组播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在广播方式时,发送RIP-2广播报文,可以接收RIP-1广播/单播报文、RIP-2广播/组播/单播报文。
【举例】
# 配置ge0只发送版本号为1的RIP报文。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip send version 1
【相关命令】
· display ip rip status
ip rip split-horizon命令用来配置RIP水平分割。
no ip rip split-horizon命令用来删除RIP水平分割配置。
【命令】
ip rip split-horizon [ poisoned-reverse ]
no ip rip split-horizon [ poisoned-reverse ]
【缺省情况】
缺省情况下,接口下未配置水平分割。
【视图】
接口视图
【参数】
poisoned-reverse:启用毒性逆转。
【使用指导】
配置水平分割可以使得从一个接口学到的路由不能通过此接口向外发布,用于避免相邻路由器间的路由环路。
配置毒性逆转后,从一个接口学到的路由还可以从这个接口向外发布,但这些路由的度量值会设置为16(即不可达),可以用于避免相邻路由器间的路由环路。
【举例】
# 配置接口ge0上,启用毒性逆转。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip rip split-horizon poisoned-reverse
【相关命令】
· display ip rip status
key 命令用来添加秘钥。
no key 命令用来删除配置的秘钥。
【命令】
key id
no key id
【缺省情况】
缺省情况下,未配置认证秘钥。
【视图】
钥匙链视图
【参数】
id:配置的秘钥的ID,范围是0~2147483647。
【使用指导】
配置了key后,会进入钥匙配置视图。
明文认证时,被认证方发送key chian时,发送最低ID值的key,并且不携带ID;认证方接收到 key后,和自己key chain的全部key进行比较,只要有一个key匹配就通过对被认证方的认证。
密文认证时,被认证方发送key时,发送最低ID值的key,并且携带了ID,认证方接收到key后,首先在自己key chain中查找是否具有相同ID的key,如果有相同ID的key并且key相同就通过认 证,key值不同就不通过认证。如果没有相同ID的key,就查找该ID往后的最近ID的key;如果没有往后的ID,认证失败。
【举例】
# 添加认证钥匙链key1,钥匙链中添加钥匙10。
host# system-view
host(config)# key chain key1
host(config-keychain)# key 10
host(config-keychain-key)#
【相关命令】
· key chain
· key-string
· ip rip authentication mode
· ip rip authentication key-chain
· ip rip authentication string
key chain命令用来配置认证钥匙链。
no key chain命令用来删除认证钥匙链。
【命令】
key chain name
no key chain name
【缺省情况】
缺省情况下,未配置认证钥匙链。
【视图】
系统视图
【参数】
name:认证钥匙链名称,为1~31字符组成的字符串。
【使用指导】
RIP-2才支持认证,有明文认证和密文认证两种方法,这两种方法中均需要配置钥匙链key-chain或者key-string。
配置了认证钥匙链后,会进入钥匙链视图。
【举例】
# 添加认证钥匙链key1。
host# system-view
host(config)# key chain key1
host(config-keychain)#
【相关命令】
· key
· key-string
· ip rip authentication mode
· ip rip authentication key-chain
· ip rip authentication string
key-string命令用来配置key的认证密文。
no key-string命令用来删除配置key认证的密文。
【命令】
key-string string
no key-string [ string ]
【缺省情况】
缺省情况下,未配置key认证的密文。
【视图】
钥匙视图
【参数】
string:key的认证密文。
【使用指导】
明文认证时,被认证方发送key chian时,发送最低ID值的key,并且不携带ID;认证方接收到 key后,和自己key chain的全部key进行比较,只要有一个key匹配就通过对被认证方的认证。
密文认证时,被认证方发送key时,发送最低ID值的key,并且携带了ID,认证方接收到key后,首先在自己key chain中查找是否具有相同ID的key,如果有相同ID的key并且key相同就通过认 证,key值不同就不通过认证。如果没有相同ID的key,就查找该ID往后的最近ID的key;如果没有往后的ID,认证失败。
【举例】
# 添加认证钥匙链key1,钥匙链中添加秘钥10,key的认证密文是123456。
host# system-view
host(config)# key chain key1
host(config-keychain)# key 10
host(config-keychain-key)# key-string 123456
【相关命令】
· key chain
· key
· ip rip authentication mode
· ip rip authentication key-chain
· ip rip authentication string
network命令用来配置RIP发布网络。
no network命令用来删除RIP发布网络。
【命令】
network { ip-address | interface }
no network { ip-address | interface }
【缺省情况】
缺省情况下,未配置发布网络。
【视图】
RIP配置视图
【参数】
ip-address:要发布的网络号,格式为X.X.X.X/Z,所有匹配这个网段的网络,都将被发布。
interface:要发布网络的接口,配置后,接口上的IP网络将被发布出去。
【举例】
# 配置将设备所有接口网络发布出去。
host# system-view
host(config)# router rip
host(config-router)# network 0.0.0.0/0
【相关命令】
· display ip rip status
passive-interface命令用来配置接口的工作状态。
no passive-interface命令用来恢复接口的工作状态为缺省状态。
【命令】
passive-interface { interface | default }
【缺省情况】
缺省情况下,接口可以发送路由更新报文。
【视图】
RIP配置视图
【参数】
interface:要配置成被动状态的接口名称。
default:配置所有接口为被动状态。
【使用指导】
配置接口工作在被动模式,即接口只接收路由更新报文而不发送路由更新报文。
【举例】
# 配置ge0的工作模式为被动模式。
host# system-view
host(config)# router rip
host(config-router)# passive-interface ge0
【相关命令】
· display ip rip status
redistribute命令用来重发布其他路由协议的路由。
no ip route命令用来删除重发布其他路由协议的路由。
【命令】
redistribute { connected | static | ospf } [ metric metric ]
no redistribute { connected | static | ospf } [ metric metric ]
【缺省情况】
缺省情况下,未配置路由重发布。
【视图】
RIP配置视图
【参数】
connected:重发布直连路由。
static:重发布静态路由。
ospf:重发布OSPF路由。
metric:重发布路由的默认度量值。
metric:度量值,范围是1~16,缺省使用缺省度量。
【使用指导】
如果没有配置metric,则按照系统缺省度量重发布路由。
【举例】
#配置重发布直连路由。
host# system-view
host(config)# router rip
host(config-rip)# redistribute connected
【相关命令】
· display ip rip status
router rip命令用来开启RIP路由协议。
no router rip命令用来关闭RIP路由协议。
【命令】
router rip
no router rip
【缺省情况】
缺省情况下,未开启RIP路由协议。
【视图】
系统视图
【使用指导】
router rip配置后,会进入RIP配置视图。
【举例】
# 配置启用RIP路由协议。
host# system-view
host(config)# router rip
host(config-router)#
display ip rip命令显示RIP路由信息。
【命令】
display ip rip
【视图】
用户视图
【举例】
# 显示RIP路由信息。
host# display ip rip
Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP
Sub-codes:
(n) - normal, (s) - static, (d) - default, (r) - redistribute,
(i) - interface
Network Next Hop Metric From Tag Time
R(d) 0.0.0.0/0 0.0.0.0 1 self 0
C(i) 3.3.3.0/24 0.0.0.0 1 self 0
S(r) 5.0.0.0/24 0.0.0.0 1 self 0
R(n) 10.0.0.0/24 192.168.1.1 2 192.168.1.20 0 02:52
C(i) 192.168.1.0/24 0.0.0.0 1 self 0
表1-5 display ip rip命令显示信息描述表
字段 |
描述 |
|
Codes: |
路由条目类型 |
|
R |
来自RIP |
|
C |
来自直连路由 |
|
S |
来自静态路由 |
|
O |
来自OSPF |
|
B |
来自BGP |
|
Sub-codes: |
路由条目子类型 |
|
n |
普通条目 |
|
s |
静态条目 |
|
d |
默认路由条目 |
|
r |
重定向条目 |
|
i |
接口条目 |
|
Network |
目的网段 |
|
Next Hop |
下一跳 |
|
Metric |
路由度量 |
|
From |
条目来自 |
|
Tag |
条目标签 |
|
Time |
条目超时时间 |
display ip rip status命令用来显示RIP状态。
【命令】
display ip rip status
【视图】
用户视图
【举例】
# 显示RIP状态。
host# display ip rip status
Routing Protocol is "rip"
Sending updates every 30 seconds with +/-50%, next due in 25 seconds
Timeout after 180 seconds, garbage collect after 120 seconds
Outgoing update filter list for all interface is not set
Incoming update filter list for all interface is not set
Default redistribution metric is 2
Redistributing: static
Default version control: send version 2, receive any version
Interface Send Recv Key-chain
ge0 1 2 1 2
lo 2 1 2
Routing for Networks:
0.0.0.0/0
ge0
Routing Information Sources:
Gateway BadPackets BadRoutes Distance Last Update
192.168.1.20 0 0 120 00:00:29
Distance: (default is 120)
表1-6 display ip rip status命令显示信息描述表
字段 |
描述 |
Routing Protocol is |
路由协议 |
Sending updates every |
RIP的更新定时器时间 |
next due in |
距下个更新的时间 |
Timeout after |
超时时间 |
garbage collect after |
垃圾回收时间 |
Default redistribution metric |
重发布的默认路由 |
Redistributing |
路由重发布配置 |
Default version control |
RIP全局报文版本控制 |
send version |
发送报文的RIP版本 |
receive |
接受报文的RIP版本 |
Interface |
配置了RIP的接口名称 |
Send |
接口发送报文的RIP版本 |
Recv |
接口接受报文的RIP版本 |
Key-chain |
接口认证的钥匙链 |
Routing for Networks |
配置的RIP发送网络 |
Routing Information Sources |
RIP邻居 |
Gateway |
邻居的IP地址 |
BadPackets |
错误报文 |
BadRoutes |
错误的路由条目 |
Distance |
邻居RIP的管理距离 |
Last Update |
收到上次更新距现在的时间 |
Distance |
RIP管理距离 |
timers命令用来配置RIP定时器。
no timers命令用来恢复RIP定时器的默认值。
【命令】
timers basic update-timer timeout-timer garbag-collection-timer
no timers basic [update-timer timeout-timer garbag-collection-timer ]
【缺省情况】
缺省情况下,定时更新时间缺省为30秒,超时时间缺省为180秒,垃圾收集时间缺省为120秒。
【视图】
RIP配置视图
【参数】
update-timer:更新时间,范围是5~2147483647,单位是秒,缺省是30。
timeout-timer:超时时间,范围是5~2147483647,单位是秒,缺省是180。
garbag-collection-timer:垃圾回收时间,范围是5~2147483647,单位是秒,缺省是120。
【使用指导】
更新时间:每次定时器超时,启用了RIP的接口会发送应答信息。
超时时间:如果定时器超时后,还未收到可刷新现有路由的更新,则将该路由的度量设置为 16,从而将其标记为无效路由。在清除计时器超时以前,该路由仍将保留在路由表中。
垃圾回收时间:当定时器超时后,标记为无效的路由将被删除。
【举例】
# 配置RIP更新时间设为5秒,超时时间设为10秒,垃圾回收时间是30秒。
host# system-view
host(config)# router rip
host(config-router)# timers basic 5 10 30
【相关命令】
· display ip rip status
version命令用来配置RIP协议版本号。
no version命令用来恢复缺省的RIP协议版本号。
【命令】
version { 1 | 2 }
no version
【缺省情况】
缺省情况下,RIP协议是版本2。
【视图】
RIP配置视图
【参数】
1:配置RIP协议版本号为1。
2:配置RIP协议版本号为2。
【使用指导】
用户可以在RIP视图下配置RIP版本,也可在接口上配置RIP版本:
· 当全局和接口都没有进行RIP版本配置时,接口发送RIP-1广播报文,可以接收RIP-1广播、单播报文、RIP-2广播/组播/单播报文。
· 如果接口没有进行RIP版本配置,接口运行的RIP版本将以全局配置的版本为准,如果希望接口配置的RIP版本与全局配置的不一样,则进入接口视图配置接口运行的RIP版本。
· 当接口运行的RIP版本为RIP-1时,发送RIP-1广播报文,可以接收RIP-1广播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在组播方式时,发送RIP-2组播报文,可以接收RIP-2广播/组播/单播报文。
· 当接口运行的RIP版本为RIP-2且工作在广播方式时,发送RIP-2广播报文,可以接收RIP-1广播/单播报文、RIP-2广播/组播/单播报文。
【举例】
# 配置RIP的版本为2。
host# system-view
host(config)# router rip
host(config-router)# version 2
【相关命令】
· display ip rip status
area { ip-address | router-id } authentication命令用来配置OSPF区域认证方式。
no area { ip-address | router-id } authentication命令用来删除OSPF区域认证方式。
【命令】
area { ip-address | router-id } authentication [ message-digest ]
no area { ip-address | router-id } authentication
【缺省情况】
缺省情况下,OSPF区域不进行认证。
【视图】
OSPF配置视图
【参数】
ip-address:OSPF所属的区域ID,为点分十进制形式。
router-id:OSPF所属的区域ID,为十进制数字形式。取值范围为0~4294967295。
message-digest:OSPF区域认证采用密文认证的方式。
【使用指导】
执行no area { ip-address | router-id } authentication命令后,将恢复为默认的不认证方式。
OSPF支持在同一区域内进行认证。一个区域中所有的路由器的认证类型必须一致(不认证、明文认证、MD5密文认证)。认证提供基于密码的保护,防止未经授权对区域进行的访问。在配置区域认证时,必须对区域的所有接口单独配置认证密码。当接口的认证方式和接口所在区域的认证不一致时,优先考虑接口配置的认证方式。
【举例】
# 配置OSPF区域认证。
host# system-view
host(config)#router ospf
host(config-router)# area 0 authentication
【相关命令】
· display running-config ospf
area { ip-address | router-id } range ip-address1/prefix1 [ not-advertise ]命令用来配置OSPF区域间路由聚合,并且不宣告聚合后的路由。
area { ip-address | router-id } range ip-address1/prefix1 advertise cost metric命令用来配置OSPF 区域间路由聚合,并配置聚合路由的宣告metric。
area { ip-address | router-id } range ip-address1/prefix1 substitute ip-address2/prefix2命令用来配置OSPF区域间路由聚合,并且将地址范围转换成地址宣告。
no area { ip-address | router-id } range ip-address1/prefix1 advertise cost命令用来取消路由聚合宣告的cost。
【命令】
area { ip-address | router-id } range ip-address1/prefix1 [ not-advertise ]
area { ip-address | router-id } range ip-address1/prefix1 advertise cost metric
area { ip-address | router-id } range ip-address1/prefix1 substitute ip-address2/prefix2
no area { ip-address | router-id } range ip-address1/prefix1 advertise cost
【视图】
OSPF配置视图
【参数】
ip-address:进行聚合的区域ID,为点分十进制形式。
router-id:进行聚合的区域ID,为数字形式,取值范围为0~4294967295。
ip-address1/prefix1:地址范围。
metric:聚合路由的宣告metric。
ip-address2/prefix2:将地址范围转换成该地址宣告。
not-advertise:不宣告聚合后的路由。
【使用指导】
区域间的路由聚合是为了减少区域间路由数量,它使ABR通告一条聚合的域间路由到其他区域,而被聚合的路由不被宣告出去。在OSPF中,ABR向其他区域发送路由信息时,以网段为单位生成Type 3 LSA。如果该区域中存在一些连续的网段,则可以配置ABR将这些连续的网段聚合成一个网段。这样ABR只发送一条聚合后的LSA,所有落入本命令指定的聚合网段范围的LSA将不再会被单独发送出去,这样可减少其他区域中链路状态数据库(LSDB)的规模。如果该网段范围用关键字not-advertise限定,则到这一个网段路由的聚合路由将不会被广播出去。这个网段是由IP地址/掩码的方式说明的。接收聚合网段和对网段的限定,可减少区域间路由信息的交流量。
【举例】
# 配置OSPF区域间路由聚合。
host# system-view
host(config)# router ospf
host(config-router)# area 0 range 1.1.1.1/24 not-advertise
【相关命令】
· display running-config ospf
distance命令用来配置OSPF协议优先级。
distance ospf intra-area命令用来配置OSPF协议的域内、域间、AS外部路由的优先级。
no distance命令用来删除OSPF协议优先级。
【命令】
distance distance
distance ospf intra-area intra-area inter-area inter-area external external
no distance
【缺省情况】
缺省情况下,默认值为110。
【视图】
OSPF配置视图
【参数】
distance:OSPF的管理距离(协议优先级)。取值范围为1~255。
intra-area:域内路由的OSPF优先级。取值范围为1~255。
inter-area:域间路由的OSPF优先级。取值范围为1~255。
external:AS外部路由的OSPF优先级。取值范围为1~255。
【使用指导】
使用no distance取消配置,使其恢复到默认值110。
一个协议的优先级指的是一个路由信息来源的可信度等级。优先级是一个1~255的整数,通常情况下,值越高可信度越低。值为255就意味着路由信息源根本不可信,应该被忽略。
【举例】
# 配置优先级为100。
host# system-view
host(config)# router ospf
host(config-router)# distance 100
【相关命令】
· display running-config ospf
default-metric命令用来配置OSPF重发布外部路由时的缺省metric。
no default-metric命令用来删除OSPF重发布外部路由时的缺省metric。
【命令】
default-metric metric
no default-metric
【视图】
OSPF配置视图
【参数】
metric:重发布路由的默认metric,取值范围为1~16777214。
【举例】
# 配置默认metric。
host# system-view
host(config)# router ospf
host(config-ospf)# default-metric 20
【相关命令】
· display running-config ospf
default-information originate metric命令用来配置OSPF重发布默认路由。
default-information originate always metric命令用来强制发布默认路由,即使路由表中没有默认路由。
no default-information originate用来删除默认路由。
【命令】
default-information originate metric metric metric-type { 1 | 2 }
default-information originate always metric metric metric-type { 1 | 2 }
no default-information originate
【缺省情况】
缺省情况下,重发布的路由为第二类外部路由,即metric-type默认为2。
【视图】
OSPF配置视图
【参数】
metric:重发布路由的metric。取值范围为1~16777214。
1:重发布路由的类型为第一类外部路由。
2:重发布路由的类型为第二类外部路由。
【使用指导】
一旦配置了路由重分布,路由器就自动成为自治系统边界路由器。但是缺省情况下,不会发布缺省路由,可以强制自治系统边界路由器发布缺省路由。但这时路由器表中必须包含缺省路由。如果路由表中没有缺省路由,而要强制自治系统边界路由器产生缺省路由,使用always参数。
【举例】
# 配置OSPF重发布默认路由。
host# system-view
host(config)# router ospf
host(config-router)# default-information originate metric 20 metric-type 2
【相关命令】
· display running-config ospf
ip ospf authentication命令用来配置OSPF接口的认证方式。
no ip ospf authentication命令用来删除OSPF接口的认证方式。
【命令】
ip ospf authentication [ message-digest ]
no ip ospf authentication
【缺省情况】
缺省情况下,不进行接口认证。
【视图】
接口视图
【参数】
message-digest:不用该参数表示明文认证,使用该参数表示密文认证。
【使用指导】
执行no ip ospf authentication命令后将恢复至不启用认证的方式。
【举例】
# 配置启用OSPF接口认证。
host# system-view
host(config)# interface ge4
host(config-ge4)#ip ospf authentication message-digest
【相关命令】
· display running-config interface
ip ospf authentication-key命令用来配置OSPF接口上用于明文认证的密钥。
no ip ospf authentication-key命令用来删除OSPF接口上用于明文认证的密钥。
【命令】
ip ospf authentication-key password
no ip ospf authentication-key
【视图】
接口视图
【参数】
password:用于明文认证的密钥。
【举例】
# 配置OSPF认证密钥。
host# system-view
host(config)# interface ge0
host(config-ge0)#ip ospf authentication-key aaa
【相关命令】
· display running-config interface
ip ospf cost命令用来配置OSPF接口发送报文的开销。
no ip ospf cost命令用来删除OSPF接口发送报文的开销。
【命令】
ip ospf cost cost
no ip ospf cost
【视图】
接口视图
【参数】
cost:OSPF接口发送报文的开销,取值范围为1~65535。
【举例】
# 配置OSPF接口发送报文的开销。
host# system-view
host(config)# interface ge4
host(config-ge4)# ip ospf cost 3
【相关命令】
· display running-config interface
ip ospf dead-interval命令用来配置OSPF接口邻居失效定时器。
no ip ospf dead-interval命令用来删除OSPF接口邻居失效定时器。
【命令】
ip ospf dead-interval interval
no ip ospf dead-interval
【缺省情况】
缺省情况下,默认值为40秒。
【视图】
接口视图
【参数】
interval:接口邻居失效定时器,取值范围为1~65535秒,默认值为40。
【使用指导】
使用no ip ospf dead-interval可以删除该配置,将恢复到默认值40秒。
Dead-interval的值至少是Hello-interval值的4倍。
同一网段的路由器的Dead-interval必须相同。
【举例】
# 配置接口邻居失效定时器。
host# system-view
host(config)# interface ge4
host(config-ge4)# ip ospf dead-interval 32
【相关命令】
· display running-config interface
ip ospf hello-interval命令用来配置OSPF接口Hello报文定时器。
no ip ospf hello-interval命令用来删除OSPF接口Hello报文定时器。
【命令】
ip ospf hello-interval interval
no ip ospf hello-interval
【缺省情况】
缺省情况下,发送间隔为10秒。
【视图】
接口视图
【参数】
interval:Hello报文发送间隔时间,取值范围为1~65535,默认为10秒。
【使用指导】
使用no ip ospf hello-interval可以删除该配置,将恢复到默认值10秒。
同一网段的路由其Hello-interval必须相同。
【举例】
# 配置Hello报文发送间隔。
host# system-view
host(config)# interface ge0
host(config-ge0)# ip ospf hello-interval 8
【相关命令】
· display running-config interface
ip ospf message-digest-key命令用来配置OSPF接口上用于密文认证的密钥。
no ip ospf message-digest-key命令用来删除OSPF接口上用于密文认证的密钥。
【命令】
ip ospf message-digest-key key-id md5 key
no ip ospf message-digest-key key-id
【视图】
接口视图
【参数】
key-id:key的ID号,取值范围为1~255。
key:key字符串,可以为字母、数字、字符。
【举例】
# 配置OSPF认证密钥。
host# system-view
host(config)# interface ge4
host(config-ge4)#ip ospf message-digest-key 1 md5 aaaa!@#$51234
【相关命令】
· display running-config interface
ip ospf network命令用来配置接口的OSPF网络类型。
no ip ospf network命令用来删除接口的OSPF网络类型。
【命令】
ip ospf network { broadcast | point-to-point }
no ip ospf network
【视图】
接口视图
【参数】
broadcast:设置接口OSPF网络类型为广播型网络。
point-to-point:设置接口OSPF网络类型为点对点型网络。
【举例】
# 配置接口OSPF网络类型。
host# system-view
host(config-router)# inter ge4
host(config-ge4)#ip ospf network broadcast
【相关命令】
· display running-config interface
ip ospf priority命令用来配置OSPF接口的优先级。
no ip ospf priority命令用来删除OSPF接口的优先级。
【命令】
ip ospf priority priority
no ip ospf priority
【视图】
接口视图
【参数】
priority:接口的优先级,取值范围为0~255。
【举例】
# 配置OSPF接口优先级。
host# system-view
host(config)# interface ge4
host(config-ge4)#ip ospf priority 10
【相关命令】
· display running-config interface
ip ospf retransmit-interval命令用来配置OSPF接口LSA重传间隔。
no ip ospf retransmit-interval命令用来删除OSPF接口LSA重传间隔。
【命令】
ip ospf retransmit-interval interval <3-65535>
no ip ospf retransmit-interval
【缺省情况】
缺省情况下,重传间隔为5秒。
【视图】
接口视图
【参数】
interval:LSA重传间隔时间,取值范围为3~65535秒。默认为5秒。
【使用指导】
使用no ip ospf retransmit-interval命令删除配置后,将恢复到默认值5秒。
【举例】
# 配置LSA重传间隔。
host# system-view
host(config)# interface ge4
host(config-ge4)# ip ospf retransmit-interval 3
【相关命令】
· display running-config interface
ip ospf transmit-delay命令用来配置OSPF接口LSA发送延迟。
no ip ospf transmit-delay命令用来删除OSPF接口LSA发送延迟。
【命令】
ip ospf transmit-delay delay<1-65535>
no ip ospf transmit-delay
【缺省情况】
缺省情况下,默认值为1秒。
【视图】
接口视图
【参数】
delay:LSA发送延迟,取值范围为1~65535,默认值为1秒。
【使用指导】
使用no ip ospf transmit-delay命令可以删除该配置,将恢复到默认值1秒。
【举例】
# 配置LSA发送延迟。
host# system-view
host(config)# interface ge0
host(config-ge0)# ip ospf transmit-delay 2
【相关命令】
· display running-config interface
network命令用来配置OSPF的接口及其所属的区域。
no network命令用来删除OSPF的接口及其所属的区域。
【命令】
network ip-address/prefix area { ip-address | router-id }
no network ip-address/prefix area { ip-address | router-id }
【视图】
OSPF配置视图
【参数】
ip-address/prefix:OSPF接口所属的网段。
ip-address:OSPF所属的区域ID,为点分十进制形式。
router-id:OSPF所属的区域ID,数字形式,取值范围为0~4294967295。
【使用指导】
声明网段后,在从属于ip-address/prefix网段的接口上启用OSPF。
【举例】
# 配置OSPF接口及所属区域。
host# system-view
host(config)# router ospf
host(config-router)# network 10.0.1.0/24 area 0
【相关命令】
· display running-config ospf
redistribute命令用来配置OSPF路由重发布。
no redistribute命令用来删除OSPF路由重发布。
【命令】
redistribute { connected | static | rip } metric metric metric-type { 1 | 2 }
no redistribute { connected | static | rip }
【缺省情况】
缺省情况下,重发布的路由为第二类外部路由,即metric-type默认为2。
【视图】
OSPF配置视图
【参数】
connected:重发布路由类型为直连路由。
static:重发布路由类型为静态路由。
rip:重发布路由类型为rip路由。
metric:重发布路由的metric,取值范围为1~16777214。
1:重发布路由的类型为第一类外部路由。
2:重发布路由的类型为第二类外部路由。
【举例】
# 配置OSPF路由重发布。
host# system-view
host(config)# router ospf
host(config-router)# redistribute connected metric 1 metric-type 2
【相关命令】
· display running-config ospf
router-id命令用来配置OSPF路由器的Router-ID。
no router-id命令用来删除OSPF路由器的Router-ID。
【命令】
router-id ip-address
no router-id
【缺省情况】
缺省情况下,路由器先挑选IP地址最大的环回地址。若无环回地址,则选择状态up的接口地址大的作为本路由器的Router-ID。
【视图】
OSPF配置视图
【参数】
ip-address:OSPF的Router-ID,为点分十进制形式。
【使用指导】
no router-id可以删除Router-ID的设置,Router-ID将会重新自动选举,重启后生效。
OSPF协议需要路由器的Router-ID,作为本路由器在自治系统中的唯一标识。一般在协议任务启动 后,会自动选出一个Router-ID。通常路由器先挑选IP地址最大的环回地址。若无环回地址,则选择状态up的接口地址大的作为本路由器的Router-ID。也可以指定一个Router-ID。
【举例】
# 配置Router-ID。
host# system-view
host(config)# router ospf
host(config-router)# router-id 1.1.1.1
【相关命令】
· display running-config ospf
router ospf命令用来启用OSPF路由协议。
no router ospf命令用来关闭OSPF路由协议。
【命令】
router ospf
no router ospf
【缺省情况】
默认情况下,未启用OSPF路由协议。
【视图】
系统视图
【使用指导】
启用OSPF后,才可对OSPF作进一步的配置。
【举例】
# 启用OSPF。
host# system-view
host(config)# router ospf
【相关命令】
· display running-config ospf
display ip ospf命令用来查看OSPF信息及邻居信息。
【命令】
display ip ospf
【视图】
用户视图
【举例】
# 查看OSPF信息及邻居信息。
host# display ip ospf
OSPF Routing Process, Router ID: 1.1.1.1
Supports only single TOS (TOS0) routes
This implementation conforms to RFC2328
RFC1583Compatibility flag is disabled
OpaqueCapability flag is disabled
Initial SPF scheduling delay 20 millisec(s)
Minimum hold time between consecutive SPFs 100 millisec(s)
Maximum hold time between consecutive SPFs 30 millisec(s)
Hold time multiplier is currently 1
SPF algorithm last executed 4h09m59s ago
SPF timer is inactive
Refresh timer 10 secs
This router is an ASBR (injecting external routing information)
Number of external LSA 3. Checksum Sum 0x0001af66
Number of opaque AS LSA 0. Checksum Sum 0x00000000
Number of areas attached to this router: 1
Reference bandwidth unit is 100 mbps
Area ID: 0.0.0.0 (Backbone)
Number of interfaces in this area: Total: 0, Active: 0
Number of fully adjacent neighbors in this area: 0
Area has no authentication
SPF algorithm executed 1 times
Number of LSA 1
Number of router LSA 1. Checksum Sum 0x00002928
Number of network LSA 0. Checksum Sum 0x00000000
Number of summary LSA 0. Checksum Sum 0x00000000
Number of ASBR summary LSA 0. Checksum Sum 0x00000000
Number of NSSA LSA 0. Checksum Sum 0x00000000
Number of opaque link LSA 0. Checksum Sum 0x00000000
Number of opaque area LSA 0. Checksum Sum 0x00000000
display ip ospf database命令用来查看OSPF LSA数据库。
【命令】
display ip ospf database
【视图】
用户视图
【举例】
# 查看LSA数据库。
host# display ip ospf database
OSPF Router with ID (1.1.1.1)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
1.1.1.1 1.1.1.1 1279 0x80000009 0x2928 0
AS External Link States
Link ID ADV Router Age Seq# CkSum Route
0.0.0.0 1.1.1.1 1009 0x80000008 0x7f34 E2 0.0.0.0/0 [0x0]
172.16.0.0 1.1.1.1 1109 0x80000009 0x39cf E2 172.16.0.0/16 [0x0]
192.168.2.0 1.1.1.1 669 0x80000009 0xf663 E2 192.168.2.0/24 [0x0]
表1-7 LSA数据库显示信息描述表
字段 |
描述 |
Link ID |
LSA的Link state ID |
ADV Router |
发送LSA路由器的Route-ID |
Age |
LSA的老化时间 |
Seg |
LSA的序列号 |
CkSum |
LSA的校验和 |
Link count |
LSA的连接数 |
Route |
路由类型及外部路由的目的网段 |
display ip ospf interface命令用来查看OSPF接口信息。
【命令】
display ip ospf interface if-name
【视图】
用户视图
【参数】
if-name:接口名称。
【举例】
# 查看接口ge0的OSPF信息。
host# display ip ospf interface ge0
ge0 is up, line protocol is up
Internet Address 100.0.1.2/24,Area 0.0.0.0
Router ID 200.0.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 200.0.0.1,Interface Address 100.0.1.2
Backup Designated Router (ID) 200.0.0.2,Interface Address 100.0.1.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
表1-8 display ip ospf interface显示信息描述表
字段 |
描述 |
Internet Address |
接口地址 |
Area |
所属区域 |
Router ID |
router id |
Network Type |
网络类型 |
Cost |
开销值 |
Transmit Delay |
传输延时时间 |
State |
DR状态 |
Priority |
DR选举优先级 |
Designated Router |
DR的ID和地址 |
Backup Designated Router |
BDR的ID和版本 |
Timer intervals configured |
OSPF定时器配置 |
Hello due |
上个Hello距现在的时间 |
timers spf命令用来配置OSPF接收拓扑结构改变之后和启动最短路径优先(OSPF)之间的延迟时间和配置连续两次SPF计算之间的时间。
no timers spf命令用来删除OSPF路由计算定时器的配置。
【命令】
timers throttle spf spf-delay spf-holdtime max-holdtime
no timers throttle spf
【缺省情况】
缺省情况下,默认值spf-delay为5秒,spf-holdtime为10秒。
【视图】
OSPF配置视图
【参数】
spf-delay:spf延时时间,取值范围为0~600000秒,默认值为5秒。
spf-holdtime:spf连续两次计算间隔时间,取值范围为0~600000秒,默认值为10秒。
max-holdtime:最大间隔时间,取值范围为0~600000秒。
【使用指导】
使用no timers spf可以取消该配置,使其恢复到默认值spf-delay为5秒,spf-holdtime为10秒。
【举例】
# 配置spf算法定时器。
host# system-view
host(config)# router ospf
host(config-router)# timers throttle spf 20 10 30
【相关命令】
· display running-config ospf
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!