一、静态路由简介
静态路由是一种特殊的路由,由管理员手工配置。当网络结构比较简单时,只需配置静态路由就可以使网络正常工作。
静态路由不能自动适应网络拓扑结构的变化。当网络发生故障或者拓扑发生变化后,必须由网络管理员手工修改配置。
二、静态路由配置
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
(可选)创建静态路由配置组,并进入静态路由配置组视图 |
ip route-static-group group-name |
缺省情况下,未配置静态路由配置组 |
(可选)在静态路由配置组中增加前缀 |
prefix dest-address { mask-length | mask } |
缺省情况下,静态路由配置组中未配置前缀 |
(可选)退回系统视图 |
quit |
- |
配置静态路由 |
ip route-static { dest-address { mask-length | mask } | group group-name } { interface-type interface-number [ next-hop-address ] | next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] | vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] } [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ] |
二者选其一 缺省情况下,未配置静态路由 |
ip route-static vpn-instance s-vpn-instance-name { dest-address { mask-length | mask } | group group-name } { interface-type interface-number [ next-hop-address ] | next-hop-address [ recursive-lookup host-route ] [ public ] [ track track-entry-number ] | vpn-instance d-vpn-instance-name next-hop-address [ recursive-lookup host-route ] [ track track-entry-number ] } [ permanent ] [ preference preference ] [ tag tag-value ] [ description text ] |
||
(可选)配置静态路由向下一跳定时发送ARP request |
ip route-static arp-request interval interval |
缺省情况下,静态路由不发送ARP request |
(可选)配置静态路由的缺省优先级 |
ip route-static default-preference default-preference |
缺省情况下,静态路由的缺省优先级为60 |
(可选)删除所有静态路由 |
delete [ vpn-instance vpn-instance-name ] static-routes all |
- |
三、静态路由显示
操作 |
命令 |
查看静态路由表信息(本命令的详细情况请参见“三层技术-IP路由命令参考”中的“IP路由基础”) |
display ip routing-table protocol static [ inactive | verbose ] |
显示静态路由下一跳信息 |
display route-static nib [ nib-id ] [ verbose ] |
显示静态路由表信息 |
display route-static routing-table [ vpn-instance vpn-instance-name ] [ ip-address { mask-length | mask } ] |
来源:https://www.cnblogs.com/xiaoyao881102/p/12365098.html