09.12.2017

FastNetMon community CLI and API

It’s very-very early developer preview feature but you may try it. You need to install FastNetMon using custom flags unless if you’ve installed GoBGP support then you have got API support automatically.

wget https://raw.githubusercontent.com/pavel-odintsov/fastnetmon/master/src/fastnetmon_install.pl -Ofastnetmon_install.pl
sudo perl fastnetmon_install.pl --use-git-master --api

Enable API in configuration file /etc/fastnetmon.conf:

enable_api = on

You could ban IP this way:

/opt/fastnetmon/fastnetmon_api_client ban 192.168.1.1

You could unban IP this way:

/opt/fastnetmon/fastnetmon_api_client unban 192.168.1.1

You could check list of blocked hosts this way:

/opt/fastnetmon/fastnetmon_api_client get_banlist

Sample output:

192.168.1.1/32