前言 一旦连上网络,就充满各种危机。许多人基于各式各样的理由,想侵入你的系统,这种人俗称为 cracker。尤有甚者,近年来,cracker 圈里流行一种结合病毒行为及系统漏洞的入侵工具,称为网虫(Netwrom),它以类似网络机器人(robot)的模式,到处扫射咬噬,已形成泛滥。比如:Lion、CodeRed、Nimda 等。现在你只要将一台新安装好的Win平台的机器连上网络,不消几分钟之内,即可钓中一堆 CoreRed 或 Nimda 咬噬的封包。
所谓网络拓朴(Topology),简单地说,是指网络的架构,什么地方摆放路由器、什么地方摆放主机、集线器、封包路由如何安排等细节,经由一番规划之后所呈现的网络结构。内部网络欲引入防火墙系统,经常必须改变网络拓朴,针对防火墙的特性,及欲达成的目标效益,选择最恰当的结构组成。因此之故,网络拓朴做一番变动,是必然的结果,各位要先有点心理准备才行。心理层有了准备之后,一切也会自然起来,不致于有无谓的害怕。
以下介绍需要的配备: · 一部 PC (P100以上等级) + 二片网络卡(100M) , 硬盘不必太大 (当然 PC 的等级越高越好,不过太高也是一种浪费) · 交换式集线器 + 若干条 RJ45 网络线 · RedHat 7.2 (或 RedHat 6.x)
好了!以下介绍防火墙入门时,所需要的一些基本观念。 TCP/IP Figure 2. TCP/IP 四层架构
以下我们就来看看Figure 11. ipchains 结构图
IPTABLES(8)封包过滤管理语法 iptables -[ADC] chain rule-specification [options] iptables -[RI] chain rulenum rule-specification [options] iptables -D chain rulenum [options] iptables -[LFZ] [chain] [options] iptables -[NX] chain iptables -P chain target [options] iptables -E old-chain-name new-chain-nameDESCRIPTION Iptables is used to set up, maintain, and inspect the tables of IP packet fil ter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. Each chain is a list of rules which can match a set of packets. Each rule specifies what to do with a packet that matches. This is called a `target', which may be a jump to a user-defined chain in the same table.描述 iptables 是用来设定、维护、检验 Linux 核心中的 IP 封包过滤规则表。 在核心中,可以定义许多不同的规则表。
这一节开始说明 iptables 的观念及用法 iptables 中的指令,均需区分大小写。 ipchains 和 iptables 在语法上的主要的差异,注意如下:
Bastion firewall 1. 防火墙主机,应该把大部份的服务关闭,仅保留 DHCP Server 及 SSH Server, 并且要限制连线范围。2. 防火墙第一片网卡,正常情形之下,设为真实 IP (除非这台防火墙是第二层的防火墙)。3. 防火墙的 Enable Routing 要打开 (linuxconf -> config -> Routing and gateways -> Set Defaults)4. 防火墙的 gateway 设贵校的路由器 IP5. 防火墙的第二片网卡,设私有 IP......
开机自动叫用 rc.firewall 在 /etc/rc.d/rc.local 档末,加入以下指令: if [ -f /etc/rc.d/rc.firewall ]; then . /etc/rc.d/rc.firewallfi 该档属性: chmod ug+rwx rc.firewall (即 chmod 774 rc.firewall) 该档 Owner 应为: root.root 练习时,可下 sh rc.firewall 或 ./rc.firewall 以下指令档,仅供参考,它们并不完整,未必能符合您的需要,您必须要再修改才能使用。
站内技术专题搜索
强力搜索