使用iptables建置Linux 防火墙(2)

80酷酷网    80kuku.com

  

  陆、应用实例

  #!/bin/sh

  #

  # 石牌国小防火墙设定指令稿

  # 2002/8/27

  # 设定者:李忠宪(修改自 iptables tutorial 1.1.11 by Oskar Andreasson )

  # 原文件是依 DMZ 需求设计,已根据校园 NAT 网络之需求修改,其余改动部份包括:

  # 新增通讯协议定义区块

  # 新增执行时,自动清除已设定之规则

  # 支援 FTP

  # 修改所有规则,改采 multiport 方式以简化规则

  # 原文件仅支持 IP 伪装(多对一对应),已扩充为支持一对一对应及多对多对应

  # 原文件仅支援 DNS 及 WEB,新增 ftp、mail、wam、PCAnywhere、ssh......等多种服务器

  # 修改若干规则设定上的小错误

  #

  # Copyright (C) 2001 Oskar Andreasson <bluefluxATkoffeinDOTnet>

  #

  # This program is free software; you can redistribute it and/or modify

  # it under the terms of the GNU General Public License as published by

  # the Free Software Foundation; version 2 of the License.

  #

  # This program is distributed in the hope that it will be useful,

  # but WITHOUT ANY WARRANTY; without even the implied warranty of

  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

  # GNU General Public License for more details.

  #

  # You should have received a copy of the GNU General Public License

  # along with this program or from the site that you downloaded it

  # from; if not, write to the Free Software Foundation, Inc., 59 Temple

  # Place, Suite 330, Boston, MA 02111-1307 USA

  #

  ###########################################################################

  #

  # 1. Configuration options.

  #

  # 1.0 Protocols Configuration.

  # 定义会用到的通讯协议

  HTTP="80"

  HTTPS="443"

  FTP="21"

  FTP_DATA="20"

  SMTP="25"

  POP3="110"

  IMAP="143"

  SSH="22"

  TELNET="23"

  PCAW_TCP="5631"

  PCAW_UDP="5632"

  WEBMIN="10000"



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: