How to block ip address on Fedora/Linux using iptables?

Today, I was looking at fedora server logs and discovered that lots of failed automated ssh hacking attempts on various ports. So, to block these IP addresses, googled and found lots of resources on this topic. I thought to keep a log about this.

I already did some configuration with hosts.allow and hosts.deny which you can see in this post – sshd: refused connect from ::ffff.

How to block IP addresses?
To block these IP addresses you need to run iptables command as follows:(replace IPaddress with actual IP address)
iptables -A INPUT -s IPaddress -j DROP
iptables -A OUTPUT -d IPaddress -j DROP

1. Linux Firewalls Using iptables.
2. how-do-i-block-an-ip-on-my-linux-server

Related Posts:

One Responses

Cornell Audrey May 20, 2010 at 12:16 pm

Hai, i am the owner of .Thank’s for sharing this news.This is very helpful and informative material.Good post and keep it up dude.

Comments are closed.