From time to time I add some IP addresses into the iptable to block them. In my practice it had be happend, that I added same IP address more than one time. If I save the content of iptable to a File, I look in the file about duplicate entries with this command: "uniq -d rules.v4".
If I have i.e. in Line 10 a IP addresses and in line 11 the same IP address, the command will work perfectly and show me the duplicate entry. Otherwise, if I have the IP address of line 10 also in line 15, the uniq command doesn't show me the duplicate, I need first to sort the file to get the wanted entries. Maybe you have a good solution for this small problem?