Getting Fail2ban and VoipBL working with Asterisk on Ubuntu 18.04

The information on installing and configuring Asterisk, fail2ban, and VoipBL is all over the map. It is hilariously not easy to find what actually works. Way more confusing typos and important pieces left out on numerous sites, like there is some sort of conspiracy to make it difficult to install this trio. After trying to install Asterisk from source a number of times and failing for about a dozen different reasons, I finally gave up and used the simple "apt install asterisk" which does not install the latest version of Asterisk, but DOES install a stable, working version -- which ended up being all I really need.

I tried to install the other two elements using a few guides, numerous times, before I finally got it all working. Once there, I could look back and see the best way to do it. Turns out, for the Ubuntu 18.04 system I'm working with, a single site ended up having most of the information for installing fail2ban efficiently, and the main site for VoipBL had the best information I needed for installing VoipBL. All other sites are in various stages of chaos or too detailed, or wrong version, or missing information, etc.

So, to make it easier for myself in the future, and for others with this setup, here's what worked for me:

  1. Install Asterisk with "apt install asterisk" which installs Asterisk 13. Unless you absolutely need the latest version, do this.

  2. Best site for installing Fail2ban for Asterisk 13 on Ubuntu:

https://cyphercodes.github.io/2018/04/08/Secure-Asterisk-13-with-Fail2ban-on-Ubuntu-16-04/

You'll see my own comment at the bottom of that page, saying that you need to enable security logging for it to work. Not sure if this is an issue with the upgrade to 18.04 or just something that got left out of the original instructions for 16.04. Either way, it all worked with that one small change. Kudos to this site for having information on the handy fail2ban-client that makes it easy to verify installation. Few other sites mention this.

  1. Best site for installing VoipBL. Instructions are on the main page, just scroll down:

http://www.voipbl.org/

Note that the canonical (pun intended) Asterisk site information on fail2ban is succint but slightly out of date. It succinctness provides a nice overview of the process you need to go through, though, so here it is:

http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/Security_id36001183.html

Hope this helps someone.

Add a comment

HTML code is displayed as text and web addresses are automatically converted.

Page top