文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>iptables 的单机基本配置

iptables 的单机基本配置

时间:2009-05-30  来源:leige_linux

#!/bin/sh
#ip.sh
echo "------------Iptables starting-----------------------------------------" iptables -F
iptables -X
iptables  -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -z
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
echo "-----------------Iptables rule----------------------------------------" iptables -t filter -A INPUT -p tcp -s 192.168.0.0/24  --dport 21 -j ACCEPT
iptables -t filter -A INPUT -p tcp -s 192.168.0.0/24  --dport 20 -j ACCEPT
iptables -t filter -A INPUT -p tcp -s 192.168.0.0/24  --dport 23 -j DROP
iptables -t filter -A INPUT -p tcp -s 192.168.0.0/24  --dport www -j ACCEPT
iptables -t filter -A OUTPUT -p tcp -j ACCEPT
iptables -t filter -A INPUT -P icmp --icmp-type 0 -j ACCEPT
iptables -t filter -A INPUT -P icmp --icmp-type 3 -j ACCEPT
iptables -t filter -A INPUT -P icmp --icmp-type 8 -j ACCEPT
iptables -t filter -A INPUT -P icmp --icmp-type 11 -j ACCEPT
 
iptables -t filter -A OUTPUT -P icmp --icmp-type 0 -j ACCEPT
iptables -t filter -A OUTPUT -P icmp --icmp-type 3 -j ACCEPT
iptables -t filter -A OUTPUT -P icmp --icmp-type 8 -j ACCEPT
iptables -t filter -A OUTPUT -P icmp --icmp-type 11 -j ACCEPT
 
 
注释:
icmp 类型: echo-reply     0
echo-request    8
time-exceeded  11
destination-unreachable   3
相关阅读 更多 +
排行榜 更多 +
香焦金刚(Banana Kong)

香焦金刚(Banana Kong)

冒险解谜 下载
命运主宰者

命运主宰者

冒险解谜 下载
高中迷恋装扮

高中迷恋装扮

休闲益智 下载