Configuring IPv6 Addresses

Information about IPV6 Addresses

The following topics provide information about IPv6 addresses.

Overview of IPv6 Address

IPv6 (Internet Protocol Version 6) is the second generation standard protocol of the network layer protocol, also referred to as IPng (IP Next Generation). It is a set of specifications designed by the Internet Engineering Task Force (IETF) and is an upgraded version of IPv4. The most significant difference between IPv6 and IPv4 is that the length of the IP address is increased from 32 bits to 128 bits.

An IPv6 address is represented as eight groups of four hexadecimal digits, each group representing 16 bits. The groups are seperated by colons (:). The following is an example of an IPv6 address:

2001:0000:130F:0000:0000:09C0:876A:130B.

Several methods could be used to simplify the IPv6 address. For example, the leading zeros in each group can be omitted. But each group must contain at least one hexadecimal number. The above IPv6 address can be represented as follows:

2001:0:130F:0:0:9C0:876A:130B.

One or more consecutive groups containing only zeros may be represented by empty groups using consecutive colons (::). This substitution can be applied only once in the address. The above address can be represented as follows:

2001:0:130F::9C0:876A:130B.

An IPv6 address consists of two parts, an address prefix and an interface identification. The address prefix is similar to the network number in an IPv4 address, and the interface identification is similar to the mainframe number. The IPv6 address can be represented in different ways but the address prefix is always a decimal numeral.

IPv6 Neighbor Discovery Protocol

The Neighbor Discovery Protocol is an IPV6 protocol that gathers information that is required for interet communication such as the configuration of local connections, and the domain name servers and gateways used to communicate with distant systems. This protocol is similar to the Address Resolution Protocol (ARP) , Internet Control Message Protocol (ICMP) and Router Discovery and Router Redirect protocols used for IPv4.

Neighbor Discovery Portocol uses five different ICMv6 messages to accomplish activities such as address resolution, verifying neighbor reachability, duplicate addresses detection, router discovery/prefix discovery, and address auto-configuration and redirection.

The types and functions of ICMPv6 messages in Neigbor Discovery Protocol are shown below:

ICMPv6 Message

Function

Neighbor Solicitation (NS)

Used to get the link-layer address of a neighbor. Detects neighbor reacheablilty and duplicate addressess.

Neighbor Advertisement (NA)

Used by the nodes to respond to neighbor solicitation messages.

Router Solicitation (RS)

Used by the host to request the router to request prefixed and configuration information to configure the host.

Router Advertisement (RA)

Used by routers to advertise their presence and various Internet parameters either periodically or in response to Router Solicitation message.

Redirect

Used by routers to inform hosts of a better first hop router for a destination.

Functions of the Neighbor Discovery Protocol

Address resolution

This function is similar to the ARP function of IPv4. It obtains the link layer address of neighbor node on the same link through neighbor solicitation and neighbor advertisement.

  • Node A sends NS messages in multicast mode. The source address of the NS message is the IPv6 address of node A, and the destination address is the requested node multicast address of node B. The NS message contains the link layer address of node A.

  • After receiving the NS message, node B determines whether the destination address of the packet is the multicast address of the requested node corresponding to its own IPv6 address. If so, B learns the link layer address of A and returns the NA message in unicast mode, which contains its own link-layer address.

  • Node A obtains the link layer address of node B from the received NA message. Both parties can now communicate.

Verifying neighbor reachibility
After obtaining the link layer address of the neighbor node, NS and NA mssages can verify whether the neighbor node is reachable.
  • The node sends an NS message where the destination address is the IPv6 address of the neighboring node.

  • When receiving an acknowledgment packet from a neighbor, the neighbor is considered reachable; otherwise, the neighbor is considered unreachable.

Duplicate address detection

After a node obtains an IPv6 address, it needs to use the duplicate address detection function to determine whether the address is used by other nodes. This is similar to the gratuitous ARP function of IPv4. This is also achieved through the NS message and NA messages.

  • Node A sends an NS message. The source address of the NS message is the unspecified address and the destination address is the multicast address of the requested node corresponding to the IPv6 address to be detected. The content of the message contains the IPv6 address to be detected.

  • If Node B already uses this IPv6 address, it will return a NA message. This message contains its own IPv6 address.

  • If host A does not receive any NA message, then the address is available for the host A.

How to Configure IPv6 Addresses

The following topics provide information about the procedures you can perform to configure IPV6 addresses.

Configuring IPv6 Unicast Address

