Introduction
Below are a few methods to check if IPv6 is enabled in Linux OS.
Procedure
It is important to note:
0 = Enabled
1 = Disabled.
Check IPv6 module status:
Enabled:
# cat /sys/module/ipv6/parameters/disable
0
Disabled:
# cat /sys/module/ipv6/parameters/disable 1
Using sysctl:
If IPv6 is disabled via sysctl
and is still in disabled state the output would contain "1" for specific entries:
# sysctl -a 2>/dev/null | grep disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.em1.disable_ipv6 = 0
net.ipv6.conf.em2.disable_ipv6 = 0
net.ipv6.conf.lo.disable_ipv6 = 0