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::2PING 2001::2 : 56 data bytes, press CTRL_C to breakReply from 2001::2 bytes=56 Sequence=1 hop limit=255 time = 60 msReply from 2001::2 bytes=56 Sequence=2 hop limit=255 time = 50 msReply from 2001::2 bytes=56 Sequence=3 hop limit=255 time = 20 msReply from 2001::2 bytes=56 Sequence=4 hop limit=255 time = 50 msReply from 2001::2 bytes=56 Sequence=5 hop limit=255 time = 40 ms--- 2001::2 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-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:2647Global unicast address(es):12::2, subnet is 12::/64Joined group address(es):FF02::1:FF00:2FF02::2FF02::1FF02::1:FF0A:2647MTU is 1500 bytesND DAD is enabled, number of DAD attempts: 1ND reachable time is 30000 millisecondsND retransmit interval is 1000 millisecondsHosts 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:2648Global unicast address(es):2002::1, subnet is 2002::/64Joined group address(es):FF02::1:FF00:1FF02::2FF02::1FF02::1:FF0A:2648MTU is 1500 bytesND DAD is enabled, number of DAD attempts: 1ND reachable time is 30000 millisecondsND retransmit interval is 1000 millisecondsHosts use stateless autoconfig for addresses[R2]ipv6 route-static 2001:: 64 12::1 # 配置ipv6静态路由
<R2>display ipv6 routing-table
Routing Table : PublicDestinations : 7 Routes : 7Destination : ::1 PrefixLength : 128NextHop : ::1 Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : InLoopBack0 Flags : DDestination : 12:: PrefixLength : 64NextHop : 12::2 Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : GigabitEthernet0/0/0 Flags : DDestination : 12::2 PrefixLength : 128NextHop : ::1 Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : GigabitEthernet0/0/0 Flags : DDestination : 2001:: PrefixLength : 64NextHop : 12::1 Preference : 60Cost : 0 Protocol : StaticRelayNextHop : :: TunnelID : 0x0Interface : GigabitEthernet0/0/0 Flags : RDDestination : 2002:: PrefixLength : 64NextHop : 2002::1 Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : GigabitEthernet0/0/1 Flags : DDestination : 2002::1 PrefixLength : 128NextHop : ::1 Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : GigabitEthernet0/0/1 Flags : DDestination : FE80:: PrefixLength : 10NextHop : :: Preference : 0Cost : 0 Protocol : DirectRelayNextHop : :: TunnelID : 0x0Interface : NULL0 Flags : D