Example: Configuring basic IPv6 settings

Network configuration

As shown in Figure 63, a host, Switch A, and Switch B are connected through Ethernet ports. Add the Ethernet ports to corresponding VLANs. Configure IPv6 addresses for the VLAN interfaces and verify that they are connected. Switch B can reach the host.

Enable IPv6 on the host to automatically obtain an IPv6 address through IPv6 ND.

Figure 63: Network diagram

Procedure


[IMPORTANT: ]

IMPORTANT:

By default, interfaces on the device are disabled (in ADM or Administratively Down state). To have an interface operate, you must use the undo shutdown command to enable that interface.


This example assumes that the VLAN interfaces have been created on the switches.

  1. Configure Switch A:

    # Specify a global unicast address for VLAN-interface 2.

    <SwitchA> system-view
    [SwitchA] interface vlan-interface 2
    [SwitchA-Vlan-interface2] ipv6 address 3001::1/64
    [SwitchA-Vlan-interface2] quit
    

    # Specify a global unicast address for VLAN-interface 1, and allow it to advertise RA messages (no interface advertises RA messages by default).

    [SwitchA] interface vlan-interface 1
    [SwitchA-Vlan-interface1] ipv6 address 2001::1/64
    [SwitchA-Vlan-interface1] undo ipv6 nd ra halt
    [SwitchA-Vlan-interface1] quit
    
  2. Configure Switch B:

    # Configure a global unicast address for VLAN-interface 2.

    <SwitchB> system-view
    [SwitchB] interface vlan-interface 2
    [SwitchB-Vlan-interface2] ipv6 address 3001::2/64
    [SwitchB-Vlan-interface2] quit
    

    # Configure an IPv6 static route with destination IPv6 address 2001::/64 and next hop address 3001::1.

    [SwitchB] ipv6 route-static 2001:: 64 3001::1
    
  3. Configure the host:

    Enable IPv6 for the host to automatically obtain an IPv6 address through IPv6 ND.

    # Display neighbor information for Ten-GigabitEthernet 1/0/2 on Switch A.

    [SwitchA] display ipv6 neighbors interface ten-gigabitethernet 1/0/2
    Type: S-Static    D-Dynamic    O-Openflow     R-Rule    I-Invalid
    IPv6 address                  Link Layer      VID  Interface/Link ID      State T Age
    FE80::215:E9FF:FEA6:7D14      0015-e9a6-7d14  1    XGE1/0/2       STALE D 1238
    2001::15B:E0EA:3524:E791      0015-e9a6-7d14  1    XGE1/0/2       STALE D 1248
    

    The output shows that the IPv6 global unicast address that Host obtained is 2001::15B:E0EA:3524:E791.

Verifying the configuration

# Display the IPv6 interface settings on Switch A. All IPv6 global unicast addresses configured on the interface are displayed.

[SwitchA] display ipv6 interface vlan-interface 2
Vlan-interface2 current state: UP
Line protocol current state: UP
IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:2
  Global unicast address(es):
    3001::1, subnet is 3001::/64
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FF00:1
    FF02::1:FF00:2
  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
IPv6 Packet statistics:
  InReceives:                    25829
  InTooShorts:                   0
  InTruncatedPkts:               0
  InHopLimitExceeds:             0
  InBadHeaders:                  0
  InBadOptions:                  0
  ReasmReqds:                    0
  ReasmOKs:                      0
  InFragDrops:                   0
  InFragTimeouts:                0
  OutFragFails:                  0
  InUnknownProtos:               0
  InDelivers:                    47
  OutRequests:                   89
  OutForwDatagrams:              48
  InNoRoutes:                    0
  InTooBigErrors:                0
  OutFragOKs:                    0
  OutFragCreates:                0
  InMcastPkts:                   6
  InMcastNotMembers:             25747
  OutMcastPkts:                  48
  InAddrErrors:                  0
  InDiscards:                    0
  OutDiscards:                   0
