Friday, January 23, 2009

Renumbering IPv6 with ease via ipv6 general-prefix

This is rather neat IPv6 feature that eases renumbering. We define a general prefix globally and then assign interface addresses based on that interface. Should you change providers or ever have to renumber the network, all you have to do is change the general prefix. Here's how it works:

R5(config)#ipv6 general-prefix TEST 2001:5::/48
R5(config)#
R5(config)#int s1/0
R5(config-if)#ipv6 address TEST 2001:5::/48 eui-64

R5#sho ipv6 interface s1/0 | inc :
IPv6 is enabled, link-local address is FE80::E1B8:5FF:FE4C:9CDD
Global unicast address(es):
2001:5::, subnet is 2001:5::/48 [GEN]
2001:5::E1B8:5FF:FE4C:9CDD, subnet is 2001:5::/48 [EUI]
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:0
FF02::1:FF4C:9CDD
ND DAD is enabled, number of DAD attempts: 1
R5#


We now have an IPv6 address assigned based on the EUI-64 method. The address is 2001:5::E1B8:5FF:FE4C:9CDD. Now suppose we need to change our prefix to 2001:6.

R5(config)#no ipv6 general-prefix TEST 2001:5::/48
R5(config)#ipv6 general-prefix TEST 2001:6::/48
R5(config)#
R5(config)#^Z
R5#sho ipv6 interface s1/0 | inc :
IPv6 is enabled, link-local address is FE80::E1B8:5FF:FE4C:9CDD
Global unicast address(es):
2001:6::, subnet is 2001:6::/48 [GEN]
2001:6::E1B8:5FF:FE4C:9CDD, subnet is 2001:6::/48 [EUI]
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:0
FF02::1:FF4C:9CDD
ND DAD is enabled, number of DAD attempts: 1
R5#

Image if we had more interfaces, this would make things so much easier. Especially considering each interface would have its own subnet. Imagine if we had interfaces on the 2001:5:0:1, 2001:5:0:2 (and so on) networks. We could change all of these to /48 prefix 2001:6:0:x:/64 with a couple commands. When you do change the general prefix, it does not overwrite the already configured one. This way you can have two prefixes during transition and eventually remove the older one as we did above.

2 comments:

  1. The idea behind general prefix is to allow you to configure an IPv6 address or prefix from two pieces of information. One part from the general prefix command and one given in the "ipv6 address", ACL or other command requiring an IPv6 address or prefix.

    The combination of the two should in the case of an address result in 128 bits. Your example shouldn't parse:

    R5(config-if)#ipv6 address TEST 2001:5::/48 eui-64

    As you get 48 bits from the general prefix "TEST", then provide another 48 bits in the 2001 prefix plus 64 bits in the EUI-64.

    The correct command should be:
    ipv6 address TEST ::/64 eui-64

    Which is 48 + 12 (::) + 64.

    This mechanism would have been a great help for renumbering if all commands requiring prefix or addresses were supported, unfortunately only a couple are.

    ReplyDelete
  2. Thanks for the comment! I wasn't exactly sure how to interpret the command after reading the configuration guide but your explanation certainly helps.

    ReplyDelete

Note: Only a member of this blog may post a comment.