I have been trying in vain to get geoip blocking working with iptables on one of my Pi's; I'm getting stupid amount of script kiddies trying to brute force my ssh daemon, fail2ban is blocking them, but figured its better to block countries I dont want access to my system at all.
I have tried following various guides to get the geoip and xtables working but am way out of my depth and am stuck.
I have got to the point where i have downloaded and converted the geoip database but have hit another brick wall as there is no xt_geoip module. So trying to use the following iptable rule fails:
Code: Select all
sudo iptables -I INPUT 1 -m state --state NEW -m geoip ! --src-cc GB -m tcp -p tcp --dport 22 -j DROP
Code: Select all
sudo module-assistant --verbose --text-mode auto-install xtables-addons
this fails however with the message:
Code: Select all
Bad luck, the kernel headers for the target kernel version could not be
found and you did not specify other valid kernel headers to use.
If the running kernel has been shipped with the Debian distribution, please
install the package linux-headers-4.1.19-v7+. If your kernel source tree
(or headers) is located in some non-usual location, please set the
KERNELDIRS environment variable to the path of this directory, or
(alternatively) specify the source directory we build for with the
--kernel-dir option in module-assistant calls.
As you can probably tell I'm way over my head as linux isnt really my comfort zone. I have googled my way through to this point (not really fully understanding what I'm doing) and am reaching out for some guidance as its getting really confusing now and am unsure if I'm just missing something basic.
(i'm using the Jessie Lite build from the downloads page by the way)
Many Thanks