Useful Articles

25/recent/ticker-posts

IPv6 Stateless Autoconfiguration

IPv6 Stateless Autoconfiguration - Concept

IPv6 Stateless Autoconfiguration is a  capability of a host to automatically acquire an IP address without needing DHCP. It uses its link-local address and the Neighbor Discovery Protocol (NDP) to do this. Each device creates a link-local address for itself based on the prefix FE80:: and the interface MAC address. This address is only valid on the local network. It then uses NDP to make sure that the address is unique. NDP has several functions in IPv6, including the following:

Neighbor Discovery

Similar to ARP, the host discovers the link-local address of neighbors using an NS message. This is ICMP type 135. Neighbors respond with an ICMP type 136 message.

Duplicate Address Discovery (DAD)

The host uses Neighbor Solicitation (NS) to send a message to its own address. No response means that the link-local address is unique.

Router Discovery

IPv6 routers periodically send Router Advertisements (RAs) listing the network prefix. When a host comes online it immediately sends a Router Solicitation (RS) message, asking for prefix information, rather than waiting for the RA. This is sent to the All-routers multicast address(FF02::2).To configure stateless autoconfiguration, use the interface command ipv6 address autoconfig. Acquiring an address involves the following steps:
  1.  The host creates a link-local address.
  2.  It sends an NS message to its link-local address out the interface.
  3. If there is no reply, DAD declares the address unique.
  4. If the host doesn’t receive an RA, it sends an RS.
  5. A router on the subnet sends an RA, listing its interface prefix.
  6. The host uses that prefix and the interface MAC address to create its IPv6 address.
Below are an example and a config. Host-PC is not configured with a Global IPv6 address manually. It is configured to get an IPv6 address automatically from Router R2. Below is the sample config.

IPv6 Stateless Autoconfiguration, IPv6

R2(config)# int f1/0
R2(config-if)#ipv6 address  2001:10:10:23::2/64

Host-PC(config)#int f0/0
Host-PC(config-if)#ipv6 address autoconfig

 Host-PC#sh ipv6 interface f0/0
FastEthernet0/0 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::C803:23FF:FEA8:0
  No Virtual link-local address(es):
  Stateless address autoconfig enabled
  Global unicast address(es):
    2001:10:10:23:C803:23FF:FEA8:0, subnet is 2001:10:10:23::/64 [EUI/CAL/PRE]
    valid lifetime 2591973 preferred lifetime 604773
    Joined group address(es):
    FF02::1
    FF02::1:FFA8:0
  MTU is 1500 bytes
  ICMP error messages limited to one every 100 milliseconds
  ICMP redirects are enabled
  ICMP unreachables are sent
  ND DAD is enabled, number of DAD attempts: 1
  ND reachable time is 30000 milliseconds (using 30000)
  ND NS retransmit interval is 1000 milliseconds
  Default router is FE80::C802:27FF:FE5C:1C on FastEthernet0/0    >>>>>> R2

You can see from the output above that Host-PC has been assigned an IPv6 address by R2 automatically (same as DHCP) using the Stateless Auto-configuration mechanism. The network address assigned to Host PC is same that of network address configured on R2's f1/0 (2001:10:10:23::/64)


Below are the snapshots from Wireshark showing Host-PC obtaining automatic Global IPv6 address.  This is as per steps 1 to 6 explained above in Router Discovery Procedure.

Step 1 of Router Discovery (Debug logs -- "Debug IPv6 ND" on Host-PC)

*Nov 20 15:55:53.915: ICMPv6-ND: L2 came up on FastEthernet0/0

Step 2 of Router Discovery

IPv6 Stateless Autoconfiguration

Step 3 of Router Discovery (Debug logs -- "Debug IPv6 ND" on Host-PC)

*Nov 20 15:55:53.915: IPv6-Addrmgr-ND: DAD request for FE80::C803:23FF:FEA8:0 on  FastEthernet0/0
*Nov 20 15:55:54.919: IPv6-Addrmgr-ND: DAD: FE80::C803:23FF:FEA8:0 is unique.

Step 4 of Router Discovery

IPv6 Stateless Autoconfiguration


Step 5 of Router Discovery

IPv6 Stateless Autoconfiguration


Step 6 of Router Discovery (Debug logs -- "Debug IPv6 ND" on Host-PC)

*Nov 20 15:55:55.263: IPv6-Addrmgr-ND: DAD request for 2001:10:10:23:C803:23FF:FEA8:0 on FastEthernet0/0
*Nov 20 15:55:55.263: ICMPv6-ND: Sending NS for 2001:10:10:23:C803:23FF:FEA8:0 on FastEthernet0/0
*Nov 20 15:55:55.263: ICMPv6-ND: Autoconfiguring 2001:10:10:23:C803:23FF:FEA8:0 on FastEthernet0/0
*Nov 20 15:55:56.263: IPv6-Addrmgr-ND: DAD: 2001:10:10:23:C803:23FF:FEA8:0 is unique.
 


If you understood the concept and like this article, kindly share the same with your friends.