• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

07-三层技术-IP路由配置指导

09-IPv6静态路由配置

本章节下载  (154.59 KB)

docurl=/cn/Service/Document_Software/Document_Center/Home/Routers/00-Public/Configure/Operation_Manual/H3C_MSR_V5_R2516-3283/07/202204/1585831_30005_0.htm

09-IPv6静态路由配置


1 IPv6静态路由

1.1  IPv6静态路由简介

静态路由是一种特殊的路由,由管理员手工配置。当网络结构比较简单时,只需配置静态路由就可以使网络正常工作。

静态路由不能自动适应网络拓扑结构的变化。当网络发生故障或者拓扑发生变化后,必须由网络管理员手工修改配置。

IPv6静态路由与IPv4静态路由类似,适合于一些结构比较简单的IPv6网络。

1.2  配置IPv6静态路由

1.2.1  配置准备

在配置IPv6静态路由之前,需完成以下任务:

·     配置相关接口的物理参数

·     配置相关接口的链路层属性

·     使能IPv6报文转发能力

·     相邻节点网络层(IPv6)可达

1.2.2  配置IPv6静态路由

表1-1 配置IPv6静态路由

操作

命令

说明

进入系统视图

system-view

-

配置IPv6静态路由

ipv6 route-static ipv6-address prefix-length { interface-type interface-number [ next-hop-address ] | next-hop-address | vpn-instance d-vpn-instance-name nexthop-address } [ preference preference-value ]

二者必选其一

缺省情况下,没有配置IPv6静态路由

ipv6 route-static vpn-instance s-vpn-instance-name&<1-6> ipv6-address prefix-length { interface-type interface-number [ next-hop-address ] | nexthop-address [ public ] | vpn-instance d-vpn-instance-name nexthop-address } [ preference preference-value ]

删除所有IPv6静态路由

delete ipv6 [ vpn-instance vpn-instance-name ] static-routes all

可选

 

使用undo ipv6 route-static命令可以删除一条IPv6静态路由,而使用delete ipv6 static-routes all命令可以删除包括缺省路由在内的所有IPv6静态路由。

 

1.3  IPv6静态路由显示和维护

在完成上述配置后,在任意视图下执行display命令查看IPv6静态路由配置的运行情况并检验配置结果。

表1-2 IPv6静态路由显示和维护

操作

命令

查看IPv6静态路由表信息

display ipv6 routing-table protocol static [ inactive | verbose ] [ | { begin | exclude | include } regular-expression ]

 

·     本命令的详细情况请参见“三层技术-IP路由命令参考”中的“IP路由基础”。

 

1.4  IPv6静态路由典型配置举例

1. 组网要求

要求各路由器之间配置IPv6静态路由协议后,可以使所有主机和路由器之间互通。

2. 组网图

图1-1 IPv6静态路由配置组网图

 

 

3. 配置步骤

(1)     配置各接口的IPv6地址(略)

(2)     配置IPv6静态路由

# 在Router A上使能IPv6报文转发功能,并配置IPv6缺省路由。

<RouterA> system-view

[RouterA] ipv6

[RouterA] ipv6 route-static :: 0 4::2

# 在Router B上使能IPv6报文转发功能,并配置两条IPv6静态路由。

<RouterB> system-view

[RouterB] ipv6

[RouterB] ipv6 route-static 1:: 64 4::1

[RouterB] ipv6 route-static 3:: 64 5::1

# 在Router C上使能IPv6报文转发功能,并配置IPv6缺省路由。

<RouterC> system-view

[RouterC] ipv6

[RouterC] ipv6 route-static :: 0 5::2

(3)     配置主机地址和网关

根据组网图配置好各主机的IPv6地址,并将Host A的缺省网关配置为1::1,Host B的缺省网关配置为2::1,Host C的缺省网关配置为3::1。

(4)     查看配置结果

# 查看Router A的IPv6路由表。

[RouterA] display ipv6 routing-table

Routing Table : Public

         Destinations : 5        Routes : 5

 

Destination  : ::                                   Protocol     : Static

NextHop      : 4::2                                 Preference   : 60

Interface    : S2/0                                 Cost         : 0

 

Destination  : ::1/128                              Protocol     : Direct

NextHop      : ::1                                  Preference   : 0

Interface    : InLoop0                              Cost         : 0

 

Destination  : 1::/64                               Protocol     : Direct

NextHop      : 1::1                                 Preference   : 0

Interface    : Eth1/1                               Cost         : 0

 

Destination  : 1::1/128                             Protocol     : Direct

NextHop      : ::1                                  Preference   : 0

Interface    : InLoop0                              Cost         : 0

 

Destination  : FE80::/10                            Protocol     : Direct

NextHop      : ::                                   Preference   : 0

Interface    : NULL0                                Cost         : 0

# 在Router A上使用ping命令验证Host C是否可达。

[RouterA] ping ipv6 3::2

  PING 3::2 : 56  data bytes, press CTRL_C to break

    Reply from 3::2

    bytes=56 Sequence=1 hop limit=62  time = 63 ms

    Reply from 3::2

    bytes=56 Sequence=2 hop limit=62  time = 62 ms

    Reply from 3::2

    bytes=56 Sequence=3 hop limit=62  time = 62 ms

    Reply from 3::2

    bytes=56 Sequence=4 hop limit=62  time = 63 ms

    Reply from 3::2

    bytes=56 Sequence=5 hop limit=62  time = 63 ms

  --- 3::2 ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 62/62/63 ms

2 IPv6缺省路由

2.1  IPv6缺省路由简介

IPv6缺省路由是在路由器没有找到匹配的IPv6路由表项时使用的路由。

IPv6缺省路由有两种生成方式:

·     第一种是网络管理员手工配置。配置请参见表1-1,指定的目的地址为::/0(前缀长度为0)。

·     第二种是动态路由协议生成(如OSPFv3、IPv6 IS-IS和RIPng),由路由能力比较强的路由器将IPv6缺省路由发布给其它路由器,其它路由器在自己的路由表里生成指向那台路由器的缺省路由。配置请参见各个路由协议手册。

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们