This is a script for setting up a firewall with settings for tarpitting ssh and basic protections that everyone needs.
sudo apt install iptables-persistent sudo /etc/init.d/netfilter-persistent save
(Use iptable-save which is pre-installed)
sudo iptables-save