Forge Home


Disables or enables IPv6 on Linux systems

Ben Formosa



4,505 latest version

5.0 quality score

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Nov 18th 2018
This version is compatible with:
  • Puppet Enterprise 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0
  • RedHat

Start using this module


benformosa/linux_disable_ipv6 — version 0.1.1 Nov 18th 2018


Table of Contents

  1. Description
  2. Setup - The basics of getting started with linux_disable_ipv6
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.


The linux_disable_ipv6 module disables IPv6 for Linux systems, following operating system vendor recommendations.


What linux_disable_ipv6 affects

Depending on the operating system and version, the module may affect networking, kernel configuration and bootloader configuration.

Using this module may cause issues with software which requires IPv6, such as SSH Xforwarding.

RedHat 7

  • Creates kernel parameter configuration file /etc/sysctl.d/ipv6.conf
  • Load kernel parameters from file with sysctl -p
  • Updates initramfs with dracut -f
  • Updates flags for IPv6 transports in /etc/netconfig
  • Updates NETWORKING_IPV6 option in /etc/sysconfig/network
  • Removes IPv6 loopback address from /etc/hosts

Beginning with linux_disable_ipv6

To disable IPv6, include the class: include linux_disable_ipv6.


By default, the module will disable IPv6 for whole system.

Depending on your operating system, disabling IPv6 for specific interfaces may be supported.

Supply a list of interface names to the interfaces parameter:

class { 'linux_disable_ipv6':
  interfaces => ['lo', 'eth0'],

It's also possible to enable IPv6, by setting the disable_ipv6 to false:

class { 'linux_disable_ipv6':
  disable_ipv6 => false,


linux_disable_ipv6 class parameters

Parameter Type Default Description
disable_ipv6 Boolean true Set this to either disable or enable IPv6
interfaces Array[String] ['all'] Disable IPv6 for these interfaces. If not supported, this parameter is ignored. If it contains the value 'all', other interface names will be ignored.


For an extensive list of supported operating systems, see metadata.json.

Currently, only Red Hat Enterprise Linux 6 and 7 are supported.