[SwitchA] display ipv6 interface vlan-interface 1
Vlan-interface1 current state: UP
Line protocol current state: UP
IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1C0
  Global unicast address(es):
    2001::1, subnet is 2001::/64
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FF00:1
    FF02::1:FF00:1C0
  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
  ND advertised reachable time is 0 milliseconds
  ND advertised retransmit interval is 0 milliseconds
  ND router advertisements are sent every 600 seconds
  ND router advertisements live for 1800 seconds
  Hosts use stateless autoconfig for addresses
IPv6 Packet statistics:
  InReceives:                    272
  InTooShorts:                   0
  InTruncatedPkts:               0
  InHopLimitExceeds:             0
  InBadHeaders:                  0
  InBadOptions:                  0
  ReasmReqds:                    0
  ReasmOKs:                      0
  InFragDrops:                   0
  InFragTimeouts:                0
  OutFragFails:                  0
  InUnknownProtos:               0
  InDelivers:                    159
  OutRequests:                   1012
  OutForwDatagrams:              35
  InNoRoutes:                    0
  InTooBigErrors:                0
  OutFragOKs:                    0
  OutFragCreates:                0
  InMcastPkts:                   79
  InMcastNotMembers:             65
  OutMcastPkts:                  938
  InAddrErrors:                  0
  InDiscards:                    0
  OutDiscards:                   0

# Display the IPv6 interface settings on Switch B. All IPv6 global unicast addresses configured on the interface are displayed.

[SwitchB] display ipv6 interface vlan-interface 2
Vlan-interface2 current state :UP
Line protocol current state :UP
IPv6 is enabled, link-local address is FE80::20F:E2FF:FE00:1234
  Global unicast address(es):
    3001::2, subnet is 3001::/64
  Joined group address(es):
    FF02::1
    FF02::2
    FF02::1:FF00:2
    FF02::1:FF00:1234
  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
IPv6 Packet statistics:
  InReceives:                    117
  InTooShorts:                   0
  InTruncatedPkts:               0
  InHopLimitExceeds:             0
  InBadHeaders:                  0
  InBadOptions:                  0
  ReasmReqds:                    0
  ReasmOKs:                      0
  InFragDrops:                   0
  InFragTimeouts:                0
  OutFragFails:                  0
  InUnknownProtos:               0
  InDelivers:                    117
  OutRequests:                   83
  OutForwDatagrams:              0
  InNoRoutes:                    0
  InTooBigErrors:                0
  OutFragOKs:                    0
  OutFragCreates:                0
  InMcastPkts:                   28
  InMcastNotMembers:             0
  OutMcastPkts:                  7
  InAddrErrors:                  0
  InDiscards:                    0
  OutDiscards:                   0

# Ping Switch A and Switch B on the host, and ping Switch A and the host on Switch B to verify that they are connected.


[NOTE: ]

NOTE:

When you ping a link-local address, use the -i parameter to specify an interface for the link-local address.


[SwitchB] ping ipv6 -c 1 3001::1
Ping6(56 data bytes) 3001::2 --> 3001::1, press CTRL_C to break
56 bytes from 3001::1, icmp_seq=0 hlim=64 time=4.404 ms

--- Ping6 statistics for 3001::1 ---
1 packet(s) transmitted, 1 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 4.404/4.404/4.404/0.000 ms
[SwitchB] ping ipv6 -c 1 2001::15B:E0EA:3524:E791
Ping6(56 data bytes) 3001::2 --> 2001::15B:E0EA:3524:E791, press CTRL_C to break
56 bytes from 2001::15B:E0EA:3524:E791, icmp_seq=0 hlim=64 time=5.404 ms

--- Ping6 statistics for 2001::15B:E0EA:3524:E791 ---
1 packet(s) transmitted, 1 packet(s) received, 0.0% packet loss
round-trip min/avg/max/std-dev = 5.404/5.404/5.404/0.000 ms

The output shows that Switch B can ping Switch A and the host. The host can also ping Switch B and Switch A.