H3C路由器命令集
- 格式:pdf
- 大小:260.97 KB
- 文档页数:34
12-IPV4路由命令
目录
第1章静态路由配置命令
1.1静态路由配置命令
1.1.1deletestatic-routesall1.1.2iproute-static
1.1.3iproute-staticdefault-preference
第2章RIP配置命令
2.1RIP配置命令
2.1.1checkzero2.1.2defaultcost
2.1.3default-routeoriginate
2.1.4displayrip
2.1.5displayripdatabase
2.1.6displayripinterface2.1.7displayriproute
2.1.8filter-policyexport
2.1.9filter-policyimport
2.1.10host-route
2.1.11import-route2.1.12network
2.1.13peer
2.1.14preference
2.1.15resetripstatistics
2.1.16rip2.1.17ripauthentication-mode
2.1.18ripinput
2.1.19ripmetricin
2.1.20ripmetricout
2.1.21ripoutput2.1.22rippoison-reverse
2.1.23ripsplit-horizon
2.1.24ripsummary-address
2.1.25ripversion
2.1.26silent-interface2.1.27summary
2.1.28timers
2.1.29validate-source-address
2.1.30version
第3章IP路由策略配置命令3.1IP路由策略配置命令
3.1.1applycost
3.1.2applyip-addressnext-hop
3.1.3applypreference3.1.4applytag
3.1.5displayipip-prefix
3.1.6displayroute-policy
3.1.7if-matchacl
3.1.8if-matchcost3.1.9if-matchinterface
3.1.10if-matchip
3.1.11if-matchip-prefix
3.1.12if-matchtag
3.1.13ipip-prefix3.1.14route-policy
3.1.15resetipip-prefix第1章静态路由配置命令
&说明:
本章所指的路由器代表了一般意义下的路由器,以及运行了路由协议的三层交换机。为
提高可读性,在手册的描述中将不另行说明。
1.1静态路由配置命令
1.1.1deletestatic-routesall
【命令】
deletestatic-routesall
【视图】系统视图
【参数】
无
【描述】
deletestatic-routesall命令用来删除所有静态路由。使用本命令删除静态路由时,系统会提示确认,确认后才会删除所配置的全部静态路由。
相关配置可参考命令iproute-static和displayiprouting-table。
【举例】
#删除所有静态路由。
system-view[Sysname]deletestatic-routesall
Thiswilleraseallipv4staticroutesandtheirconfigurations,youmustreconfigureallstatic
routes
Areyousure?[Y/N]:y
1.1.2iproute-static【命令】
iproute-staticip-address{mask|mask-length}{[Vlan-interfacevlan-id]nexthop-address
|NULLinterface-number}[preferencepreference][tagtag-value][descriptiondescription-text
]undoiproute-staticip-address{mask|mask-length}{[Vlan-interfacevlan-id]nexthop-address|NULLinterface-number}[preferencepreference]
【视图】
系统视图
【参数】ip-address:目的IP地址,点分十进制格式。mask:IP地址的掩码,点分十进制格式。mask-length:掩码长度,取值范围为0~32。
Vlan-interfacevlan-id:指定路由的输出Vlan接口的接口编号。nexthop-address:指定路由的下一跳的IP地址,点分十进制格式。
NULLinterface-number:下一跳地址为空。preferencepreference:指定静态路由协议的优先级,取值范围1~255。缺省值为60。
descriptiondescription-text:静态路由描述信息,为字符串形式,取值范围为1~60个
字符。除“?”外,可以包含空格等特殊字符。
tagtag-value:设置的静态路由Tag值,取值范围为1~4294967295。如果命令中没有配置该参数,默认值为0。
【描述】iproute-static命令用来配置静态路由。undoiproute-static命令用来删除静态路由配
置。
配置静态路由时应注意以下几点:(1)如果目的IP地址和掩码都为0.0.0.0,配置的路由为缺省路由。如果检查路由表
失败,将使用缺省路由进行报文转发。
(2)配置静态路由时,可根据实际需要指定出接口或下一跳地址,下一跳地址不能
为本地接口IP地址,否则路由不会生效。指定出接口时需要注意:
l对于NULL0接口,配置了出接口就不再配置下一跳地址。l在配置静态路由时,建议不要直接指定广播类型接口作出接口(VLAN接口
等)。因为广播类型的接口,会导致出现多个下一跳,无法唯一确定下一跳。在某些特殊应
用中,如果必须指定广播接口(VLAN接口等),则必须同时指定其对应的下一跳地址。
相关配置可参考命令displayiprouting-table和iproute-staticroute-staticdefault-preferencedefault-preference。
【举例】#配置缺省路由,指定下一跳为129.102.0.2。
system-view
[Sysname]iproute-static0.0.0.00.0.0.0129.102.0.2
#配置静态路由的描述信息为“forinternet&intranet”。
system-view[Sysname]iproute-static3.3.3.3244.4.4.4descriptionforinternet&intranet
displaycurrent-configuration
……
#
iproute-static3.3.3.0255.255.255.04.4.4.4descriptionforinternet&intranet#
return
#配置静态路由Tag值为45,描述信息为test。
system-view
[Sysname]iproute-static1.1.1.1242.2.2.2tag45descriptiontest1.1.3iproute-staticroute-staticdefault-preferencedefault-preference
【命令】
iproute-staticdefault-preferencedefault-preference-value
undoiproute-staticdefault-preference
【视图】系统视图
【参数】default-preference-value:静态路由缺省优先级的值,取值范围为1~255。
【描述】
iproute-staticdefault-preference命令用来配置静态路由的缺省优先级。undoiproute-staticdefault-preference命令用来恢复该缺省优先级为缺省值。
缺省情况下,静态路由的缺省优先级为60。
需要注意的是:
l如果在配置静态路由时没有指定优先级,则使用缺省优先级。l重新设置缺省优先级后,新设置的缺省优先级仅对新增的静态路由有效。
相关配置可参考命令displayiprouting-table,iproute-static。
【举例】
#配置静态路由的缺省优先级为120。
system-view[Sysname]iproute-staticdefault-preference120第2章RIP配置命令
&说明:
本章所指的路由器代表了一般意义下的路由器,以及运行了路由协议的三层交换机。为
提高可读性,在手册的描述中将不另行说明。
2.1RIP配置命令
2.1.1checkzero
【命令】checkzero
undocheckzero【视图】
RIP视图
【参数】
无
【描述】checkzero命令用来开启对RIP-1报文的零域进行检查的功能。undocheckzero命令用
来关闭零域检查功能。
缺省情况下,对RIP-1报文的零域进行检查的功能处于开启状态。
开启零域检查功能后,零域中包含非零位的RIP-1报文将被拒绝处理。如果用户能确保
所有报文都是可信任的,则可以不进行该项检查,以节省CPU处理时间。【举例】
#关闭对RIP-1报文的零域检查功能。
system-view
[Sysname]rip100
[Sysname-rip-100]undocheckzero2.1.2defaultcost
【命令】
defaultcostvalue
undodefaultcost
【视图】RIP视图
【参数】value:引入路由的缺省度量值,取值范围为0~16。
【描述】
defaultcost命令用来配置引入路由的缺省度量值。undodefaultcost命令用来恢复缺省情况。
缺省情况下,引入路由的缺省度量值为0。
当使用import-route命令从其它协议引入路由时,如果不指定具体的路由度量值,则引
入路由的路由度量值为defaultcost所指定的值。
相关配置可参考命令import-route。【举例】
#设定从其它路由协议引入路由的缺省路由度量值为3。
system-view
[Sysanme]rip100