Chapter 17. Using NetworkManager to disable IPv6 for a specific connection
On a system that uses NetworkManager to manage network interfaces, you can disable the IPv6 protocol if the network only uses IPv4. If you disable IPv6, NetworkManager automatically sets the corresponding sysctl values in the Kernel.
If disabling IPv6 using kernel tunables or kernel boot parameters, additional consideration must be given to system configuration. For more information, see the Red Hat Knowledgebase solution How do I disable or enable the IPv6 protocol in RHEL.
17.1. Disabling IPv6 on a connection using nmcli Copy linkLink copied to clipboard!
You can use the nmcli utility to disable the IPv6 protocol on the command line.
Prerequisites
- The system uses NetworkManager to manage network interfaces.
Procedure
Optional: Display the list of network connections:
nmcli connection show
# nmcli connection show NAME UUID TYPE DEVICE Example 7a7e0151-9c18-4e6f-89ee-65bb2d64d365 ethernet enp1s0 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
ipv6.methodparameter of the connection todisabled:nmcli connection modify Example ipv6.method "disabled"
# nmcli connection modify Example ipv6.method "disabled"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the network connection:
nmcli connection up Example
# nmcli connection up ExampleCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the IP settings of the device:
ip address show enp1s0
# ip address show enp1s0 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:6b:74:be brd ff:ff:ff:ff:ff:ff inet 192.0.2.1/24 brd 192.10.2.255 scope global noprefixroute enp1s0 valid_lft forever preferred_lft foreverCopy to Clipboard Copied! Toggle word wrap Toggle overflow If no
inet6entry is displayed,IPv6is disabled on the device.Verify that the
/proc/sys/net/ipv6/conf/enp1s0/disable_ipv6file now contains the value1:cat /proc/sys/net/ipv6/conf/enp1s0/disable_ipv6 1
# cat /proc/sys/net/ipv6/conf/enp1s0/disable_ipv6 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow The value
1means thatIPv6is disabled for the device.