1 内核依赖
You require a Linux kernel version >= 2.6.18.
-
Connection Tracking System.
-
CONFIG_NF_CONNTRACK=m
-
CONFIG_NF_CONNTRACK_IPV4=m
-
CONFIG_NF_CONNTRACK_IPV6=m (if your setup supports IPv6)
-
-
nfnetlink: the generic messaging interface for Netfilter.
-
CONFIG_NETFILTER_NETLINK=m
-
-
nf_conntrack_netlink: the messaging interface for the Connection Tracking System.
-
CONFIG_NF_CT_NETLINK=m
-
-
connection tracking event notification API: the flow-based event notification interface.
-
CONFIG_NF_CONNTRACK_EVENTS=y
-
2 运行库依赖
除了内核依赖,还有很多运行库依赖
(conntrack的依赖包:
libnfnetlink 1.0.1 Installing to target
libnetfilter_conntrack 1.0.6
libnetfilter_cthelper 1.0.0
libnetfilter_cttimeout 1.0.0
libnetfilter_queue 1.0.2
conntrack-tools 1.4.4 )
3 简易程序实现
还好有一个通过程序来清conntrack表的方法,如下链接:
linux下清空连接跟踪表的方法_清除跟踪连接表-CSDN博客
官方网站说明
The conntrack-tools user manual (netfilter.org)