分类号:TP309.5 U D C:D10621-408-(2007)6007-0
密 级:公 开 编 号:2003031307
成 都 信 息 工 程 学 院
学 位 论 文
Iptables 图形管理工具的设计与实现
论 文 作 者 姓 名 :
廖 超
申 请 学 位 专 业 :
计算机科学与技术
申 请 学 位 类 别 :
工学学士
指导教师姓名(职称):
索 望
论 文 提 交 日 期 :
2007 年 06 月 09 日
Iptables 图形管理工具的设计与实现
摘 要
Netfilter/Iptables 防火墙是 Linux 平台下的包过滤防火墙,Iptables 防火墙不
仅提供了强大的数据包过滤能力,而且还提供转发,NAT 映射等功能,是个人
及企业级 Linux 用户构建网络安全平台的首选工具。但是,由于种种原因,
Iptables 一直是使用命令模式管理配置防火墙,这就要求用户必须熟悉 Iptables 各
种繁杂的命令,为用户的使用带来了很多不便。本文设计并实现了一个基于 Web
的 Iptables 图形管理工具,通过友好的配置界面,简化了 Iptables 防火墙的管理
配置程序,更方便用户对 Iptables 防火墙的使用。
本工具采用 Browser/Server 模式,通过 Web 配置界面,用户可远程修改
Iptables 的相关配置文件,从而到达配置 Iptables 的目的。整个工具由添加/删
除规则,插入/替换规则,状态机制,关闭/启动/重启防火墙等几个模块组成。
用户只需登陆到配置页面,通过简单的鼠标操作就可以轻松完成防火墙的基本配
置工作。
关键词:Iptables 防火墙;Browser/Server;包过滤
The Design and Implementation of
Graphics Management Tools of Iptables
Abstract
The graphics management tool of Iptables can manage the Iptables firewall on
website. The Iptables firewall not only provides function to filter data, but also
provides a function to transfer package as well as NAT. It is used to design secure
network by personal and company. But for various reasons, the Iptables is configured
by inputting commands, which means that users must be familiar to the commands.
So, the paper designs and implements Iptables interfacial management tool which
bases on website. The user can configure it simpler and more convenient by friendly
graphics interfacial.
This system uses Browser/Server mode to configure Iptables by modifying
iptbales configuration files on web. The system is constituted by the following
modules: the rule of addition, the rule of deleting, and the rule of insertion, the rule of
replacing, the mechanism of stating, shutdown firewall, start firewall, and restarting
firewall. The users can configure Iptables firewall just by login the web and clicking
mouse.
Key words: Iptables Firewall; Browser/Server; package filter
目 录
论文总页数:22 页
1 引 言.............................................................................................................................................1
2 防火墙基本理论............................................................................................................................1
2.1 防火墙技术分类 .....................................................................................................................2
2.1.1 包过滤技术........................................................................................................................2
2.1.2 代理技术............................................................................................................................2
2.1.3 状态监视技术....................................................................................................................2
2.2 包过滤防火墙工作原理 .......................................................................................................2
2.3 Iptables 防火墙简介.................................................................................................................3
2.3.1 Netfilter 组件 .....................................................................................................................3
2.3.2 Iptables 组件 ......................................................................................................................3
2.4 Iptables 工作原理..................................................................................................................3
2.4.1 Iptables 规则表简介 ..........................................................................................................3
2.4.2 Iptables 的工作流程 ..........................................................................................................4
3.系统概述.........................................................................................................................................4
3.1 系统摘要 .................................................................................................................................4
3.2 系统设计模式 .........................................................................................................................4
4 开发环境及工具............................................................................................................................5
4.1 开发环境 .................................................................................................................................5
4.2 开发工具.....................................................................................................................................6
5 系统构成........................................................................................................................................6
5.1 系统基本构成 ..........................................................................................................................6
5.2 功能模块构成 ..........................................................................................................................7
5.2.1 添加规则功能模块............................................................................................................7
5.2.2 删除规则功能模块...........................................................................................................7
5.2.3 插入规则功能模块............................................................................................................7
5.2.4 替换规则功能模块............................................................................................................7
5.2.5 状态机制功能模块............................................................................................................7
5.2.6 防火墙关闭/启动功能模块..............................................................................................7
5.2.7 防火墙重启模块...............................................................................................................7
5.2.8 读取防火墙配置文件/规则链模块...................................................................................8
6 系统设计........................................................................................................................................8
6.1 前台主页设计 ..........................................................................................................................8
6.2 基本设置功能的设计 ..............................................................................................................9
6.3 状态机制功能设计 ................................................................................................................10
6.4 Iptables 操作功能设计...........................................................................................................10
6.5 Iptables 配置文件/规则链读取功能设计 .............................................................................11
7 系统实现.......................................................................................................................................11
7.1 基本设置及高级功能实现方法 ............................................................................................11
7.2 Iptables 操作功能实现...........................................................................................................15
7.3 读取防火墙配置文件/规则链的实现 ...................................................................................16
8 开发中遇到的问题及解决办法...................................................................................................18
8.1 所遇问题 ................................................................................................................................18
8.2 解决办法 ................................................................................................................................18
9 系统测试.......................................................................................................................................19
结 论..........................................................................................................................................20
参考文献..........................................................................................................................................20
致 谢..........................................................................................................................................21
声 明..........................................................................................................................................22