iptables在不重新编译内核以及iptables的情况下 加载iptables模块--在proxmox5中没有测试成功

1、下载地址
https://inai.de/projects/xtables-addons/ 说明
https://inai.de/files/xtables-addons/ 下载

github上
https://github.com/nawawi/xtables-addons/tree/master
可以通过git来下载或者直接下载zip格式

netfilter上也有介绍:
https://www.netfilter.org/projects/xtables-addons/index.html

xtables-addons官网,在官网上下载实在费劲,不推荐
https://sourceforge.net/projects/xtables-addons/

2、安装
wget https://inai.de/files/xtables-addons/xtables-addons-2.10.tar.xz或者
git clone https://github.com/nawawi/xtables-addons.git 速度太慢
从github上下载了zip文件(3.9版)上传到了linux上
unzip xtables-addons-master-3.9.zip
cd xtables-addons-master
less install 查看安装文档 ./configure 、make、make install如下第一步就出错:
root@debian9:~/xtables-addons-master# ./configure
-bash: ./configure: No such file or directory
好吧,看了下configure.ac文件,里面的源码初始文件夹是xtables-addons
mv xtables-addons-master xtables-addons
再次执行./configure ./configure还是提示同样的错误./configure: No such file or directory
less ./autogen.sh看到shell中有autoreconf命令 which autoreconf,发现没有找到命令
apt install autoconf,然后再次运行which autoreconf发现找到了命令
执行下 ./autogen.sh 出现错误:
root@debian9:~/xtables-addons# ./autogen.sh
configure.ac:10: error: possibly undefined macro: AC_DISABLE_STATIC
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.

参考:了解automake和autoconf(autoreconf) https://blog.csdn.net/u010020404/article/details/82770848

另外的git clone源 https://inai.de/projects/xtables-addons中提示
git clone https://git.inai.de/xtables-addons 速度太慢了
下载xtables-addons-2.10.tar.xz上传 ,然后出现如下错误:
root@debian9:~/xtables-addons# make
make all-recursive
make[1]: Entering directory '/root/xtables-addons'
Making all in extensions
make[2]: Entering directory '/root/xtables-addons/extensions'
Xtables-addons 2.10 - Linux make[3]: Entering directory '/root/xtables-addons/extensions'
make[3]: *** /lib/modules/4.15.18-12-pve/build: No such file or directory. Stop.
make[3]: Leaving directory '/root/xtables-addons/extensions'
Makefile:449: recipe for target 'modules' failed
make[2]: *** [modules] Error 2
make[2]: Leaving directory '/root/xtables-addons/extensions'
Makefile:485: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/xtables-addons'
Makefile:369: recipe for target 'all' failed
make: *** [all] Error 2

下载最新的3.13版本,在make时出现错误error
./autogen.sh发现:
root@debian9:~/xtables-addons-3.13# ./autogen.sh
Can't exec "libtoolize": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 345, line 6.
autoreconf: failed to run libtoolize: No such file or directory
autoreconf: libtoolize is needed because this package uses Libtool
网上提示apt-get install build-essential libtool 实际只安装了libtool 重新./autogen.sh没问题 但make还是出错。
继续执行./configure还是提示同样的错误

3、使用:
1)、
https://github.com/nawawi/xtables-addons/tree/master/doc中列举了例子:
PSD (Portscan Detection) External extensions for Xtables-addons

Example:
iptables -A INPUT -m psd --psd-weight-threshold 21 --psd-delay-threshold 300 --psd-lo-ports-weight 1 --psd-hi-ports-weight 10 -j LOG --log-prefix "PSD: "

2)、

4、参考:
如何在 Linux 中根据国家位置来阻断网络流量 https://linux.cn/article-6885-1.html

Centos6下用Xtables-Addons不编译安装Iptables模块Geoip https://www.haiyun.me/archives/iptables-xtables-addon-geoip.html

待centos7或debian9上测试。

原文地址:https://www.cnblogs.com/weihua2020/p/14043019.html