NetworkManager IPv6 Configuration Issue: A Troubleshooting Guide
Hey guys! Ever run into that frustrating issue where NetworkManager just won't configure your global IPv6 address, even though it's clearly getting the prefix through Router Advertisement? Yeah, it's a head-scratcher. Especially when you're rocking Ubuntu 25.10 and the latest network-manager (1.52.0-1ubuntu3). Let's dive deep into troubleshooting this IPv6 conundrum. We'll explore common pitfalls, configuration tweaks, and debugging steps to get your network purring like a kitten. So, buckle up, and let's get those IPv6 addresses flowing!
Understanding the IPv6 Setup
Before we dive into the nitty-gritty, let's ensure we're all on the same page about IPv6 addressing and how NetworkManager is supposed to handle it. IPv6, the successor to IPv4, brings a vastly larger address space and several improvements to network configuration. One key aspect is stateless address autoconfiguration (SLAAC), where devices automatically configure themselves using Router Advertisements (RAs) sent by the router. These RAs contain the network prefix, and the device combines this with its interface identifier to create a global IPv6 address.
NetworkManager, being the friendly network management tool it is, should listen for these RAs and configure the IPv6 address accordingly. But what happens when it doesn't? That's the million-dollar question we're here to answer. When NetworkManager fails to configure the global IPv6 address despite receiving the prefix through Router Advertisements, it indicates a potential misconfiguration or conflict within the system's networking components. The expected behavior is that NetworkManager should automatically detect the IPv6 prefix advertised by the router and use it to configure a global IPv6 address for the network interface. This involves combining the prefix with a unique interface identifier (often derived from the MAC address) to form a complete IPv6 address. This automatic configuration is a cornerstone of IPv6's plug-and-play functionality, and issues with this process can stem from various sources. Misconfigurations in NetworkManager itself, conflicts with other networking services, or even problems with the system's IPv6 stack can disrupt this process. Properly diagnosing and resolving this issue involves systematically checking each of these potential problem areas to identify the root cause and implement the appropriate fix. Understanding the expected IPv6 setup and NetworkManager's role in it is crucial for effectively troubleshooting any deviations from this norm.
Common Culprits and Solutions
Okay, so your IPv6 isn't playing ball. Let's look at some of the usual suspects and how to tackle them. We'll break it down into easy-to-follow steps, so you can systematically rule out potential issues.
1. Systemd-networkd Interference
This is a big one! If you've got systemd-networkd lurking in the background, it might be wrestling with NetworkManager for control of your network interfaces. This can lead to conflicts and prevent NetworkManager from doing its IPv6 magic.
Solution: You mentioned you've stopped, disabled, and masked systemd-networkd, which is excellent! But let's double-check. Run these commands in your terminal:
sudo systemctl stop systemd-networkd
sudo systemctl disable systemd-networkd
sudo systemctl mask systemd-networkd
The masking command is key here – it prevents systemd-networkd from being started by other services. After running these, give your system a reboot for good measure.
2. Netplan Configuration
Netplan is Ubuntu's network configuration tool, and it can sometimes cause hiccups if it's not set up correctly to use NetworkManager. The renderer setting in your Netplan configuration files tells the system which backend to use for network management.
Solution: You've already set the renderer to NetworkManager in /etc/netplan, which is the right move. However, let's peek at your Netplan configuration file (usually named something like 01-network-manager-all.yaml or 50-cloud-init.yaml) to ensure there are no conflicting settings. Open it with your favorite text editor (using sudo, of course):
sudo nano /etc/netplan/YOUR_NETPLAN_FILE.yaml
Look for lines that might be explicitly configuring IPv6 addresses or routes. If you find any, comment them out (add a # at the beginning of the line) or remove them. The goal is to let NetworkManager handle IPv6 configuration.
Also, verify that the Netplan configuration file is correctly formatted and doesn't contain any syntax errors. Even a small typo can prevent Netplan from properly configuring the network interfaces, leading to issues with IPv6 address assignment. Ensure that the YAML syntax is valid, with correct indentation and proper formatting of key-value pairs. Tools like online YAML validators can help identify and correct syntax errors. By validating the Netplan configuration, you can ensure that it correctly instructs the system to use NetworkManager for network management and doesn't inadvertently interfere with IPv6 address assignment. It's a crucial step in troubleshooting network issues, as it eliminates a common source of misconfiguration.
After making changes, apply the Netplan configuration:
sudo netplan apply
If you encounter errors, Netplan will let you know, helping you pinpoint any syntax issues.
3. NetworkManager Configuration Files
NetworkManager itself has configuration files that might be influencing its IPv6 behavior. Let's delve into those.
Solution: The main configuration file we're interested in is /etc/NetworkManager/NetworkManager.conf. Open it up:
sudo nano /etc/NetworkManager/NetworkManager.conf
Look for a section like [main]. You might find a line that says plugins=ifupdown,keyfile. Ensure that ifupdown is either removed or commented out. The ifupdown plugin can sometimes interfere with NetworkManager's operation, especially with IPv6.
Next, let's check the connection-specific settings. NetworkManager stores connection profiles in /etc/NetworkManager/system-connections/. Each file in this directory represents a network connection. Find the file corresponding to your active connection (you can usually tell by the name) and open it.
Look for an [ipv6] section. Key settings to check include:
addr-gen-mode: This should ideally be set toeui64for SLAAC (Stateless Address Autoconfiguration) orstable-privacyfor privacy extensions.method: This should be set toautofor automatic IPv6 configuration.ignore-auto-dns: Make sure this is not set totrue, as it would prevent NetworkManager from using the DNS servers advertised via Router Advertisements.
Ensuring the correct configuration settings within these connection profiles is crucial for proper IPv6 operation. Incorrect settings can override NetworkManager's default behavior and prevent it from acquiring IPv6 addresses. Carefully reviewing the [ipv6] section and adjusting settings as needed can resolve many common IPv6 configuration issues. For example, setting the addr-gen-mode incorrectly might prevent the interface from generating a valid IPv6 address, while an incorrect method setting might disable automatic configuration altogether. By verifying and correcting these settings, you can ensure that NetworkManager is properly configured to handle IPv6 address acquisition and assignment.
4. IPv6 is Disabled on the Interface
It might sound obvious, but it's worth checking that IPv6 is actually enabled on your network interface.
Solution: Use the ip addr command to list your network interfaces and their addresses:
ip addr
Look for your active interface (e.g., eth0, wlan0). If you don't see any IPv6 addresses (addresses starting with 2001:, 2002:, or fd), it might be disabled. You can also check for the inet6 keyword in the interface's details.
If IPv6 is disabled, you can enable it temporarily using the ip command:
sudo ip -6 link set dev YOUR_INTERFACE up
Replace YOUR_INTERFACE with your actual interface name. To make this change permanent, you'll need to modify your Netplan configuration file or NetworkManager connection settings.
5. Router Advertisements are Not Being Received
If your system isn't receiving Router Advertisements, it won't be able to configure an IPv6 address using SLAAC. This could be due to a problem with your router or with the network interface on your machine.
Solution: Use the tcpdump command to listen for Router Advertisements on your network interface:
sudo tcpdump -i YOUR_INTERFACE -n ip6[40] > 134
Replace YOUR_INTERFACE with your interface name. This command captures IPv6 packets with a type of 134 (Router Advertisement). If you see output, it means you're receiving RAs. If you don't see any output after a few minutes, there's likely an issue with your router or network connectivity. Make sure IPv6 is enabled on your router and that it's configured to send RAs.
If the tcpdump command reveals that Router Advertisements are not being received, it's crucial to investigate potential issues with the network infrastructure. This might involve checking the router's configuration to ensure that IPv6 is enabled and that Router Advertisements are being sent on the appropriate interface. Additionally, verify that there are no firewall rules or other network devices blocking the transmission of RAs. In some cases, the issue might stem from the network interface itself, where hardware or driver problems could prevent the reception of IPv6 packets. Checking the interface's status, updating drivers, or even testing with a different network interface can help isolate the problem. It's important to systematically rule out each potential cause to identify the root of the problem and implement the necessary corrective actions. Confirming the proper reception of Router Advertisements is a fundamental step in ensuring successful IPv6 address configuration.
6. Firewall Issues
A misconfigured firewall can block IPv6 traffic, preventing NetworkManager from receiving Router Advertisements or communicating with the network.
Solution: Check your firewall rules to ensure that IPv6 traffic is allowed. If you're using ufw (Uncomplicated Firewall), you can check the status with:
sudo ufw status
Make sure that IPv6 is enabled in ufw's configuration. You can do this by editing the /etc/default/ufw file and ensuring that IPV6=yes.
If you're using iptables, you'll need to examine your IPv6 firewall rules (using ip6tables -L) and ensure that they're not blocking necessary traffic.
7. NetworkManager Bugs (Rare, But Possible)
While less common, there's always a chance that you've stumbled upon a bug in NetworkManager itself. Given you're using a relatively recent version (1.52.0), it's less likely, but not impossible.
Solution: Check the NetworkManager bug tracker (usually on your distribution's bug tracking system) to see if anyone else has reported a similar issue. If you find a bug report, you might find a workaround or patch. If not, consider filing a bug report yourself, providing as much detail as possible about your configuration and the issue you're experiencing.
Digging Deeper: Debugging Techniques
If none of the above solutions work, it's time to put on your detective hat and start digging deeper. Here are some techniques for debugging NetworkManager and IPv6 issues:
1. NetworkManager Logging
NetworkManager can be quite verbose when it comes to logging. Enabling debug logging can provide valuable clues about what's going on behind the scenes.
Solution: Edit the /etc/NetworkManager/NetworkManager.conf file and add or modify the [logging] section to look like this:
[logging]
domain=DEBUG
level=DEBUG
Then, restart NetworkManager:
sudo systemctl restart NetworkManager
Now, NetworkManager will log a lot more information. You can view the logs using journalctl:
journalctl -u NetworkManager -f
Look for error messages or anything that seems out of the ordinary. Pay close attention to messages related to IPv6, Router Advertisements, and address configuration.
2. NetworkManager CLI (nmcli)
The nmcli command-line tool is your friend for querying and manipulating NetworkManager. It can give you insights into connection status, device configuration, and more.
Solution: Use nmcli to check the status of your network connections:
nmcli connection show
This will list your network connections and their UUIDs. Then, you can get detailed information about a specific connection:
nmcli connection show YOUR_CONNECTION_UUID
Replace YOUR_CONNECTION_UUID with the UUID of your connection. Look for information about IPv6 configuration, addresses, and routes.
You can also use nmcli to bring interfaces up or down, modify connection settings, and more. Check the nmcli man page (man nmcli) for a full list of options.
3. Wireshark
If you're comfortable with network packet analysis, Wireshark can be an invaluable tool for debugging IPv6 issues. It allows you to capture and examine network traffic, including Router Advertisements, Neighbor Solicitations, and other IPv6-related packets.
Solution: Install Wireshark if you don't have it already:
sudo apt install wireshark
Run Wireshark and select your network interface. Then, set a capture filter to only capture IPv6 traffic:
ipv6
Start the capture and observe the traffic. Look for Router Advertisements coming from your router. If you're not seeing them, it confirms the issue we discussed earlier. If you are seeing them, examine the contents of the RAs to ensure they contain the correct prefix and other information.
Wireshark can also help you diagnose other IPv6-related issues, such as Neighbor Discovery problems or DNS resolution failures.
4. Simplify the Setup
Sometimes, the best way to find a problem is to simplify the setup and eliminate potential sources of interference.
Solution: Try connecting your machine directly to your router using an Ethernet cable, bypassing any switches or other network devices. This will help rule out issues with your network infrastructure. Also, try temporarily disabling any non-essential network services or applications that might be interfering with NetworkManager.
Real-World Scenarios and Examples
Let's walk through a couple of real-world scenarios where this IPv6 issue might pop up, and how you'd approach them using the techniques we've discussed.
Scenario 1: Home Network with a New Router
You've just upgraded your home router to a shiny new model that supports IPv6. You excitedly plug everything in, but your Ubuntu 25.10 machine refuses to get an IPv6 address. You've already confirmed that systemd-networkd is disabled and Netplan is set to use NetworkManager.
Troubleshooting Steps:
- Check Router Advertisements: Use
tcpdumpto see if your machine is receiving RAs from the new router. If not, log into your router's web interface and ensure that IPv6 is enabled and RAs are being sent. Some routers might have separate settings for IPv6 LAN and WAN interfaces, so make sure both are configured correctly. - Firewall: Double-check your firewall rules to ensure that IPv6 traffic isn't being blocked. If you're using
ufw, make sureIPV6=yesin/etc/default/ufwand that you don't have any restrictive IPv6 rules. - NetworkManager Logs: Enable NetworkManager debug logging and examine the logs for any clues. Look for error messages related to Router Advertisements or address configuration.
- Connection Profile: Review your NetworkManager connection profile to ensure that IPv6 is set to
autoand thataddr-gen-modeis set toeui64orstable-privacy.
Scenario 2: Virtual Machine with Bridged Networking
You're running Ubuntu 25.10 in a virtual machine using bridged networking. The VM should be getting an IPv6 address from your host network, but it's not.
Troubleshooting Steps:
- Host Network: First, ensure that your host machine is getting an IPv6 address and that IPv6 is working correctly on the host network. If the host doesn't have IPv6 connectivity, the VM won't either.
- VM Network Configuration: Check the VM's network configuration to ensure that it's set to use bridged networking and that the correct physical interface is selected. In VirtualBox, for example, you can find these settings in the VM's settings under "Network."
- tcpdump on Host and VM: Use
tcpdumpon both the host and the VM to see if Router Advertisements are being sent and received. If the host is receiving RAs but the VM isn't, there might be an issue with the virtual network configuration or the VM's firewall. - NetworkManager in VM: Follow the same NetworkManager troubleshooting steps as in Scenario 1, checking logs, connection profiles, and firewall settings.
Preventing Future Headaches
Once you've wrestled this IPv6 issue into submission, you'll want to avoid a repeat performance. Here are some tips for preventing future headaches:
- Keep your system updated: Regularly update your system packages, including NetworkManager, to get the latest bug fixes and improvements.
- Use a consistent network configuration: Stick to using either NetworkManager or systemd-networkd, but not both. If you switch between them, make sure to properly disable and mask the one you're not using.
- Document your configuration: Keep a record of your network configuration settings, including Netplan files and NetworkManager connection profiles. This will make it easier to troubleshoot issues in the future.
- Test after changes: After making changes to your network configuration, always test your IPv6 connectivity to ensure that everything is working as expected.
Conclusion
Troubleshooting NetworkManager IPv6 issues can be a bit of a journey, but with a systematic approach and the right tools, you can conquer even the most stubborn problems. Remember to check for common culprits like systemd-networkd interference and Netplan misconfigurations, and don't be afraid to dive into the logs and packet captures. By following the steps and techniques we've discussed, you'll be well-equipped to keep your IPv6 network humming. Now go forth and conquer those IPv6 challenges!