背景:
阅读新闻
Linux下主机充当防火墙的巧妙应用之iptables
[日期:2012-09-20] 来源:51cto 作者:gjp0731 [字体:]
二、重新编译iptables
1、卸载现有iptables
[root@gjp99 ~]# rpm -e iptables --nodeps
[root@gjp99 ~]# tar jxvf iptables-1.4.2.tar.bz2 -C /usr/src/
2、合并iptables+layer7补丁
[root@gjp99 ~]# cd /usr/src/netfilter-layer7-v2.20/iptables-1.4.1.1-for-kernel-2.6.20forward/
[root@gjp99 iptables-1.4.1.1-for-kernel-2.6.20forward]# ls
libxt_layer7.c libxt_layer7.man
[root@gjp99 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、编译安装
[root@gjp99 iptables-1.4.1.1-for-kernel-2.6.20forward]# cd /usr/src/iptables-1.4.2/
[root@gjp99 iptables-1.4.2]# ./configure --prefix=/ --with-ksource=/usr/src/linux-2.6.25.19
[root@gjp99 iptables-1.4.2]# make && make install
4、安装l7-protocols模式包
[root@gjp99 ~]# tar zxvf l7-protocols-2008-10-04.tar.gz -C /etc/
[root@gjp99 ~]# mv /etc/l7-protocols-2008-10-04/ /etc/l7-protocols
5. 加载ftp模块
[root@gjp99 iptables-1.4.2]# modprobe ip_nat_ftp
[root@gjp99 iptables-1.4.2]# lsmod
Module Size Used by
ip_nat_ftp 7361 0
案例配置
拓扑图:
工程部门 192.168.2.10--20
软件部门 192.168.2.21--30
经理办 192.168.2.31--40
上班时间 (周一---周五 08:20:00)
工程部门 : 上班时间ftp 不允许http qq 迅雷 下班后无限制
软件部门 : http 不允许非法站点sina ,不允许使用迅雷 ,连接数 最多3个 不允许聊天
不允许使用pplive ,下班后无限制
经理办公室:http qq 都可以,下班后无限制
dmz区域www服务器进行发布
相关资讯 IpTables
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