Enable or disable ipv6 on ubuntu ufw netfilter firewall.
The /etc/default/ufw file is a high-level configuration file, to change default policies, and add IPv6 support and kernel modules.
sudo nano /etc/default/ufw
Edit the section in the file, change variable IPV6 to no.
# Set to yes to apply rules to support IPv6 (no means only IPv6 on loopback
# accepted). You will need to ‘disable’ and then ‘enable’ the firewall for
# the changes to take effect.
IPV6=yes
For disable change the variable to IPV6=no
Save changes and exit the file edit mode. As the description says the firewall needs to be disabled and then enabled to take effect..
Disable ufw:
sudo ufw disable
And then enable:
sudo ufw enable