If you want to prevent a single user hitting F5 a million times from messing with your analytics you need to track IPs which requires the banner.
No, you don't need consent for that. It falls under the legitimate interest exception.
You need to disclose it in your privacy policy, you need to delete it after a reasonable retention period and you can't use those logs for other purposes like ad targeting, but you don't need a consent banner to track things that you are legitimately using for security purposes.
I'm not convinced this is a real concern. Bots, maybe, but then again even fancy analytics will be fucked by that because they use hundreds or thousands of high-reputation residential IPs. So, you're optimizing for the wrong thing I think.