I wouldn’t bother with iptables. I’ve done it before and it quickly gets overrun on any large scale attacks. Cloudflare on your front end will stop a lot of garbage and take the brunt of volumetric attacks, or use nginx/varnish/haproxy to rate limit and or block attackers before they reach your app.