This snippet can be used to configure Consul DNS forwarding per HashiCorp Learn | DNS Forwarding with added persistence across reboots on Ubuntu 20.04.
# install iptables-persistent to manage iptables NAT rules across reboots
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections