Koozali.org: home of the SME Server

How to block incoming IP address from accessing server

moleboy

How to block incoming IP address from accessing server
« on: October 19, 2005, 10:39:35 AM »
Over the last couple of days an IP address originating from Nigeria has been systematically hammering a website hosted on my SME server (SME Server 6.0.1-01).

How can I configure SME server to block this particular IP address from accessing the web server?

(I don't care if by blocking this IP address I never receive email from it.)

Many thanks,
Ritchie

Offline Curly

  • ****
  • 114
  • +0/-0
How to block incoming IP address from accessing server
« Reply #1 on: October 19, 2005, 07:14:40 PM »
Use the firewall:

/sbin/iptables -I INPUT -s 123.123.123.123 -j DROP

replace the 123.123.123.123 with the ip-address you want to block. To make this stick when you reboot, you'll need to put this command somewhere.
.......................................

splunk

How to block incoming IP address from accessing server
« Reply #2 on: October 30, 2005, 09:48:28 PM »
Where would you reccomend putting it so that it will repeat after reboot?

Offline Curly

  • ****
  • 114
  • +0/-0
How to block incoming IP address from accessing server
« Reply #3 on: October 30, 2005, 10:10:44 PM »
A good place to put this, would be the file /etc/rc.d/rc.local . This script is executed last at boot-time.
.......................................

juncool

How to block incoming IP address from accessing server
« Reply #4 on: November 05, 2005, 06:44:51 AM »
hi, how about blocking range of ip addresses and certain services only like internet access but not ftp or ibay?

thanks,

- juncool 8-)