To access an IPv6 network you have to configure IPv6 addresses. You can choose from global unicast address, site local address and link local address. Before accesing an IPv6 network you must configure an IPv6 unicast address. The IPv6 global unicast address or the site local address can be configured in the following ways:

  • EUI-64: When adopting EUI-64 to form IPv6, the prefix of IPv6 address of the interface is the configured prefix. The interface identifier is translated from the link-layer address of the interface.

  • Manual mode: You can configure IPv6 site local address or global unicast address in the manual mode.

  • DHCP mode: You can configure to obtain IPv6 site local address or global unicast address or some related information through DHCP server.

  • Auto configurations: IPv6 and related information is automatically configured based on its own link layer address and the prefix information advertised by the router.

The link-local address of IPv6 can be obtained in two ways:

  • Automatic generation: Automatically generates link local address for interface based on link local address prefix (FE80::/64) and link layer address of the interface.

  • Manual assignment: Manually configure IPv6 link local address.

You need to configure a Layer 2 device under global configuration mode, and a Layer 3 device under interface mode. To configure IPv6 address on a Layer 3 device, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 { enable| disable}

Example:

Device(config)# ipv6 enable

Enables ipv6 forwarding function.

Step 4

interface vlan-interface vlan-id

Example:

Device(config)# interface vlan-interface 1

Enters the VLAN interface and the VLAN configuration mode.

Step 5

ipv6 addressipv6 address/prefix-length eui-64

Example:

Device(config-vlan-if)# ipv6 address 3ffe::/64 eui-64

Configures the site-local address and global unicast address in EUI-64 format

Step 6

ipv6 address ipv6 address/prefix-length

Example:

Device(config-vlan-if)# ipv6 address 3ffe::1/64

Configures an IPv6 address based on the IPv6 prefix and enables IPv6 processing on the interface.

Step 7

ipv6 address autoconfig

Example:

Device(config-vlan-if)# ipv6 address autoconfig

Automatically configures the site-local address and the global unicast address.

Step 8

ipv6 address ipv6-address link-local

Example:

Device(config-vlan-if)# ipv6 address fe80::100 link-local

Specifies the link-local address manually. By default, a link-local address is automatically formed.

Step 9

exit

Example:

Device(config-vlan-if)# exit

Exits the VLAN configuration mode.

Step 10

show ipv6 interface { vlan-interface vlan-id}

Example:

Device# show ipv6 interface vlan-interface 1

Shows IPv6 address status.

What to do next

You can delete an IPv6 address by using the no form of its command.

Configuring Static Neighbor List

The parsing of the IPv6 address of a neighboring node into a link-layer address can be implemented dynamically through NS and NA, and it can also be implemented by configuring a static neighbor entry. Static neighbor entry includes long static neighbor entry or short static neighbor entry.

  • Long static neighbor list: When configuring a long static neighbor entry, besides configuring the IPv6 address and MAC address entry, you must also configure the VLAN and port where the neighbor entry is located. Long static neighbor entries can be directly used for packet forwarding.

  • Short static neighbor list: When configuring a short static neighbor entry, you only need to configure the IPv6 address and MAC address entry. Short static neighbor entry cannot be directly used for packet forwarding. When a short static neighbor entry needs to be used, the neighbor request packet is sent first. If the source IPv6 address and source MAC address in the received response packet are the same as the configured IPv6 address and MAC address, the ARP table is sent. The entry is complete and can then be used for the forwarding of IPv6 packets.

To configure a static neighbor list, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

no ipv6 neighbor { dynamic | static| all}

Example:

Device(config)# no ipv6 neighbor dynamic

Deletes the neighbor list.

Step 4

