Skip to content
Ask AI

IPv6 Configuration

IPv6 (Internet Protocol Version 6) is the second-generation standard for network layer protocols, used to replace IPv4. This chapter introduces the basic IPv6 configurations supported by the device, including interface IPv6 address settings, Neighbor Discovery Protocol (NDP) management, Router Advertisement (RA) configuration, and the RA Guard security feature, to help users complete the deployment and maintenance of IPv6 networks.

IPv6 Address

The length of an IPv6 address is 128 bits, and it is usually represented using colon-separated hexadecimal notation (for example: 2001:db8::1/64). Device interfaces can be configured with global unicast addresses, unique local addresses, or link-local addresses. Link-local addresses (FE80::/10) are automatically generated when IPv6 is enabled on an interface and are often used for neighbor discovery and the establishment of routing protocol neighbors.

Neighbor Discovery Protocol (NDP)

NDP is a core protocol of IPv6, replacing ARP, ICMP router discovery, etc. in IPv4. Its main functions include:

  • Address resolution: Obtain the link-layer address corresponding to the IPv6 address on the same link through Neighbor Solicitation (NS) and Neighbor Advertisement (NA) messages, and maintain the neighbor cache table (which can be viewed via show ndp).
  • Router discovery: Hosts discover routers on the link and their configuration information through Router Solicitation (RS) and Router Advertisement (RA) messages.
  • Address autoconfiguration: Hosts can use the prefix information in RA messages for Stateless Address Autoconfiguration (SLAAC), or obtain addresses and other configurations through DHCPv6 (stateful configuration).

Router Advertisement (RA)

When a device functions as an IPv6 router, it can periodically send RA (Router Advertisement) messages to advertise network configuration information to hosts on the link, including:

  • Prefix information: IPv6 prefixes used for SLAAC (Stateless Address Autoconfiguration).
  • Flags: The M flag (managed flag) indicates whether the host should obtain an address using DHCPv6; the O flag (other flag) indicates whether to obtain other configurations (such as DNS) using DHCPv6.
  • Routing information: Specific routes and their priorities are advertised through routing options.
  • Other parameters: Link MTU, DNS servers, etc.

Configure the IPv6 Address of the Interface

Section titled “Configure the IPv6 Address of the Interface”
OperationCommandDescription
Enter the interface viewinterface interface-type interface-nameFor example: interface vlan 100
Configure IPv6 addressip address A::B/maskThe address format is X:X:X:X:X:X:X:X/prefix length
Delete the IPv6 addressno ip address* A::B/mask*-
Section titled “Configure the Interface to Use a Link-Local Address”

In some scenarios (such as BGP peer establishment), the link-local address of the interface needs to be used, which can be enabled through this command.

OperationCommandDescription
Enter the interface viewinterface interface-type interface-nameFor example: interface vlan 100
Enable the use of link-local addressesipv6 use-link-localThe interface will prioritize the use of link-local addresses.
Disableno ipv6 use-link-local-
OperationCommandDescription
Enter the system configuration viewconfigure terminal
Configure NDP packet rate limitingnd rate-limit* value*value:100-2000pps,Default 2000pps
OperationCommandDescription
Enter the system configuration viewconfigure terminal
Enable MAC address checknd ipv6 mac-check enableCheck whether the link layer address of the ND message is consistent with the source MAC. If they are inconsistent, discard the message.
Turn off the checkno nd ipv6 mac-check enable-

The RA function is used to advertise IPv6 network configuration information to hosts on the link.

OperationCommandDescription
Enter the system configuration viewconfigure terminal
Enable RAnd raThe device will send RA messages periodically.
Turn off RAno nd ra-

RA messages do not carry prefixes by default and need to be specified manually.

OperationCommandDescription
Enter the VLAN viewvlan vlan-idFor example: vlan 100
Configure prefixnd ra prefix* A::B/mask*For example: nd ra prefix fd00:100::/64
Remove the prefixno nd ra prefix* A::B/mask*-
  • M flag (managed flag): Indicates whether the host uses DHCPv6 to obtain an IPv6 address.
  • O flag (other flag): Indicates whether the host uses DHCPv6 to obtain other configurations (such as DNS).
  • A flag (autonomous flag): Indicates whether the prefix is used for SLAAC.
OperationCommandDescription
Enter the VLAN viewvlan vlan-idFor example: vlan 100
Configure the M flagnd ra managed-flag {on|off}default off
Configure the O flagnd ra other-flag {on|off}default off
Configure the A flagnd ra autonomous{on|off}default off

Advertise specific routing information to the host via RA.

OperationCommandDescription
Enter the VLAN viewvlan vlan-id-
Configure routing informationnd ra route-information* A::B/mask* [preference {low|medium|high}]Default priority medium
Delete routing informationno nd ra route-information A::B/mask-

Including DNS servers, link MTU, etc.

OperationCommandDescription
Enter the VLAN viewvlan vlan-id-
Configure the DNS servernd ra dns-server A::BMultiple DNS servers can be configured multiple times
Delete the DNS serverno nd ra dns-server* A::B*-
Configure the link MTUnd ra link-mtu mtuThe value range of mtu is 0 or 1280-1500, where 0 means not carrying this option.
OperationCommand
Display interface IPv6 address informationshow ipv6 interfaces
Display the IPv6 neighbor table (NDP table)show ndp
Display the neighbor information of the specified IPv6 addressshow ndp ipv6-address A::B
Display the neighbor information of the specified interfaceshow ndp ipv6 iface {mgmt|ethernet} interface-name
Display IPv6 MAC address detection configurationshow nd ipv6 mac-check
Display ND message speed limit configurationshow nd rate-limi t

Networking Requirements

A park’s network uses IPv6, with a switch acting as the gateway. The requirements are as follows:

1. Hosts in VLAN100 automatically obtain IPv6 addresses through SLAAC, with the prefix being fd00:100::/64.

2. The switch sends RA messages regularly and advertises the DNS server 2400:3200:baba::1.

Configuration Steps

sonic# configure terminal
sonic(config)# vlan 100
sonic(config-vlan-100)# exit
sonic(config)# interface vlan 100
sonic(config-vlanif-100)# ip address fd00:100::1/64
sonic(config-vlanif-100)# nd ra
sonic(config-vlanif-100)# nd ra prefix fd00:100::/64
sonic(config-vlanif-100)# nd ra autonomous on
sonic(config-vlanif-100)# nd ra dns-server 2400:3200:baba::1
sonic(config-vlanif-100)# end

Verification

Check the interface IPv6 address: show ipv6 interfaces

Check the NDP neighbor table: show ndp, and you should be able to observe the neighbor entries of the host.

After the host is built, check whether the host has automatically obtained an address with the fd00:100::/64 prefix.