官网下载iptable源码,这里使用的是1.4.21版本的
下载:http://ftp.netfilter.org/pub/iptables/iptables-1.4.21.tar.bz2
(1)解压文件进入解压后的文件夾
$ tar -xvf iptables-1.4.21.tar.bz2
$ cd iptables-1.4.21/
(2)config
进行config配置
$ ./configure CC=linux-gnuspe-gcc --host=linux-gnuspe \
--prefix=/home1/output --with-ksource=/home1/kernel/linux-3.10.59 \
--enable-static --disable-shared
其中,CC指定交叉编译工具,--host指定架构,--prefix指定安装目录,--with-ksource指定内核源码目录(必须编译通过),--enable-static --disable-shared选择静态编译,更多的配置选项可以擦看iptables-1.4.21目录下INSTALL文件,
(2)make install
执行安装命令make install ,安装的目录已经在./config 中由--prefix 指点的目录下了
(3)拷贝
将安装目录下的sbin目录下的内容全部拷贝到目标机的/usr/sbin目录下

(4)内核中配置支持iptable
在menuconfig中添加支持iptable配置选项
Networking support --->
Networking options --->
Networking packet filtering framework (Netfiller) --->
core Netfilter configuration --->
全选为built-in [*]
IP: Netfilter configuration --->
全选为built-in [*]
注意:这里两个目录下面的所有配置全部选为built-in [*] 不能选为Module [M]
1542




被折叠的 条评论
为什么被折叠?