show ipv6 neighbors { ipv6-address | all| dynamic| static| macmac-address

Example:

Device(config)# show ipv6 neighbors dynamic

Shows the neighbor list.

Configuring the Maximum Number of Neighbors

If the number of neighbors accessing the address is too high it can influence the transmission performance. To configure a maximum number of IPv6 neighbors, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 neighbors max-learning-num number

Example:

Device(config)# ipv6 neighbors max-learning-num 1000

Configures the maximum neighbor number. The maximum neighbor number includes static and dynamic neighbor numbers. The range for the number is from 1 to 2560. The default value is 64.

Step 4

show ipv6 neighbors max-learning-num

Example:

Device(config)# show ipv6 neighbors max-learning-num

Shows the limited max neighbor number.

Configuring the Number of Neighbor Solicitation Messages sent for Duplicate Address Detection

After the device obtains an IPv6 address, it sends a NS message to detect duplicate addresses that would conflict with the address. If no response is received within the specified time, the device continues to send the NS request. The IPv6 address is considered to be available after the number of transmissions reaches the configured number and no response has been received.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 nd dad attempts value

Example:

Device(config)# ipv6 nd dad attempts 10

Configures the number of times NS message is sent for duplicate address detection. The value ranges from 0 to 20. By default, the number of NS messages sent is 1. When the value is 0, it implies duplicate address detection is disabled.

Step 4

ipv6 nd ns retrans-time

Example:

Device(config)# ipv6 nd ns retrans-time 60

Sets the interval for retransmitting the NS message. By default, the interval for sending NS message is 1 second.

Step 5

show ipv6 nd dad attempts

Example:

Device(config)# show ipv6 nd dad attempts

Shows the number of times NS messages are being sent for duplicate address detection.

Step 6

show ipv6 nd ns retrans-time

Example:

Device(config)# show ipv6 nd ns retrans-time

Shows the interval at which the NS messages are being sent.

What to do next

You can configure the number of NS messages sent for duplicate address detection to the default value by using the no ipv6 nd dad attemps command. You can set the retransmission timer to the default value by using the no ipv6 nd ns retrans-time command.

Configuring Reachable Time

After the neighbor reachability test is used to confirm that the neighbor is reachable, the device considers the neighbor reachable within the set reachable time. After the set time expires, if the device needs to send packets to the neighbor, it will re-confirm whether the neighbor is reachable.

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 nd reachable-time value

Example:

Device(config)# ipv6 nd reachable-time 60

Configures the time for which the neighbor is considered to be in a reachable state. The value of the time ranges from 1 to 3600 seconds. The default value is set to 30 seconds.

Step 4

show ipv6 nd reachable-time

Example:

Device(config)# show ipv6 nd reachable-time

Shows the reachable time configured for the neighbors.

What to do next

You can reset the reachable time to its default value by using the no ipv6 nd reachable-time command.

Configuring IPv6 Static Route

To configure an IPv6 static route, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 route [ ipv6-address-mask| ipv6-address/prefixlength] next-hop-address

Example:

Device(config)# ipv6 route 2001:db8:1::1/64 2001:db8:1:abcd::1 

Configures an IPv6 static route.

Step 4

show ipv6 route

Example:

Device(config)# show ipv6 route

Shows IPv6 route list.

What to do next

You can delete the IPV6 static route list by using the no ipv6 route command.

Configuring Interface Maximum Transmission Unit

The Maximun Transimssion Unit for an IPv6 interface can be set in the range of 1280-1510 bytes. IPv6 packets which are smaller than 1280 bytes must be fragmented and encapsulated. The interface will discard packets which are bigger than the configured MTU. The steps for obtaining the MTU of an interface are as follows:

  • The sending node assumes that the path MTU is the egress link.

  • The sending node sends packet according to the assumed path MTU.

  • If the device cannot forward packets because the transmitting MTU is smaller than the assumed MTU, the device discards the packets and returns the ICMPv6 overloaded packets to the sending node. The overloaded packet carries the failure transmission link MTU.

To configure the MTU for an IPv6 interfcae, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

interface vlan-interface vlan-id

Example:

Device(config)# interface vlan-interface 1

Enters VLAN interface configuration mode.

Step 4

ipv6 pathmtu-value

Example:

Device(config-vlan_if)# ipv6 path 2000

Configures the MTU for the interface. The value of MTU ranges from 1280-1500. The default value of MTU is 1500.

What to do next

You can reset the default settings for MTU by using the no ipv6 path command.

Configuring Echo Relpy for Echo Request

To configure an echo reply for an echo request, perform this procedure:

Procedure

  Command or Action Purpose
Step 1

enable

Example:

Device> enable 

Enables privileged EXEC mode. Enter your password, if prompted.

Step 2

configure terminal

Example:

Device#configure terminal 

Enters global configuration mode.

Step 3

ipv6 icmpv6 multicast-echo-reply enable

Example:

Device(config)# ipv6 icmpv6 multicast-echo-reply enable

Enables echo reply for multicast packets.

What to do next

To disable echo reply for multicast packets you can use the no ipv6 icmpv6 multicast-echo-reply command.

Configuration Examples for IPv6 Addresses

The following topics provide examples of IPv6 address configuration.

Example: Configuring IPv6 Addresses

The following example shows how to configure IPv6 addresses on two devices interconnected through ethernet cables:

Configure Device A
Device(config)# interface vlan-interface 1
Device(config-if-vlanInterface-1)# ipv6 address 2001::1/64
Device(config-if-vlanInterface-1)# ipv6 address fe80:12::1 link-local
Configure Device B
Device(config)# interface vlan-interface 1
Device(config-if-vlanInterface-1)# ipv6 address 2001::2/64
Device(config-if-vlanInterface-1)# ipv6 address fe80:12::2 link-local

Example: Verifying IPv6 Addresses

The following example shows how to verify IPv6 address configuration on devices:

Show Device A ipv6 information
Device(config)#show ipv6 interface vlan-interface 1
Show inf Mirror the packet of CPU,ormations of ipv6 interface

VLAN-IF1:
sw0    Link type:Ethernet  HWaddr 00:00:00:09:99:99  Queue:none
        IPv6 forwarding is disabled
        inet6 unicast 2001::1  prefixlen 64
        inet6 unicast FE80::200:FF:FE09:9999%sw0  prefixlen 64  automatic
        inet6 unicast 2001::  prefixlen 64  anycast
        inet6 multicast FF02::1%sw0  prefixlen 16  automatic
        inet6 multicast FF02::1:FF09:9999%sw0  prefixlen 16
        inet6 multicast FF02::1:FF00:1%sw0  prefixlen 16
        inet6 multicast FF02::1:FF00:0%sw0  prefixlen 16
        UP RUNNING SIMPLEX BROADCAST MULTICAST PROMISC 
        MTU:1500  metric:1  VR:0  ifindex:2
        RX packets:150 mcast:35 errors:0 dropped:0
        TX packets:1216 mcast:33 errors:0
        collisions:0 unsupported proto:0
        RX bytes:13k  TX bytes:55k
show Device B ipv6 information

Device(config)#show ipv6 interface vlan-interface 1
Show informations of ipv6 interface

VLAN-IF1:
sw0    Link type:Ethernet  HWaddr 00:01:7a:e9:68:58  Queue:none
        IPv6 forwarding is disabled
        inet6 unicast FE80:12::2%sw0  prefixlen 64
        inet6 unicast 2001::2  prefixlen 64
        inet6 unicast FE80::201:7AFF:FEE9:6858%sw0  prefixlen 64  automatic
        inet6 multicast FF02::1%sw0  prefixlen 16  automatic
        inet6 multicast FF02::1:FFE9:6858%sw0  prefixlen 16
        inet6 multicast FF02::1:FF00:2%sw0  prefixlen 16
        UP RUNNING SIMPLEX BROADCAST MULTICAST PROMISC 
        MTU:1500  metric:1  VR:0  ifindex:2
        RX packets:21912 mcast:7990 errors:0 dropped:73
        TX packets:8300 mcast:8023 errors:0
        collisions:0 unsupported proto:0
        RX bytes:1858k  TX bytes:714k

The following example shows two devices pinging their local address and global unicast address. If the configuration is right, then the two IPv6 addresses can be pinged successfully.

Device(config)#ping6 FE80:12::2%sw0

Pinging FE80:12::2%sw0 (FE80:12::2%sw0) with 56 bytes of data:
Reply from FE80:12::2%sw0 bytes=56 time=10ms hlim=64 
Reply from FE80:12::2%sw0 bytes=56 time=10ms hlim=64 
Reply from FE80:12::2%sw0 bytes=56 time=10ms hlim=64 
Reply from FE80:12::2%sw0 bytes=56 time=10ms hlim=64 

--- FE80:12::2%sw0 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 4840 ms
rtt min/avg/max = 10/10/10 ms

Device(config)#ping6 2001::2

Pinging 2001::2 (2001::2) with 56 bytes of data:
Reply from 2001::2 bytes=56 time=10ms hlim=64 
Reply from 2001::2 bytes=56 time=10ms hlim=64 
Reply from 2001::2 bytes=56 time=10ms hlim=64 
Reply from 2001::2 bytes=56 time=10ms hlim=64 

--- 2001::2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 4840 ms
rtt min/avg/max = 10/10/10 ms

# show Device A neighbor list
Device(config)#show ipv6 neighbors all
Information of neighbor cache
Neighbor   Mac_Address   Vlan  Port    Type    Expire  Status
2001::2  00:01:7a:e9:68:58  1     e1/1  Dynamic  941 s   stale
FE80:12::2%sw0 00:01:7a:e9:68:58  1  e1/1  Dynamic  946 s   stale

Total entries:2