How to Set Up IPv6 on macOS

Summary

IPv6 is enabled by default on all modern versions of macOS (including macOS Sonoma, Ventura, Monterey, and earlier), requiring no manual configuration for most users. However, network administrators, power users, and those troubleshooting connectivity issues may need to verify IPv6 status, configure manual settings, or optimize their IPv6 deployment. This comprehensive guide covers checking IPv6 status, configuring IPv6 through System Settings, using command-line tools like networksetup, setting up static IPv6 addresses, and troubleshooting common macOS-specific IPv6 issues.

Default IPv6 Behavior on macOS

Since Mac OS X 10.3 Panther (released in 2003), Apple has enabled IPv6 by default on all macOS versions. This means your Mac is already configured to use IPv6 automatically when:

In most cases, you don't need to do anything. macOS will automatically:

  1. Generate link-local IPv6 addresses (starting with fe80::) (learn about link-local)
  2. Listen for Router Advertisement (RA) messages (understand NDP)
  3. Configure global unicast addresses using Stateless Address Autoconfiguration (SLAAC) (SLAAC explained)
  4. Set up IPv6 routing tables (find default gateway)
  5. Prefer IPv6 for dual-stack connections (when both IPv4 and IPv6 are available) (dual-stack networking)

Additionally, macOS 12.01 and later support RFC 8925 IPv6-Only Preferred Option for DHCPv4 (DHCP option 108), which improves IPv6 support in modern network environments and signals to dual-stack devices that IPv6 is the preferred protocol.

Checking Your Current IPv6 Status

Before making any configuration changes, it's essential to understand your current IPv6 connectivity status.

Method 1: Using System Settings (GUI)

The simplest way to check IPv6 configuration:

  1. Open System Settings (macOS Ventura and later) or System Preferences (earlier versions)
  2. Click on Network in the sidebar
  3. Select your active network connection (Wi-Fi or Ethernet)
  4. Click the Details button
  5. Navigate to the TCP/IP tab

You'll see your IPv6 configuration method and current address(es):

Method 2: Using Terminal Commands

For more detailed information, open Terminal (Applications > Utilities > Terminal) and use these commands:

Check all network interfaces and their IPv6 addresses:

ifconfig | grep inet6

This displays all IPv6 addresses assigned to your Mac, including:

Check IPv6 routing table:

netstat -rn -f inet6

Look for entries starting with "default" - this shows your IPv6 default gateway. You should see at least one route via a known interface like "en0" (Ethernet) or "en1" (Wi-Fi).

Test IPv6 connectivity to Google's public DNS:

ping6 2001:4860:4860::8888

If you receive replies, your IPv6 connectivity is working correctly. Press Control+C to stop the ping.

Check your public IPv6 address:

curl -6 https://api6.ipify.org

This queries an IPv6-only API endpoint and returns your public IPv6 address (if you have one).

Method 3: Using Online Testing Tools

Visit test-ipv6.run in your web browser. This comprehensive testing tool will:

The test runs entirely in your browser and provides a detailed readiness score along with diagnostic information.

Configuring IPv6 Through System Settings

For most users, automatic configuration provides the best experience:

  1. Open System Settings > Network
  2. Select your network connection (Wi-Fi or Ethernet)
  3. Click Details
  4. Go to the TCP/IP tab
  5. Set Configure IPv6 to Automatically
  6. Click OK, then Apply

With automatic configuration, macOS will:

If you want IPv6 enabled only for local network communication without internet connectivity:

  1. Navigate to System Settings > Network > Details > TCP/IP
  2. Set Configure IPv6 to Link-local only
  3. Click OK, then Apply

This configuration assigns only link-local addresses (fe80::/10), useful for:

Manual IPv6 Configuration

Network administrators may need to assign static IPv6 addresses. You'll need the following information from your network administrator or ISP:

To configure manually:

  1. Open System Settings > Network
  2. Select your network interface
  3. Click Details
  4. Navigate to the TCP/IP tab
  5. Set Configure IPv6 to Manually
  6. Enter your IPv6 Address
  7. Enter the Router address (default gateway)
  8. Enter the Prefix Length (usually 64)
  9. Click OK, then Apply

Important considerations for manual configuration:

Configuring IPv6 DNS Servers

DNS configuration is separate from address configuration:

  1. In System Settings > Network > Details
  2. Navigate to the DNS tab
  3. Click the + button under DNS Servers
  4. Add IPv6 DNS servers (examples below)

Popular public IPv6 DNS servers:

You can mix IPv4 and IPv6 DNS servers - macOS will query whichever is appropriate based on connectivity.

Disabling IPv6

While generally not recommended, you may need to disable IPv6 for troubleshooting or compatibility:

  1. Open System Settings > Network > Details > TCP/IP
  2. Set Configure IPv6 to Off
  3. Click OK, then Apply

Warning: Disabling IPv6 can cause issues with:

Command-Line Configuration with networksetup

