Solution:
Root Cause: Active Kernel IPv6 Binding & NetworkManager Auto-Rebinding
Disabling IPv6 on Linux requires persistent sysctl kernel parameters; otherwise, NetworkManager or systemd-networkd will auto-rebind IPv6 addresses upon interface initialization or DHCP renewal.
Step-by-Step Fix:
1.Modify Sysctl Configuration File:
Open /etc/sysctl.conf or create /etc/sysctl.d/99-disable-ipv6.conf in a text editor: bash
sudo nano /etc/sysctl.d/99-disable-ipv6.conf
Add the following configuration lines: ini
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
2.Apply Sysctl Settings Instantly:
Reload sysctl settings into the active kernel: bash
sudo sysctl -p /etc/sysctl.d/99-disable-ipv6.conf
3.Disable IPv6 in NetworkManager (If Installed):
Run the nmcli command to set IPv6 method to ignore: bash
sudo nmcli connection modify "eth0" ipv6.method ignore
sudo nmcli connection up "eth0"
4.Verify Disablement:
Verify that no IPv6 address is listed by running ip a | grep inet6.