linux编译内核及iptables升级.DOC

  1. 1、本文档共3页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
linux编译内核及iptables升级

/fjlinfeng 使用iptables—layer7应用层过滤功能 实验背景描述 在OSI七层参考模型中,应用层属于第七层,对于QQ,MSN,BT下载工具等程序,军事用了相对固定的应用层协议。使用”L7-filter”项目提供的补丁文件包,可以为linux内核,iptables增加应用层过滤的功能,结合其提供的I7-protocols底层协议定一包,能够识别不同应用层协议的数据特性,并方便及时更新。 环境所需四个员吗博爱文件为 Netfilter-layer7-v2.21.tar.gz Linux-.tar.gz iptables-1.4.2.tar.gz L7-filter项目源码站点在,获得最新的补丁包及协议包。 Linux内核源码包下载站点 Iptables源码包下载站点 实验步骤 重新便已安装linux内核 解压释放netfilter-layer7和linux内核源码包,使用patch工具合并补丁文件。 [root@localhost home]#tar zxvf netfilter-layer7-v2.21.tar.gz -C /usr/local/src [root@localhost home]#tar jxvf linux-.tar.bz2 -C /usr/local/src [root@localhost home]#cd /usr/local/src/linux- [root@localhost linux-]# patch -1 ../netfilter-layer7-v2.21/kernel.2.6.25-2.6.28-layer7-2.21.patch 2)重新配置内核编译参数,添加state机制及layer7支持。 [root@localhost linux-]#cp /boot/config/64.e.15 .config [root@localhost linux-]#make menuconfig 为了支持应用层过滤功能及数据包的状态跟踪,需要配置“Code Netfilter Configuration” 网络过滤代码配置如下: Networking support ——Networking Options ——Networking Packet filtering framework(Netfilter)——Core Netfilter Configuration ——依次找到下面几项,并编译为模块[M] Netfilter connection tracking support Layer7 match support String match support Ipranger address range match support Time match support Connlimit match support State match support 功能 “IP Netfilter Configuration” IP包过滤功能配置如下: Networking support——Networking Optioins——networking packet filtering framework(Netfilter)——IP:Netfilter Configuration——依次找到下面几项,编译为模块[M] 1.IPv4 connection tracking support (require for NAT) 2.Full NAT 及其部分的MASQUERADE target support、REDIRECT target support功能。 然后就一直按‘exit‘,提示保存时选YES保存退出。 3)编译新内核,并安装新内核文件,复制模板文件 [root@localhost linux-]#make make modules_install make install 4)调整GRUB引导菜单,使系统默认为新内核,然后启动 [root@localhost ~]#vim /boot/grub/grub.conf 10 default=0 第十行default值改为0 [root@localhost~]#reboot 升级iptables 1 2 3 4 5 6 7 8 wget /pub/iptables/iptables-1.4.9.tar.bz2 #解压 tar xjvf iptables-1.4.9.tar.bz2 cd iptables-1.4.9 #安装前配置 ./configure #编译并安装 make make install 这里,

您可能关注的文档

文档评论(0)

xiaozu + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档