For automation, scripting, or remote administration, the networksetup command provides complete control over IPv6 configuration.

Listing Available Network Services

First, identify the exact name of your network service:

networksetup -listallnetworkservices

Common service names include:

Note: Service names are case-sensitive and may contain spaces. Use quotes when spaces are present.

Viewing Current IPv6 Configuration

Check the current IPv6 configuration for a specific service:

networksetup -getinfo "Wi-Fi"

This displays both IPv4 and IPv6 configuration details.

Setting IPv6 to Automatic

Enable automatic IPv6 configuration via SLAAC:

sudo networksetup -setv6automatic "Wi-Fi"

Replace "Wi-Fi" with your network service name. The sudo command requires administrator privileges and will prompt for your password.

Configure link-local addressing only:

sudo networksetup -setv6LinkLocal "Wi-Fi"

Configuring Manual IPv6 Address

Set a static IPv6 address with prefix length and gateway:

sudo networksetup -setv6manual "Wi-Fi" 2001:db8:1234:5678::10 64 2001:db8:1234:5678::1

The syntax is:

networksetup -setv6manual <service> <address> <prefixlength> <router>

Disabling IPv6

Turn off IPv6 completely:

sudo networksetup -setv6off "Wi-Fi"

Configuring IPv6 DNS Servers

Set IPv6 DNS servers from the command line:

sudo networksetup -setdnsservers "Wi-Fi" 2001:4860:4860::8888 2001:4860:4860::8844

To revert to automatic DNS from DHCP/RA:

sudo networksetup -setdnsservers "Wi-Fi" empty

Example: Complete Script for Dual-Stack Configuration

Here's a complete script to configure both IPv4 and IPv6:

#!/bin/bash

SERVICE="Wi-Fi"

# Configure IPv4 (DHCP)
sudo networksetup -setdhcp "$SERVICE"

# Configure IPv6 (Automatic)
sudo networksetup -setv6automatic "$SERVICE"

# Set DNS servers (both IPv4 and IPv6)
sudo networksetup -setdnsservers "$SERVICE" \
    2001:4860:4860::8888 \
    2001:4860:4860::8844 \
    8.8.8.8 \
    8.8.4.4

echo "Network configuration complete for $SERVICE"
networksetup -getinfo "$SERVICE"

Troubleshooting Common IPv6 Issues on macOS

Issue 1: IPv6 Configured But No Connectivity ("Broken IPv6")

Symptoms: IPv6 address is assigned, but connections timeout or fail.

Diagnosis:

# Check if you have a global address
ifconfig | grep inet6 | grep -v fe80

# Test connectivity to known IPv6 servers
ping6 -c 4 2001:4860:4860::8888

# Check routing table
netstat -rn -f inet6 | grep default

Solutions:

  1. Disable and re-enable IPv6:

    sudo networksetup -setv6off "Wi-Fi"
    sleep 5
    sudo networksetup -setv6automatic "Wi-Fi"
    
  2. Check your router configuration: Your router may advertise IPv6 but lack proper upstream connectivity (router setup)

  3. Verify ISP support: Contact your ISP to confirm IPv6 is properly provisioned (test ISP support)

  4. Temporarily disable IPv6: If broken IPv6 is causing issues, disable it until you can fix the underlying problem (troubleshoot broken IPv6):

    sudo networksetup -setv6off "Wi-Fi"
    

Issue 2: IPv6 Works But IPv4 Doesn't

Symptoms: Can ping6 but not ping, or only IPv6 sites load.

Diagnosis:

# Test IPv4 connectivity
ping -c 4 8.8.8.8

# Check IPv4 address assignment
ifconfig | grep "inet " | grep -v 127.0.0.1

# Check IPv4 routing
netstat -rn -f inet | grep default

Solutions:

  1. Renew DHCP lease:

    sudo ipconfig set en0 DHCP
    

    (Replace en0 with your interface - check with ifconfig)

  2. Reset network preferences: This is a more aggressive fix. First, back up your configuration files:

    cd /Library/Preferences/SystemConfiguration
    sudo mkdir ~/network-backup
    sudo cp com.apple.airport.preferences.plist ~/network-backup/
    sudo cp com.apple.network.identification.plist ~/network-backup/
    sudo cp NetworkInterfaces.plist ~/network-backup/
    sudo cp preferences.plist ~/network-backup/
    

    Then restart to rebuild network configuration (macOS will recreate these files).

Issue 3: Slow IPv6 Performance or High Latency

Symptoms: IPv6 works but is noticeably slower than IPv4.

Diagnosis:

Test latency to the same server using both protocols:

# IPv4
ping -c 10 8.8.8.8

# IPv6
ping6 -c 10 2001:4860:4860::8888

Or use test-ipv6.run to compare latency automatically.

