Wednesday, March 8, 2017

Methods of Assigning IPv6 Addresses

If you are not familiar with IPv6 addressing please refer this post. You will also need some basic understanding about the multicast routing (solicitation) to understand this. Here I am going to assign & configure IPv6 addresses on interfaces..

Let's get on with the topology..

There is no VLAN configured in the switch, It is just connecting the 3 routers in to a single broadcast domain.








All 3 routers are enabled with IPv6 routing & CEF (Cisco Express Forwarding) using the following commands..
R1(config)#ipv6 unicast-routing
R1(config)#ipv6 cef

Like the ARP (Address Resolution Protocol) in IPv4; IPv6 has its own method of address resolution..
IPv6 uses 4 types of packets to resolve addresses of other interfaces in its subnet.

(1) Neighbor Solicitation (NS): equivalent to ARP request
(2) Neighbor Advertisement (NA): equivalent to ARP reply in gratuitous mode
(3) Router Solicitation (RS)
(4) Router Advertisement (RA)

Enabling IPv6 with Link Local Addresses

Let's enable IPv6 on R1's e0/0 interface and see what happens..
R1(config-if)#ipv6 enable

Note:- If you are going to use Global Unicast addresses, you don't want to enter the above command.
This command is only for Link Local Addresses..

Now you can see, it has automatically assigned its Link Local address with EUI-64 format using its MAC address.







What happens at the back end is that;

Step 01
R1 1st calculates and comes up with its IPv6 address (in this case FE80::A8BB:CCFF:FE00:1000)

Step 02
Then it sends a multicast packet to FF02::1:FFxx:xxxx (last 6 digits are from the EUI-64 address which it came up with) which is the all solicited multicast address used for auto configuration and auto discovery of the IPv6 interfaces in a subnet (in this case it is FF02::1:FF00:1000)
The source of this packet is "::" which is called unspecified / null address..
What R1 actually doing here is it asks other routers in the segment;

Does anybody else use FE80::A8BB:CCFF:FE00:1000 for an interface??

This mechanism is called "DAD" (Duplicate Address Detection) & this packet is called the "NS" (Neighbor Solicitation) packet..

Step 03
If there is no reply coming from other routers, R1 thinks no one else is using it and R1 assigns it to its interface & starts using it..

Step 04
Then R1 sends 2 packets to the destination FF02::1 which goes to all nodes in the segment sourcing its new address FE80::A8BB:CCFF:FE00:1000
1st packet is called a "NA" (Neighbor Advertisement) and the 2nd packet is called a "RA" (Router Advertisement)
NA is like a ARP reply in IPv4..
It is really like a gratuitous ARP, because it is sending its ARP reply equivalent even though no one asked it.. So that other routers in the segment will know the MAC address (populate neighbor discovery cache) of the R1's interface since then..
RA contains the capabilities of the interface like MTU..

Assigning Addresses Statically


This is how you assign global unicast addresses to a router interface. It is just like in IPv4..
R1(config-if)#ipv6 address 2001::1/64

Note:- Even though you entered an IPv6 address statically, it automatically generates its Link Local address in previous method and undergo the above 4 steps..

Assigning Addresses via SLAAC

SLAAC refers to Stateless Address Auto Configuration. This method works only for /64s on the link.
Now let's start from clean configurations of routers.
Lets configure SLAAC on R3's Eth0/0 interface 1st and see what happens..
R3(config-if)#ipv6 address auto-config

You can see It automatically assigns its Link Local address to the interface just like in previous example. So it runs the above 4 steps and sends the NS to run DAD and the NA & the RA to inform its IPv6 address and MAC address to other neighbors..




In addition to that in this case R3 uses a "RS" (Router Solicitation) destined to FF02::2 (which is all routers in the segment in IPv6 multicast) from the source address as its Link Local address to ask other routers in the segment that;

Is there anyone who can give me an IPv6 global unicast prefix??

Now let's assign an IPv6 address to the R1's Eth0/0 interface manually..

You can see that R1 has assigned its Link Local address automatically to its interface along with the IPv6 address I gave manually.

Now R1 responds to the R3's RS with a RA mentioning its global unicast prefix..



Now let's see what has happened at the R3's side which the SLAAC is configured..

You can see It has now automatically assigned a global unicast address which has the 2001::/64 prefix with its EUI-64 format as the interface ID portion.

This is the behavior of SLAAC..
If you can assign an IPv6 address to one router and automatically other routers will grab the prefix and come up with their own EUI-64 based global unicast IPv6 address..

SLAAC & DHCPv6

SLAAC can give a router an IP address but cannot give the other options which a DHCP server provides. Ex:- DNS, TFTP option 150 for IP phones etc.

You can use SLAAC to auto assign IP addresses while use a DHCP to provide other options to routers or you can use DHCP for both address assigning and option delivery.

In RA messages which are sent from a router, there are 2 config flags which can be set in link level informing other routers in the segment to use SLAAC or DHCP for the address assigning and DHCP options receiving. These are disabled by default in routers..

Other-Config-Flag
When this flag is set, it says other routers to use SLAAC to assign addresses only. Use DHCPv6 to receive other options like DNS, TFTP etc..
R1(config-if)#ipv6 nd other-config-flag

Managed-Config-Flag
When this flag is set, it says other routers to use DHCPv6 for both address assigning and to receive other options like DNS, TFTP etc..
R1(config-if)#ipv6 nd managed-config-flag

General Prefix

This helps readdressing  your interfaces with newly assigned IPv6 prefix by a Regional Internet Registrar or Service Provider..
If an organization is assigned a /32, then all prefixes should be derived from this /32

This can be defined globally 1st,
R1(config)#ipv6 general prefix <PREFIX NAME> 3000:123::/32

and then enabled in interfaces..
R1(config-if)#ipv6 address <PREFIX NAME> ::1/64

Then the prefix and the interface ID is merged to create the full address..

If the old prefix was configured with the general prefix option, you can delete all the ip addresses which has been generated by that prefix by simply entering "no" before the command. This helps you to easily readdress interfaces..
Otherwise both the old and new addresses will be working together..

0 comments to “Methods of Assigning IPv6 Addresses”

Post a Comment