1、下载:
git clone git://git.netfilter.org/iptables.git
2、生成config文件:
2.1 我虚拟机中没有安装git,是从Windows下下载的,需要转换一下换行符:
2.2 增加一下交叉编译工具链的环境变量:
2.3 一步生成config文件
autoreconf -i
3、生成Makefile
prefix填写自己本地的安装路径即可。./configure --prefix=/home/***/work/iptables/output --host=mipsel-linux --disable-nftables
4、make
make
我下载的是1.6.2的版本,编译时会有两个地方提示文件不存在,直接屏蔽掉相关头文件中的include就好。
5、make install
这里会提示mipsel-linux-gcc command not found,打开相关文件,直接指定绝对路径,可以解决。sudo make install