User prohibition problems with ip

I am having a very complicated problem that is that users send spam by a public ip, but when I prohibit that user and ip, because it is public wifi, so many people will access it. They also log in with that ip and then they are also banned due to suspicion of being a spammer. This is something I don’t want at all.