Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The issue is modprobe and iptables don't work inside an LXC Container.

LXC is the userspace control package for Linux Containers, a lightweight virtual system mechanism sometimes described as “chroot on steroids”.

iptables error inside the container is:

# iptables -I INPUT -s -j DROP
> iptables v1.4.8: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

I am guessing that it can't work because the LXC containers share one kernel, the main server kernel.

How do I do fail2ban in this case. modprobe and iptables work in the main server so I could install it there and link to the logfiles somehow, my guess?

Any suggestions?

share|improve this question
Have you loaded the Iptables modules? It can be that you need to do this manually. – Lucas Kauffman Jun 12 '12 at 22:57
As long as modprobe doesn't work there is no point of trouble shooting iptables or fail2ban. The real question is, is it even safe to do modeprobe from chroot? – RoboTamer Jun 12 '12 at 23:14
It ought to work. I'd try manually loading the modules on the host. says just copy the modules into the container filesystem. – DerfK Jun 13 '12 at 1:48
up vote 3 down vote accepted

Maybe tcp wrappers works for you. fail2ban can manage /etc/hosts.allow and /etc/hosts.deny files

share|improve this answer
Right, iptables don't work, still don't get the 5 bans – RoboTamer Jul 31 '12 at 23:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.