The upper 64 bits of an IPv6 prefix usually consists of a /48 global routing prefix (or site prefix) and the remaining 12 bits are used for more specific prefixes (the subnet). This is explained in detail in the following lesson:
The IPv6 general (or generic) prefix feature lets you renumber a global prefix on your router or switch. This is a simple but pretty useful feature.
For example, let’s say we have the following global prefix:
- 2001:41f0:4060::/48
And we use the following specific prefixes:
- 2001:41f0:4060:0001::/64
- 2001:41f0:4060:0002::/64
- 2001:41f0:4060:0003::/64
- 2001:41f0:4060:0004::/64
You can configure these prefixes manually on your interfaces but once your global prefix changes, you have to manually reconfigure your IPv6 addresses. With the IPv6 general prefix feature, we can do this automatically.
Configuration
To demonstrate this, I’ll use a router with four interfaces. On each interface, I’ll use the global prefix and specific prefixes from above.
We configure the global prefix with the ipv6 general-prefix command. You can use whatever name you want, I’ll name mine “GLOBAL”:
R1(config)#ipv6 general-prefix GLOBAL 2001:41F0:4060::/48
On the interfaces, we configure an IPv6 address and refer to the general prefix. You have to specify a full IPv6 address, the first 48 bits will be replaced by the general prefix. I’ll use zeroes for the global prefix:
R1(config)#interface GigabitEthernet 0/1
R1(config-if)#ipv6 address GLOBAL ::1:0:0:0:1/64
R1(config)#interface GigabitEthernet 0/2
R1(config-if)#ipv6 address GLOBAL ::2:0:0:0:1/64
R1(config)#interface GigabitEthernet 0/3
R1(config-if)#ipv6 address GLOBAL ::3:0:0:0:1/64
R1(config)#interface GigabitEthernet 0/4
R1(config-if)#ipv6 address GLOBAL ::4:0:0:0:1/64
Let’s see what prefixes we ended up with:
R1#show ipv6 interface | include 2001
2001:41F0:4060:1::1, subnet is 2001:41F0:4060:1::/64
2001:41F0:4060:2::1, subnet is 2001:41F0:4060:2::/64
2001:41F0:4060:3::1, subnet is 2001:41F0:4060:3::/64
2001:41F0:4060:4::1, subnet is 2001:41F0:4060:4::/64
This is looking good. You can see we have four prefixes and the global prefix is 2001:41F0:4060.
Let’s see if we can change our global prefix without manually reconfiguring each interface. I’ll use the ipv6 general prefix command again to use a different global prefix: