Inexplicably, it seems like there has been a bug for a long time in one of the most widely used firewalls, UFW, which does not allow for adding IPv6 deny rules above any other IPv4 rules.
The result is that in order to deny IPv6 addresses one has to rewrite the entire ruleset after adding an IPv6 deny rule, because the IPv4 rules (on top) override the newly added deny rules on IPv6 addresses.
Fail2ban also seems littered with errors for applying IPv6 deny rules. What are some workarounds people are using for this?
If you are searching the way to disable all ipv6 then easy way to switch them of on kernel level.
Add this lines to
/etc/sysctl.conf
and reboot orsudo sysctl -p
to apply new settings