iptables实现应用层的包过滤平台:
linux5.4
源码包:
iptables-1.4.2.tar.bz2
l7-protocols-2008-10-04.tar.gz
linux-2.6.25.19.tar.bz2
netfilter-layer7-v2.20.tar.gz
卸载原有的iptables、可以先把iptables的启动脚本提前备份一份;等后面重新编译iptables时再复制过来。
( /etc/init.d/iptables )
而后把源码包解压缩到 /usr/local/src/下;
步骤:
一、重新编译内核
1、合并kernel+layer7补丁
# tar jxvf linux-2.6.25.19.tar.gz2 -C /usr/src/
# tar zxvf netfilter-layer7-v2.20.tar.gz -C /usr/src/
# cd /usr/src/linux-2.6.25.19/
# patch-p1 < /usr/src/netfilter-layer7-v2.20/kernel-2.6.25-layer7-2.20.patch
2、配置新内核
# cp/boot/config-2.6.18-8.el5 .config
【 可以沿用原本的内核 或者升级内核 】
# make menuconfig
【 配置内核时,在“Networking ---> Networking Options ---> NetworkPacket filtering framework (Netfilter) ”处主要注意两个地方:
1) ---> Core Netfilter Configuration
//将“Netfilter connection tracking suport (NEW)”选择编译为模块(M),需选取此项才能看到layer7支持的配置。
//将layer7、string、state、time、IPsec、iprange、connlimit……等编译成模块,根据需要看着办。
2) ---> IP: Netfilter Configuration
//将“IPv4 connection tracking support (require for NAT)”编译成模块。
//将“Full NAT”下的“MASQUERADE target support”和“REDIRECT target support”编译成模块。
--->.config
3、编译及安装模块、新内核
# make&& make modules_install && make install
【 编译安装成后后,重启选择使用新的内核(2.6.25.19)引导系统 】
二、重新编译iptables
1、卸载现有iptables
# rpm -eiptables --nodeps
2、合并iptables+layer7补丁
# tar jxvfiptables-1.4.2.tar.bz2 -C /usr/src/
# cd /usr/src/netfilter-layer7-v2.20/iptables-1.4.1.1-for-kernel-2.6.20forward/
# cp libxt_layer7.c libxt_layer7.man /usr/src/iptables-1.4.2/extensions/
3、编译安装
# cd /usr/src/iptables-1.4.2/
# ./configure --prefix=/ --with-ksource=/usr/src/linux-2.6.25.19
# make&& make install
4、安装l7-protocols模式包
# tar zxvfl7-protocols-2008-10-04.tar.gz -C /etc/
# mv /etc/l7-protocols-2008-10-04 /etc/l7-protocols
这个时候测试页是无任何规则的:
更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2013-10/91883p2.htm
推荐阅读:Linux防火墙iptables详细教程 http://www.linuxidc.com/Linux/2013-07/87045.htmiptables+L7+Squid实现完善的软件防火墙 http://www.linuxidc.com/Linux/2013-05/84802.htmiptables的备份、恢复及防火墙脚本的基本使用 http://www.linuxidc.com/Linux/2013-08/88535.htmLinux下防火墙iptables用法规则详解 http://www.linuxidc.com/Linux/2012-08/67952.htmiptables的用法小结 http://www.linuxidc.com/Linux/2013-10/90930.htm
iptables 手册用Aspose.Words 从Word文档中提取表格数据相关资讯 IpTables
- CentOS Samba 服务器 Iptables 和 (今 07:14)
- iptables超全详解 (09月01日)
- Iptables防火墙 基础知识 (08月19日)
| - Iptables工作原理使用详解 (09月06日)
- iptables中NAT表 (08月25日)
- Linux 为FTP 服务器添加iptables规 (08月11日)
|
本文评论 查看全部评论 (0)
评论声明- 尊重网上道德,遵守中华人民共和国的各项有关法律法规
- 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
- 本站管理人员有权保留或删
|