Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

Iptables Centos 6 - Sort Numerically

I need to know what ip numbers I have blocked with iptables.  I know I can display a list but I need that list of ip numbers to be in ascending sequence so I can easily determine if I have that ip blocked or not.

Thanks,
Avatar of Jan Bacher
Jan Bacher
Flag of United States of America image

I always insert rules instead of appending them.

If you want to see source addresses in numerical order, then I would recommend re-writing the list so that they appear in the proper ascending order.

When adding rules in the future, look at the line numbers and insert your new rule appropriately.
ASKER CERTIFIED SOLUTION
Avatar of Steven Vona
Steven Vona
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sharingsunshine

ASKER

exactly what I needed, Thanks
The problem with that solution is you said "IPs that are blocked".  It shows all IPs regardless of the permissions -- including subnets that are permitted.
Hi Jan,

Thanks for your concern.  I can live with that fact.  I am getting lists of hackers from a wp plugin.  Also, I have a script that finds hackers who are subscribing to our newsletter.  I just wanted a list of IP's that I had already added.  To keep from duplicating my efforts.

Also, I don't grant any permissions through iptables.  I use Amazon's console for that.