Jeffrey’s Blog

IPTABLES防火墙脚本实例

Filed under: 系统管理 — Jeffrey @ Thursday, December 20th, 2007 3:57 pm 1,437 views  

#!/bin/bash
# zhangjianfeng.com
# etho 接外网──ppp0
# eth1 接内网──192.168.0.0/24
################################################################

modprobe ipt_MASQUERADE #IP(数据包伪装)伪装
modprobe ip_conntrack_ftp # ftp自动追踪模块
modprobe ip_nat_ftp  #加载对ftp协议支持的模块
iptables -F #清空filter表中所有规则
iptables -t nat -F
iptables -X #Delete  the  optional  user-defined Continue Reading ...

iptables学习笔记

Filed under: 电脑网络, 系统管理 — Jeffrey @ Wednesday, September 12th, 2007 6:31 pm 2,132 views  

作者: Jeffrey
出处:http://blog.zhangjianfeng.com/?p=632

++基本
modprobe ip_nat_ftp
#echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all #服务器禁ping
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth1 -p tcp –dport 22 -j ACCEPT #eth1为内网卡
iptables -A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
Continue Reading ...

iptables–小结

Filed under: 系统管理 — Jeffrey @ Monday, October 9th, 2006 1:13 pm 1,116 views  

iptables
-t
filter:     顾名思义,用于过滤的时候
nat:        顾名思义,用于做 NAT 的时候
-A、-I、-D、-R、-P、-F
       APPEND,追加一条规则
       INSERT,插入一条规则
       DELETE,删除一条规则
       Continue Reading ...

京ICP备06038449号