For the past several days, I faced a strange issue in my system running Ubuntu Linux. I use Firefox and Brave browsers. Everything was normal in Firefox but Brave keeps on detecting a network change on almost every refresh.
This went on to the extent that it became impossible to use the browser. I could not use Feedly to browse feeds from my favorite websites, every search result ends in multiple refresh, websites needed to be refreshed multiple times as well.
As an alternative, I tried installing Chrome on Ubuntu. The problem remained the same. I installed Microsoft Edge on Linux and yet, the problem persisted there as well. Basically, any Chromium-based browser keep encountering the ERR_NETWORK_CHANGED error.
Luckily, I found a way to fix the issue. I am going to share the steps with you so that it helps you if you are also facing the same problem.
Fixing frequent network change detection issues in Chromium based browsers
The trick that worked for me was to disable IPv6 in the network settings. Now, I am not sure why this happens but I know that IPv6 is known to create network problems in many systems. If your system, router and other devices use IPv6 instead of the good old IPv4, you may encounter network connection issues like the one I encountered.
Thankfully, it is not that difficult to disable IPv6 in Ubuntu. There are several ways to do that and I am going to share the easiest method perhaps. This method uses GRUB to disable IPv6.
Step 1: Open GRUB config file for editing
Open the terminal. Now use the following command to edit the GRUB config file in Nano editor. You’ll have to enter your account’s password.
sudo nano /etc/default/grub
I hope you know a little bit about using Nano editor. Use the arrow keys to go to the line starting with GRUB_CMDLINE_LINUX. Make its value look like this:
Be careful of the inverted commas and spaces. Don’t touch other lines.
Save your changes by using the Ctrl+x keys. It will ask you to confirm the changes. Press Y or enter when asked.
Step 2: Update grub
You have made changes to the GRUB bootloader configuration. These changes won’t be taken into account until you update grub. Use the command below for that:
Now when you restart your system, IPv6 will be disabled for your networks. You should not encounter the network interruption issue anymore.
You may think why I didn’t mention disabling IPv6 from the network settings. It’s because Ubuntu uses Netplan to manage network configuration these days and it seems that changes in Network Manager are not fully taken into account by Netplan. I tried it but despite IPv6 being disabled in the Network Manager, the problem didn’t go away until I used the command line method.
Even after so many years, IPv6 support has not matured and it keeps causing trouble. Disabling IPv6 sometimes improve WiFi speed in Linux. Weird, I know.
Anyway, I hope this trick helps you with the network change detection issue in your system as well.