
While the above actionban does block unwanted addresses from specific ports it suffers from defining all the banned address on a single rule number with a specific port. This should be done whether or note you have two IP addresses) Further enhancement ( Note: I also added rule numbers 200 & 201 so that they'd be higher up in the IPFW food chain. (just make sure you've got defined in /etc/fail2ban/action.d/nf.) If you only have one IP address, you could have left the tag in place Obviously, you'll want to replace your specific IP addresses in the dummy placeholders above.

Ipfw add 201 deny tcp from to your-private-addy-here

Sudo emacs /etc/fail2ban/action.d/nfĪctionban = ipfw add 200 deny tcp from to your-public-addy-here I have two ethernet cards (one public-facing, the other private),Īnd I want to lock down both avenues when needed, We need to make a couple of changes in how fail2ban deals with adding rules. Make a little change in the ipfw actions if you have two IP addresses By adding *.info /var/log/ssh_info.log to /etc/nf you can gather IP-address and connection attempts from this file instead. However, if you want to detect failed attempts on for example a ssh-daemon running on another port only allowing rsa-authentication (useful if you want to port forward through your NAT-router), some extra tweaking is required. ( Note! In /var/log/secure.log all events related to keyboard-interactive logins can be found. In the section marked, you'll want to make it look like so: You can read all about this on the fail2ban wiki. Here's where you need to tell the program what you want to do. Make a spot for the log file sudo touch /var/log/fail2ban.log 5. Unpack the software tar xvfj fail2ban-0.8.3.tar.bz2 3.

There are no modifications to Python (still stock)ĭownload the latest version from the fail2ban SourceForge project.Īs of this writing, this is equivalent to doing this:Ĭurl -O 2.
