Courseiva
IPv6Interface Config

ipv6 address [prefix/len]

Assigns a global unicast or link-local IPv6 address to an interface, enabling IPv6 routing on that interface.

Definition: ipv6 address [prefix/len] is a Cisco IOS interface config command. Assigns a global unicast or link-local IPv6 address to an interface, enabling IPv6 routing on that interface.

Overview

The `ipv6 address [prefix/len]` command is used in Cisco IOS interface configuration mode to assign a global unicast or link-local IPv6 address to an interface, thereby enabling IPv6 routing on that interface. This command is fundamental for IPv6 deployment, as it provides the necessary Layer 3 address for an interface to participate in IPv6 networks. Unlike IPv4, where addresses are often assigned via DHCP, IPv6 supports multiple address types and assignment methods, including stateless address autoconfiguration (SLAAC) and DHCPv6.

However, for static or manually configured addresses, this command is essential. It allows network engineers to specify a prefix and prefix length, which defines the network portion and host portion of the address. The command also implicitly enables IPv6 on the interface, which is required before any other IPv6 features (like OSPFv3 or EIGRP for IPv6) can be configured.

Without an IPv6 address configured on an interface, IPv6 routing protocols will not form adjacencies over that interface. This command is typically used in conjunction with other IPv6 configuration commands, such as `ipv6 unicast-routing` globally, and `ipv6 enable` for link-local addresses. The command directly modifies the running configuration, and the change is immediate.

It requires privileged EXEC mode (enable) to enter global configuration, and then interface configuration mode. The command is available in all IOS versions that support IPv6, including IOS 12.2(2)T and later. It is important to note that the prefix length must match the subnet mask length; common values are /64 for typical subnets, but /126 or /127 are used for point-to-point links.

A common mistake is using a prefix length that is not a multiple of 4, which is allowed but can lead to confusion. The command supports both EUI-64 and manual interface identifiers. When configuring a link-local address, the `ipv6 address link-local` variant is used, but the base command can also assign a link-local address if the prefix is fe80::/10.

However, it is best practice to use the dedicated link-local command for clarity. This command is a cornerstone of IPv6 interface configuration and is one of the first steps in enabling IPv6 on a Cisco router or switch.

Syntax·Interface Config
ipv6 address [prefix/len]

When to Use This Command

  • Configuring an IPv6 address on a router interface to enable IPv6 communication on a subnet
  • Setting a link-local address manually for neighbor discovery or routing protocol adjacency
  • Assigning an IPv6 address to a VLAN interface for inter-VLAN routing
  • Configuring an IPv6 address on a loopback interface for management or OSPFv3 router-id

Parameters

ParameterSyntaxDescription
prefix/lenX:X:X:X::X/<0-128>Specifies the IPv6 prefix and prefix length. The prefix is a 128-bit address in colon-hexadecimal notation, and the length is a decimal value from 0 to 128 indicating the number of leading bits that form the network portion. Common lengths are 64 for subnets, 126 or 127 for point-to-point links. The address must be a valid global unicast or unique local address; link-local addresses (fe80::/10) are also accepted but typically configured with the `ipv6 address link-local` command. A common mistake is omitting the prefix length or using an incorrect length, which can cause routing issues.

Command Examples

Assign a global unicast IPv6 address

ipv6 address 2001:db8:1:1::1/64
Router(config-if)# ipv6 address 2001:db8:1:1::1/64
Router(config-if)# end
Router# show ipv6 interface brief
GigabitEthernet0/0    [up/up]
    FE80::1
    2001:DB8:1:1::1

The command assigns the global unicast address 2001:db8:1:1::1/64 to the interface. The output from 'show ipv6 interface brief' shows the interface state and the IPv6 addresses configured, including the automatically generated link-local address (FE80::1) and the assigned global address.

Assign a link-local address manually

ipv6 address fe80::1 link-local
Router(config-if)# ipv6 address fe80::1 link-local
Router(config-if)# end
Router# show ipv6 interface gigabitethernet0/0
GigabitEthernet0/0 is up, line protocol is up
  IPv6 is enabled, link-local address is FE80::1
  Global unicast address(es):
    2001:DB8:1:1::1, subnet is 2001:DB8:1:1::/64

This manually sets the link-local address to FE80::1. The 'show ipv6 interface' output confirms the link-local address and also shows any global unicast addresses configured on the interface.

Understanding the Output

