RSS
热门关键字:  时间 autorun AVG key 百度
当前位置 :| 首页 > 系统安全 > linux/unix >

Linux系统Iptables的常用防火墙配置方法

来源: 作者: 时间:2007-12-23 10:43:04 点击:

  Iptables的常用防火墙配置

  本脚本环境为eth0外网,eth1内网;

  #!/bin/sh

  #外网网卡

  EXT_IF="eth0"

  FW_IP="61.137.85.21"

  #内网网卡

  INT_IF="eth1"

  LAN_IP="192.168.0.1"

  LAN_IP_RANGE="192.168.0.0/255.255.255.0"

  #加阅模块,一般已内建

  #Module loading.

  #echo "modprobe modules"

  #modprode ip_tables

  #modprode ip_nat_ftp

  #modprode ip_conntrack

  #modprobe ip_conntrack_ftp

  #启用转发(forward)功能

  echo "enabling IP FORWARDING……"

  echo "1" >; /proc/sys/net/ipv4/ip_forward

  #规则初始化,设置默认都为drop

  echo "enabling iptables rules"

  #reset the default policies in the tables

  iptables -F

  iptables -X

  iptables -F -t mangle

  iptables -X -t mangle

  iptables -F -t nat

  iptables -X -t nat

  iptables -Z -t nat

  #set policies

  iptables -P INPUT DROP

  iptables -P FORWARD DROP

  iptables -P OUTPUT DROP

  ###——###

1 2 3 4 5 下一页
最新评论共有 位网友发表了评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
验证码:
匿名?
相关文章
无相关信息