Solutions:

  1. Check for Path MTU issues: IPv6 requires a minimum MTU of 1280 bytes. Fragmentation issues can cause performance problems:

    # Test with different packet sizes
    ping6 -c 4 -s 1232 2001:4860:4860::8888
    
  2. Verify your router/gateway isn't underpowered: Some older routers struggle with IPv6 processing

  3. Check for ICMPv6 filtering: Some networks or ISPs incorrectly filter ICMPv6 messages, breaking Path MTU Discovery. Contact your ISP if you suspect this.

Issue 4: Privacy Addresses Not Working

Symptoms: IPv6 address doesn't change over time (privacy concern).

Diagnosis:

# Check for temporary addresses
ifconfig en0 | grep "secured"

You should see addresses marked as "temporary" or "secured" in addition to stable addresses.

Solution:

Privacy addresses (RFC 4941 temporary addresses) should be enabled automatically. If not working, try:

# Reset IPv6 configuration
sudo networksetup -setv6off "Wi-Fi"
sudo networksetup -setv6automatic "Wi-Fi"

Privacy addresses only work with automatic (SLAAC) configuration, not manual addresses.

Issue 5: Cannot Access IPv6 Address While Other Devices Can

Symptoms: Other devices on the same network have working IPv6, but your Mac doesn't.

Diagnosis:

# Check neighbor discovery cache
ndp -an

# Check if router advertisements are being received
sudo tcpdump -i en0 -n icmp6

Solutions:

  1. Flush neighbor discovery cache:

    sudo ndp -c
    
  2. Restart the network interface:

    sudo ifconfig en0 down
    sudo ifconfig en0 up
    

    (Replace en0 with your interface)

  3. Check firewall settings: macOS firewall or third-party security software may block ICMPv6, which is essential for IPv6 functionality:

    • Go to System Settings > Network > Firewall
    • Ensure ICMPv6 is not blocked
    • Consider temporarily disabling the firewall to test

Issue 6: Duplicate Address Detection Fails

Symptoms: IPv6 address shows as "duplicated" in ifconfig output.

Diagnosis:

ifconfig | grep duplicated

Solution:

This rare issue occurs when another device on the network has the same IPv6 address:

  1. For automatic configuration: Restart the interface to trigger new address generation:

    sudo ifconfig en0 down
    sudo ifconfig en0 up
    
  2. For manual configuration: Change your static IPv6 address to a different value in the subnet

  3. Investigate the conflict: Use ndp -an to find the MAC address of the conflicting device

Advanced: Understanding macOS IPv6 Address Selection

macOS typically configures multiple IPv6 addresses simultaneously:

  1. Link-local address (fe80::/10): Always present when IPv6 is enabled, used for local network communication (link-local details)
  2. Global unicast address (stable): Based on interface identifier, doesn't change often, used for incoming connections
  3. Temporary addresses (privacy): Changes periodically (daily by default), used for outgoing connections to protect privacy (address privacy)
  4. Unique Local Address (fd00::/8): If your router advertises a ULA prefix (ULA explained)

You can view all addresses with:

ifconfig en0 | grep inet6

macOS follows RFC 6724 rules for source address selection, generally preferring:

Testing Your Configuration

After making configuration changes, verify everything works:

  1. Check address assignment:

    ifconfig | grep inet6
    
  2. Verify routing:

    netstat -rn -f inet6 | grep default
    
  3. Test local connectivity:

    ping6 -c 4 ff02::1%en0
    

    (This pings all IPv6 devices on your local network)

  4. Test internet connectivity:

    ping6 -c 4 2001:4860:4860::8888
    
  5. Verify DNS resolution:

    nslookup -type=AAAA google.com
    
  6. Use comprehensive testing: Visit test-ipv6.run to run a complete suite of connectivity tests and receive a readiness score (test explained)

Key Takeaways

  1. IPv6 is enabled by default on all modern macOS versions - most users don't need to change anything

  2. Automatic configuration is best for most scenarios - SLAAC handles address assignment, routing, and DNS automatically

  3. System Settings provides easy GUI access to IPv6 configuration for basic setup and troubleshooting

  4. networksetup command offers powerful scripting capabilities for automation and remote administration

  5. Multiple addresses are normal - macOS typically assigns link-local, stable global, and temporary privacy addresses simultaneously

  6. Broken IPv6 is worse than no IPv6 - if IPv6 is configured but not working, it causes timeouts and delays. Disable it until you can fix the underlying issue.

  7. Test thoroughly - use command-line tools and web-based testing like test-ipv6.run to verify proper functionality

  8. ICMPv6 is essential - never block ICMPv6 in firewalls, as it's required for Neighbor Discovery, Path MTU Discovery, and basic IPv6 functionality

  9. Privacy addresses protect you - temporary addresses that change periodically help prevent tracking across different websites

  10. Documentation and testing matter - understanding your IPv6 configuration helps diagnose issues quickly and ensures optimal performance

Whether you're setting up IPv6 for the first time, configuring static addresses for servers, or troubleshooting connectivity issues, macOS provides flexible tools through both graphical and command-line interfaces. The automatic configuration works well for most users, while advanced features support complex network deployments and custom requirements.