EL9 - System

How to disable ipv6

Taken from: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/using-networkmanager-to-disable-ipv6-for-a-specific-connection_configuring-and-managing-networking#using-networkmanager-to-disable-ipv6-for-a-specific-connection_configuring-and-managing-networking

1. on RHEL9 disabling ipv6 with sysctl method doesn't work after reboot, because NetworkManager overrides with its own configuration

2. one should not change NetworkManager conf files directly, because the resulting configuration might be invalid (e.g. network interfaces didn't come up after reboot, because ipv6 method was set to disabled, but ipv6.dns option was present), but rather use nmcli utility

# nmcli connection modify eno1 ipv6.method "disabled" ipv6.dns ""
# nmcli connection up eno1

//verify the change is correct:
# ip addr

# reboot