So, what I’m looking to do is to disable IPv6 while doing apt update, apt upgrade, snap refresh, snap find, snap install, etc., but re-enable it afterwards.
This works, but only intermittently. Sometimes, it enables IPv6, and other times, it doesn’t. In the latter case, I have to reboot my machine to restore IPv6, which is hardly ideal.
What I think that I need
I think that I need a command that will tell the internet connection to refresh or restart or something like that after re-enabling IPv6.
I’ve been hunting around on the 'net, and I haven’t been able to find an answer to my needs.
Instead of disabling ipv6 at the kernel level, you can do it in NetworkManager.
There is a GUI for this setting: in the connection settings, IPv6 Settings tab > Method drop-down. Alternatively, you can change this setting by running the following command in Terminal:
Or on 'NMCLI’Display the list of network connections:
nmcli connection show
This command will list all network connections, including their UUID, type, and device name.
Set the ipv6.method parameter of the connection to disabled:
nmcli connection modify ipv6.method "disabled"
Replace with the name of the connection you want to modify.
Restart the network connection to apply the changes: nmcli connection down ; nmcli connection up
This will bring down the connection and then bring it back up, applying the new IPv6 settings.
To re-enable IPv6, you can follow a similar process by setting the ipv6.method parameter back to a non-disabled value, such as auto or linklocal:
Thank you. I need the command line to do this, not the GUI, so that I can script it.
If I have a wireless connection, the actual internet connection isn’t the SSID of the wireless, is it? (I tried using that with your command. There was no error message, but it didn’t work.)
I don’t know how to find out the name of the actual internet connection, unfortunately. Do you know how I can do that?