The command itself does not produce output; it configures the interface. To verify, use 'show ipv6 interface brief' or 'show ipv6 interface [interface]'. The 'show ipv6 interface brief' output lists each interface with its status (up/down) and the IPv6 addresses assigned.

The 'show ipv6 interface' output provides detailed information including the link-local address, global unicast addresses, multicast groups, and neighbor discovery parameters. Key fields: 'IPv6 is enabled' indicates the interface is active; 'link-local address' is the automatically generated or manually set link-local; 'Global unicast address(es)' lists assigned global addresses. A good state shows 'up/up' for the interface and valid addresses.

Watch for 'Tentative' or 'Duplicate' status indicating address conflicts.

Configuration Scenarios

Assign a global unicast IPv6 address to a router interface

A network engineer needs to enable IPv6 on a router's GigabitEthernet0/0 interface to connect to an IPv6-enabled network. The assigned subnet is 2001:db8:1:1::/64.

Topology

R1(Gi0/0)---2001:db8:1:1::/64---(Gi0/0)R2

Steps

  1. 1.Step 1: Enter privileged EXEC mode: enable
  2. 2.Step 2: Enter global configuration mode: configure terminal
  3. 3.Step 3: Enter interface configuration mode for GigabitEthernet0/0: interface GigabitEthernet0/0
  4. 4.Step 4: Assign the IPv6 address with prefix length: ipv6 address 2001:db8:1:1::1/64
  5. 5.Step 5: Exit interface configuration mode: exit
  6. 6.Step 6: (Optional) Enable IPv6 unicast routing globally: ipv6 unicast-routing
Configuration
!
interface GigabitEthernet0/0
 ipv6 address 2001:db8:1:1::1/64
!

Verify: Use `show ipv6 interface GigabitEthernet0/0` to verify the address is assigned. Expected output includes 'IPv6 is enabled', 'Global unicast address(es): 2001:DB8:1:1::1, subnet is 2001:DB8:1:1::/64'.

Watch out: Forgetting to enable `ipv6 unicast-routing` globally will prevent the router from forwarding IPv6 packets between interfaces, even though the interface has an IPv6 address.

Configure a link-local IPv6 address on a router interface

A network engineer wants to manually set a specific link-local address on an interface for easier identification in routing protocol adjacencies, instead of using the automatically generated EUI-64 address.

Topology

R1(Gi0/0)---fe80::1 link-local---(Gi0/0)R2

Steps

  1. 1.Step 1: Enter privileged EXEC mode: enable
  2. 2.Step 2: Enter global configuration mode: configure terminal
  3. 3.Step 3: Enter interface configuration mode for GigabitEthernet0/0: interface GigabitEthernet0/0
  4. 4.Step 4: Assign the link-local address using the link-local keyword: ipv6 address fe80::1 link-local
  5. 5.Step 5: Exit interface configuration mode: exit
Configuration
!
interface GigabitEthernet0/0
 ipv6 address fe80::1 link-local
!

Verify: Use `show ipv6 interface GigabitEthernet0/0` and look for 'link-local address: FE80::1'. Also, `show ipv6 route` will show connected routes with the link-local next hop.

Watch out: Using `ipv6 address fe80::1/64` without the link-local keyword will assign it as a global unicast address, which is incorrect and may cause routing issues. Always use the link-local keyword for link-local addresses.

Troubleshooting with This Command

When troubleshooting IPv6 connectivity issues, the `show ipv6 interface` command is the primary tool to verify that an IPv6 address is correctly configured on an interface. Healthy output shows 'IPv6 is enabled', a valid global unicast address with the correct prefix, and a link-local address. Problem indicators include 'IPv6 is disabled' (meaning the interface has no IPv6 address or `ipv6 enable` was not issued), or 'No global unicast address' (if only a link-local address is configured).

Focus on the 'Global unicast address(es)' field to ensure the address matches the intended subnet. Common symptoms this command helps diagnose include: inability to ping a remote IPv6 address (check if the interface has an address in the correct subnet), OSPFv3 neighbors not forming (verify that the interface has a global unicast address and that `ipv6 ospf` is configured), or routing table missing connected routes (ensure the interface is up/up and has an IPv6 address). A step-by-step diagnostic flow: 1) Check interface status with `show interfaces` to ensure it is up/up. 2) Use `show ipv6 interface` to verify IPv6 is enabled and the address is correct. 3) If no address, check configuration: `show running-config interface`. 4) If address is present but connectivity fails, check routing with `show ipv6 route` and verify next-hop reachability. 5) Use `ping` with the source interface option (e.g., `ping ipv6 2001:db8:1:1::2 source GigabitEthernet0/0`) to test Layer 3 connectivity. 6) Correlate with `debug ipv6 packet` (use with caution) to see if packets are being sent and received.

