Wednesday, November 19, 2008

Pv6 isn’t something awfully new, but some of the ideas can be hard to grasp.


To understand IPv6 routing, I had to learn how to do subnetting of IPv6 address space.



Subnetting basics




To understand IPv6 subnetting, I took it from what I had learned about the basics of subnetting IPv4 addresses.



IPv4: The number 192.168.0.1 only represents a 32-bit number, split into 4 ‘octets’, which are groupings of 8 bits (256 combinations 0 - 255), each octet is separated with a dot ‘.’.


The network mask represents the subnet size, because the network mask eventuallyl decides who you can talk to (for example 255.255.255.0 means that all bits in the last octet can be freely manipulated, hence a subnet mask of 255.255.0.0 means you can change the tweak last octets to your hearts content.





IPv6 addresses and subnetting


This is basically just the same as for IPv4, except the address is now 128 bits compared to 32.


This makes room for 2^128 addresses while IP version 4 was limited to 2^32.


Just a little calculation, for the fun of it:





(2^128)-(2^32) = 340282366920938463463374607427473244160



This is how many MORE addresses the IP version 6 will give us.



In IPv6 the octets we all know from IPv4 are 8 groupings of 16 bits, and instead of being written in decimal format - they are written in hex.


So a valid IPv6 address could be 3ffe:1000:0000:0000:0000:0000:0000:0001/126.


How does this work?


/126 indicates that 2 bits left from the mask for host addressing, this will give four host addresses.



One thing you should notice is that while it can feel natural, it will not work to use addresses such as ::9, ::10, ::11, and ::12 for the same subnet.



The key here is hex, which ranges from 0 - 9 and a - f, so it’s counted like 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d,e and f.





To be certain, use the Online IPv4 and IPv6 calculator, it will calculate the subnets for you.


Just enter an IPv6 or IPv4 address with the corresponding CIDR (for example /24) and it will return the network range.



Enable forwarding of IPv6 Unicast Packets in Cisco IOS





Router(config)# ipv6 unicast-routing



Configure a static IPv6 default gateway/route





Router(config)# ipv6 route ::/0 3ffe:1::1



This would configure a default route to 3ffe:1::1.





Configuring an IPv6 address on an interface





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



Verifying configuration


Verify IPv6 Routing Table





Router# show ipv6 route



Pinging over IPv6 from Cisco IOS





Router# ping ipv6

0 Comments:

Post a Comment