天天看点

ipv6 静态路由配置ipv6 静态路由配置

ipv6 静态路由配置

ipv6 静态路由配置ipv6 静态路由配置

R1 配置

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]ipv6    # 全局使能 ipv6
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ipv6 enable 
[R1-GigabitEthernet0/0/0]ipv6 address 2001::1 64
[R1-GigabitEthernet0/0/0]ping ipv6 2001::2
  PING 2001::2 : 56  data bytes, press CTRL_C to break
    Reply from 2001::2 
    bytes=56 Sequence=1 hop limit=255  time = 60 ms
    Reply from 2001::2 
    bytes=56 Sequence=2 hop limit=255  time = 50 ms
    Reply from 2001::2 
    bytes=56 Sequence=3 hop limit=255  time = 20 ms
    Reply from 2001::2 
    bytes=56 Sequence=4 hop limit=255  time = 50 ms
    Reply from 2001::2 
    bytes=56 Sequence=5 hop limit=255  time = 40 ms

  --- 2001::2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/44/60 ms

[R1-GigabitEthernet0/0/0]
[R1]ipv6 route-static 2002:: 64 12::2  # 配置ipv6静态路由
           

查询配置

<R2>display ipv6 routing-table   # 查询ipv6 路由表
<R2>display ipv6 interface GigabitEthernet 0/0/1 #查询接口信息的ipv6配置

           
#ipv6 中以FE80:: 开头的地址都属于本地链路地址(link-local),
#只在本地链路有效。启用了ipv6功能的接口都会自动生成相应link- local地址。
<R2>display ipv6 interface GigabitEthernet 0/0/0
GigabitEthernet0/0/0 current state : UP 
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::5689:98FF:FE0A:2647
  Global unicast address(es):
    12::2, subnet is 12::/64
  Joined group address(es):
    FF02::1:FF00:2
    FF02::2
    FF02::1
    FF02::1:FF0A:2647
  MTU is 1500 bytes
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds
  ND retransmit interval is 1000 milliseconds
  Hosts use stateless autoconfig for addresses
<R2>display ipv6 interface GigabitEthernet 0/0/1
GigabitEthernet0/0/1 current state : UP 
IPv6 protocol current state : UP
IPv6 is enabled, link-local address is FE80::5689:98FF:FE0A:2648
  Global unicast address(es):
    2002::1, subnet is 2002::/64
  Joined group address(es):
    FF02::1:FF00:1
    FF02::2
    FF02::1
    FF02::1:FF0A:2648
  MTU is 1500 bytes
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds
  ND retransmit interval is 1000 milliseconds
  Hosts use stateless autoconfig for addresses



[R2]ipv6 route-static 2001:: 64 12::1  # 配置ipv6静态路由
<R2>display ipv6 routing-table 
Routing Table : Public
	Destinations : 7	Routes : 7

 Destination  : ::1                             PrefixLength : 128
 NextHop      : ::1                             Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : InLoopBack0                     Flags        : D

 Destination  : 12::                            PrefixLength : 64
 NextHop      : 12::2                           Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : GigabitEthernet0/0/0            Flags        : D

 Destination  : 12::2                           PrefixLength : 128
 NextHop      : ::1                             Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : GigabitEthernet0/0/0            Flags        : D

 Destination  : 2001::                          PrefixLength : 64
 NextHop      : 12::1                           Preference   : 60
 Cost         : 0                               Protocol     : Static
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : GigabitEthernet0/0/0            Flags        : RD

 Destination  : 2002::                          PrefixLength : 64
 NextHop      : 2002::1                         Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : GigabitEthernet0/0/1            Flags        : D

 Destination  : 2002::1                         PrefixLength : 128
 NextHop      : ::1                             Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : GigabitEthernet0/0/1            Flags        : D

 Destination  : FE80::                          PrefixLength : 10
 NextHop      : ::                              Preference   : 0
 Cost         : 0                               Protocol     : Direct
 RelayNextHop : ::                              TunnelID     : 0x0
 Interface    : NULL0                           Flags        : D