The `show ipv6 interface` output also shows multicast group memberships, which is useful for verifying that the interface is listening for necessary multicast addresses (e.g., FF02::1 for all-nodes, FF02::2 for all-routers). If the interface is not showing expected multicast groups, IPv6 may not be fully operational. Additionally, check for duplicate address detection (DAD) failures: if the output shows 'DAD: duplicate address detected', the configured address conflicts with another device on the same link.

In that case, change the address or resolve the conflict. The command `show ipv6 neighbors` can help identify the conflicting device's MAC address. Overall, `show ipv6 interface` is the first command to use when troubleshooting IPv6 interface issues.

CCNA Exam Tips

1.

Remember that the 'ipv6 address' command is configured in interface configuration mode, not global config.

2.

The 'link-local' keyword is required to manually set a link-local address; otherwise, the router auto-generates one from the EUI-64 format.

3.

CCNA 200-301 expects you to know that IPv6 addresses are configured with a prefix length (e.g., /64), not a subnet mask.

4.

Be aware that 'ipv6 address' can also be used with 'eui-64' to generate the interface ID from the MAC address.

Common Mistakes

Forgetting to enter interface configuration mode before using the command (results in '% Invalid input detected').

Using a subnet mask (e.g., 255.255.255.0) instead of a prefix length (e.g., /64).

Omitting the 'link-local' keyword when trying to set a specific link-local address, causing the router to interpret it as a global address.

ipv6 address [prefix/len] vs ipv6 enable

Both commands enable IPv6 on an interface but serve different purposes. 'ipv6 enable' activates IPv6 processing without assigning a specific address, while 'ipv6 address' assigns a global unicast or link-local address. They are often confused because both are required for full IPv6 interface operation.

Aspectipv6 address [prefix/len]ipv6 enable
IPv6 ProcessingEnables IPv6 on interfaceEnables IPv6 on interface
Address AssignmentAssigns a specific IPv6 addressDoes not assign any address
Routing Protocol ParticipationAllows interface to participate in routing protocolsAllows interface to participate in routing protocols
Link-Local AddressAutomatically generates link-local addressAutomatically generates link-local address
DependencyDoes not require 'ipv6 enable'May be used as standalone
Typical Use CaseAssigning a static global unicast addressEnabling IPv6 for dynamic addressing or routing

Use ipv6 address [prefix/len] when you need to assign a specific static IPv6 address to an interface, such as for servers or critical infrastructure.

Use ipv6 enable when you only need link-local connectivity or are relying on SLAAC, DHCPv6, or other address assignment methods.

Platform Notes

In IOS-XE (e.g., Catalyst 9000 switches), the command syntax is identical to classic IOS. However, the output of `show ipv6 interface` may include additional fields such as 'IPv6 subnet' and 'IPv6 link-local address' formatted slightly differently. For NX-OS (e.g., Nexus switches), the equivalent command is `ipv6 address <prefix/len>` in interface configuration mode, but NX-OS also supports the `ipv6 address <prefix/len> eui-64` variant.

Additionally, NX-OS uses `ipv6 enable` to enable IPv6 on an interface without assigning a global address, similar to IOS. For ASA firewalls, IPv6 addressing is configured with `ipv6 address <prefix/len>` in interface configuration mode, but the ASA also requires `ipv6 enable` to activate IPv6. In IOS-XR (e.g., ASR 9000), the command is `ipv4 address <prefix/len>` for IPv4; for IPv6, it is `ipv6 address <prefix/len>` in interface configuration mode, but the syntax is identical.

However, IOS-XR uses a different configuration hierarchy (config-if) and the command is committed with `commit`. There are no significant differences between IOS 12.x, 15.x, and 16.x for this command; the syntax and behavior remain consistent. One minor difference: in older IOS versions (12.x), the command `ipv6 address` automatically enables IPv6 on the interface, while in newer versions, you may need to explicitly use `ipv6 enable` if you only want a link-local address.

Always check the specific platform documentation for any nuances.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions