linux – 使用LXC容器的服务器上的fail2ban

问题是modprobe和iptables在LX​​C容器内不起作用.

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

容器内的iptables错误是:

# iptables -I INPUT -s 122.129.126.194 -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.

我猜它不能工作,因为LXC容器共享一个内核,即主服务器内核.

在这种情况下我该如何做fail2ban.
modprobe和iptables在主服务器上工作,所以我可以在那里安装它并以某种方式链接到日志文件,我的猜测?

有什么建议?

解决方法

也许tcp包装器适合你. fail2ban可以管理/etc/hosts.allow和/etc/hosts.deny文件

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...