|
|
发表于 2004-5-24 23:13:32
|
显示全部楼层
- [FONT=courier new]
- #!/bin/sh
- IPTABLES=/sbin/iptables
- # cleanup
- $IPTABLES -F
- $IPTABLES -Z
- # accept all
- $IPTABLES -P INPUT ACCEPT
- $IPTABLES -P FORWARD ACCEPT
- $IPTABLES -P OUTPUT ACCEPT
-
- # trusted machines
- $IPTABLES -A INPUT -i lo -j ACCEPT
- $IPTABLES -A INPUT -s 127.0.0.1 -j ACCEPT
- $IPTABLES -A INPUT -s dragon.dragonsoft.net -j ACCEPT
-
- #
- # allow services
- #
- #$IPTABLES -A INPUT -p tcp -m tcp -s allow.host --dport 23 -j ACCEPT
- $IPTABLES -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
- $IPTABLES -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
- $IPTABLES -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
- $IPTABLES -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT
-
- $IPTABLES -A INPUT -p udp -m udp --dport 53 -j ACCEPT
- $IPTABLES -A INPUT -p udp -m udp --sport 53 -j ACCEPT
- $IPTABLES -A INPUT -p udp -m udp --sport 123 -j ACCEPT
-
- $IPTABLES -A INPUT -p tcp -m tcp --sport 20 -j ACCEPT
-
- $IPTABLES -A INPUT -p tcp -m tcp ! --syn -j ACCEPT
-
- $IPTABLES -A INPUT -p icmp -j ACCEPT
-
- #
- # deny all others
- #
- $IPTABLES -A INPUT -j DROP
-
-
- $IPTABLES -nL
- [/font]
复制代码 |
|