Deny access to some address
Sometimes you’ll know an address that you would like to block from having any access at all to your server. You can do that by creating the rc.firewall.blocked file under 7etc/rc.d/” directory and uncomment the following lines in your firewall rules scripts file:
Edit your firewall scripts file (vi /etc/rc.d/init.d/firewall) and uncomment the following lines:
if [ -f/etc/rcd/rc.firewall.blocked ]; then
. /etc/rcd/rc.firewall.blocked fi
Create the rc.firewall.blocked file (touch /etc/rcd/rc.firewall.blocked) and add inside this file all the IP addresses that you want to block from having any access to your server at all:
For example, I put the following IP addresses in this file:
204.254.45.9
187.231.11.5
Further documentation
For more details, there are several man pages you can read:
$ ipchains (8) - IP firewall administration
$ ipchains-restore (8) - restore IP firewall chains from stdin
$ ipchains-save (8) - save IP firewall chains to stdout