Updated: 17 October 2026 · Applies to: RHEL, AlmaLinux and Rocky Linux 9 and 10 (NetworkManager 1.54 on AlmaLinux 9.8, 1.56 on AlmaLinux 10.2); tested with NetworkManager 1.52 and a Linux 6.12 kernel in a lab; sysctl on any distribution
To disable IPv6 on RHEL, AlmaLinux or Rocky Linux, switch it off per connection with NetworkManager:
nmcli connection modify "CONNECTION" ipv6.method disabled nmcli connection up "CONNECTION"
This is the method Red Hat documents. It is saved with the connection, survives reboots and leaves IPv6 working on your other interfaces and on the loopback address ::1. To remove IPv6 from the whole system instead, add ipv6.disable=1 to the kernel command line and reboot (section 2).
CentOS 7 and CentOS Linux 8 are end of life and get no more updates; move such servers to AlmaLinux or Rocky Linux.
1. Disable IPv6 on one interface (NetworkManager)
- Find the connection name of the interface:
nmcli -f NAME,DEVICE connection show
Lab output with two interfaces. The connection name can differ from the device name, for exampleSystem eth0; put it in quotes if it contains a space.NAME DEVICE lan eth1 wan eth0
- Disable IPv6 for that connection and activate it again. This briefly interrupts traffic on that interface, so do not run it on the interface you are connected through unless you have a console:
nmcli connection modify lan ipv6.method disabled nmcli connection up lan
- Check the result:
ip -6 -br addr cat /proc/sys/net/ipv6/conf/eth1/disable_ipv6
In our lab,eth1lost itsfe80::address whileeth0andlokept theirs, anddisable_ipv6was1foreth1only:lo UNKNOWN ::1/128 eth0 UNKNOWN fe80::ed1a:539c:e405:651/64
The setting is stored in the connection profile (/etc/NetworkManager/system-connections/lan.nmconnection shows method=disabled under [ipv6]), and nmcli -g ipv6.method connection show lan prints disabled. When we restarted NetworkManager and the interface was created again, IPv6 stayed off. To turn IPv6 back on, set ipv6.method auto and run nmcli connection up again.
2. Disable IPv6 on the whole system (kernel parameter)
- Add the parameter to every installed kernel with grubby, as Red Hat describes for kernel parameters:
grubby --update-kernel=ALL --args="ipv6.disable=1"
- Reboot, then check:
cat /proc/cmdline ls /proc/sys/net/ipv6
Withipv6.disable=1, our lab kernel had no/proc/sys/net/ipv6at all (No such file or directory), no interface had an IPv6 address, and programs could not even open an IPv6 socket:OSError: [Errno 97] Address family not supported by protocol. The kernel documentation describes the same: no IPv6 addresses and no IPv6 sockets, and a reboot is needed to enable IPv6 again. - Also set
ipv6.method disabledon your NetworkManager connections (section 1), so the connection profiles match the kernel. Red Hat has a knowledgebase article about NetworkManager IPv6 warnings when IPv6 is disabled only in the kernel. - To undo it:
grubby --update-kernel=ALL --remove-args="ipv6.disable=1"and reboot.
More about grubby in how to modify kernel arguments with grubby.
3. The sysctl method (any distribution)
Without NetworkManager, or on other distributions, switch IPv6 off for one interface in the kernel:
echo "net.ipv6.conf.eth1.disable_ipv6 = 1" > /etc/sysctl.d/90-no-ipv6-eth1.conf sysctl --system
sysctl --system printed * Applying /etc/sysctl.d/90-no-ipv6-eth1.conf ... and the addresses of eth1 disappeared at once. Things we saw in the lab that matter:
- The setting survives the interface going down and up, but not the interface being deleted and created again (a VLAN, bridge or VPN interface, for example): it was back to
0. The NetworkManager method does not have this problem. net.ipv6.conf.default.disable_ipv6 = 1only affects interfaces created afterwards; existing ones kept IPv6.net.ipv6.conf.all.disable_ipv6 = 1switched IPv6 off everywhere, including the loopback interface:::1disappeared, and a program binding to::1failed with[Errno 99] Cannot assign requested address. Services configured to listen on::1can then fail to start, so prefer the per-interface methods.
On Ubuntu, see how to disable IPv6 on Ubuntu Linux.
Things to check afterwards
- Use the interface and connection names your server shows (
ip -br link,nmcli connection show); names such aseno1orenp3s0are common on physical servers. - If a service still tries to use IPv6, check its own settings, for example
ListenAddressandAddressFamilyin SSH or thelistenlines in Nginx. - If you change the interface you connect through and lose access, use the VNC console of your Ucartz VPS (see how to access your VPS via VNC) or the IPMI console of a dedicated server to undo the change.
Official documentation: Red Hat: using NetworkManager to disable IPv6 for a specific connection, NetworkManager ipv6 settings and kernel IPv6 options.