Securing and Optimizing Linux: RedHat Edition -A Hands on Guide | ||
---|---|---|
Prev | Chapter 12. Networking Firewall -Masquerading and Forwarding | Next |
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 /etc/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/rc.d/rc.firewall.blocked ]; then . /etc/rc.d/rc.firewall.blocked fi |
Create the rc.firewall.blocked file touch /etc/rc.d/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:
Further documentation, 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