当我做lsmod ,尽pipe我有iptables运行,但是我没有看到与iptables有关的任何内核模块。
是否因为iptables已经静态链接到内核中,因此我的防火墙脚本中不再需要这些行?
/sbin/insmod ip_tables /sbin/insmod ip_conntrack /sbin/insmod ip_conntrack_ftp /sbin/insmod iptable_nat /sbin/insmod ip_nat_ftp
这意味着iptables模块被静态编译到内核中。 看看/path/to/the/kernel/source/.config ,你会看到类似这样的东西:
# grep -i iptables /usr/src/linux/.config CONFIG_IP_NF_IPTABLES=y
代替:
CONFIG_IP_NF_IPTABLES=m
用于可加载模块。