- 论坛徽章:
- 1
|
MSN与QQ,
QQ我只开了UDP8000端口,
MSN没开端口,这里人只用QQ的.
附脚本,(请别扔太多砖头了.........................会钉死俺的..............:)
IP="166 66 64 63 62 55 53 52 51 44 43 41 36 135 35 33 22 24 23 25 14"
for netIP in $IP ; do
arp -d 10.254.254.$netIP
done
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack_ftp
#
WAN_IF="ppp0"
LAN_IF1="eth1"
LAN_IP1="10.254.254.1"
LAN_WD1="10.254.254.0/24"
MEIP1="10.254.254.35"
MEIP2="10.254.254.135"
DNS1="202.103.24.68"
DNS2="202.103.0.117"
SQUID_PORT=3128
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
###############################################
iptables -t nat -A POSTROUTING -o $WAN_IF -s $LAN_WD1 -j MASQUERADE
#iptables -t nat -A POSTROUTING -d 192.168.10.1 -s $MEIP1 -j MASQUERADE
##chuang qi shi fu###############
iptables -t nat -A PREROUTING -d 61.129.73.24 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 219.129.239.35 -p tcp --dport 80 -j ACCEPT
###################劲舞团######################
iptables -t nat -A PREROUTING -d 61.129.15.109 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 222.73.254.8 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 61.151.249.135 -p tcp --dport 7000 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.77.121.222 -p tcp --dport 80 -j ACCEPT
###################END#########################
##ONLINE JX####################################
iptables -t nat -A PREROUTING -d 219.133.38.4 -p tcp --dport 443 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.84.161 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.88.18 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.84.159 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 219.133.60.220 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.84.159 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.82.32 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.84.160 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.82.38 -p tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -d 218.30.88.22 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -d 61.129.59.114 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 60.28.249.134 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 60.28.249.135 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 60.28.249.136 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.60 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.57 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 61.152.146.42 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.60 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 218.30.84.159 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.56 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.55 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.51 -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -d 211.152.52.58 -p tcp --dport 21 -j ACCEPT
########################Vi Server###############
iptables -A FORWARD -p tcp --dport 13196 -d 10.254.254.35 -j ACCEPT
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 13196 -j DNAT --to 10.254.254.35:13196
###########################END##################
########################Squid###################
iptables -t nat -A PREROUTING -i $LAN_IF1 -s $LAN_WD1 -p tcp --dport 80 -j REDIRECT --to-port 3128
########################END#####################
#INPUT-PUBLIC
iptables -A INPUT -s $MEIP1 -j ACCEPT
iptables -A INPUT -s $MEIP2 -j ACCEPT
iptables -A INPUT -i $LAN_IF1 -p icmp -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
#iptables -A INPUT -p tcp --syn -m state --state NEW -j DROP
################# limit tcp
#iptables -A INPUT -i $WAN_IF -p tcp --syn -m connlimit --connlimit-above 5 -j DROP
#iptables -A INPUT -i $WAN_IF -p tcp -m connlimit --connlimit-above 5 -j DROP
#INPUT-LAN
iptables -A INPUT -i lo -j ACCEPT
################# squid CACHE SERVER
iptables -A INPUT -i $LAN_IF1 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i $LAN_IF1 -p tcp --dport 3128 -j ACCEPT
################# DHCP SERVER
iptables -A INPUT -i $LAN_IF1 -p udp --dport 67:68 --sport 67:68 -j ACCEPT
#INPUT--WAN
################# SSH SERVER
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
################# DNS client
iptables -A INPUT -p udp --sport 53 -s $DNS1 -j ACCEPT
iptables -A INPUT -p udp --sport 53 -s $DNS2 -j ACCEPT
iptables -t nat -I PREROUTING -i $LAN_IF1 -p udp --dport 53 -j DNAT --to-destination 202.103.24.68:53
iptables -t nat -I PREROUTING -i $LAN_IF1 -p tcp --dport 53 -j DNAT --to-destination 202.103.24.68:53
################# WWW SERVER
iptables -A INPUT -i $WAN_IF -j DROP
###########################FORWARD################
iptables -A FORWARD -i lo -j ACCEPT
iptables -I FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -s $MEIP1 -j ACCEPT
iptables -A FORWARD -s $MEIP2 -j ACCEPT
iptables -A FORWARD -p icmp -j ACCEPT
### Deny ACK attack
#iptables -A FORWARD -i $WAN_IF -p tcp ! --syn -m state --state NEW -j DROP
iptables -A FORWARD -i $WAN_IF -p tcp --syn -m state --state NEW -j DROP
#
#iptables -A FORWARD -p tcp --syn -m connlimit --connlimit-above 20 --connlimit-mask 8 -j DROP
#iptables -A FORWARD -p tcp -m connlimit --connlimit-above 30 --connlimit-mask 8 -j DROP
##PatchClient############3
iptables -A FORWARD -d 61.129.44.143 -j ACCEPT
iptables -A FORWARD -d 218.249.71.250 -j ACCEPT
##Irc chat########3
iptables -A FORWARD -p tcp --dport 6667 -j ACCEPT
##404#使用的招生系统211.67.66.125.2443#9408############
iptables -A FORWARD -d 211.67.66.125 -j ACCEPT
iptables -A FORWARD -d 211.67.66.126 -j ACCEPT
iptables -A FORWARD -d 211.67.66.116 -j ACCEPT
##chuang qi shi fu###############
iptables -A FORWARD -d 222.218.156.26 -j ACCEPT
##ONLINE JX######################################
iptables -A FORWARD -p tcp --dport 6664 -j ACCEPT
iptables -A FORWARD -p tcp --dport 6663 -j ACCEPT
iptables -A FORWARD -p tcp --dport 6662 -j ACCEPT
iptables -A FORWARD -p tcp --dport 6661 -j ACCEPT
iptables -A FORWARD -p tcp --dport 5622 -j ACCEPT
#QQ AND QQGAME####################################
#iptables -A FORWARD -m layer7 --l7proto qq -j ACCEPT
iptables -A FORWARD -p tcp --dport 25 -j ACCEPT
iptables -A FORWARD -p tcp --dport 22 -j ACCEPT
iptables -A FORWARD -p udp --dport 8000 -j ACCEPT
#QQ chat##########################################
iptables -A FORWARD -p tcp --dport 16666 -j ACCEPT
#DNS CLIENT#######################################
iptables -A FORWARD -p tcp --dport 53 -j ACCEPT
iptables -A FORWARD -p udp --dport 53 -j ACCEPT
#port 443 is https and qq game####################
iptables -A FORWARD -p tcp --dport 443 -j ACCEPT
#port 554 is bbsky.wuhan.net.cn,movie.############
iptables -A FORWARD -p tcp --dport 554 -j ACCEPT
iptables -A FORWARD -p tcp --dport 110 -j ACCEPT
######卡丁车#########使用UDP多点连接。要开UDP很多端口才行#######
iptables -A FORWARD -p tcp --dport 39311 -j ACCEPT
#############泡泡堂##使用UDP多点连接。要开UDP很多端口才行#######
iptables -A FORWARD -p tcp --dport 3838 -j ACCEPT
iptables -A FORWARD -p tcp --dport 5858 -j ACCEPT
iptables -A FORWARD -p tcp --dport 33567 -j ACCEPT
iptables -A FORWARD -p tcp --dport 29865 -j ACCEPT
###################劲舞团######################################
iptables -A FORWARD -p tcp --dport 7000 -j ACCEPT
iptables -A FORWARD -p tcp --dport 15010 -j ACCEPT
#iptables -A FORWARD -p udp --dport 8000 -j ACCEPT
######QQ幻想####################################################
iptables -A FORWARD -d 61.172.204.124 -j ACCEPT
iptables -A FORWARD -d 219.133.61.21 -j ACCEPT
iptables -A FORWARD -p tcp --dport 7788 -j ACCEPT
iptables -A FORWARD -p tcp --dport 6628 -j ACCEPT
iptables -A FORWARD -p tcp --dport 6299 -j ACCEPT
######CS 1.5 1.6################################################
iptables -A FORWARD -p tcp --dport 27015:27017 -j ACCEPT
iptables -A FORWARD -p tcp --dport 27215:27217 -j ACCEPT
######浩方######################################################
iptables -A FORWARD -p tcp --dport 1201:1203 -j ACCEPT
iptables -A FORWARD -p tcp --dport 1531 -j ACCEPT
iptables -A FORWARD -p tcp --dport 1532 -j ACCEPT
######魔兽 世界 ################################################
iptables -A FORWARD -p tcp --dport 6112 -j ACCEPT
iptables -A FORWARD -p tcp --dport 3724 -j ACCEPT
iptables -A FORWARD -p tcp --dport 8000 -j ACCEPT
#iptables -A FORWARD -p udp --dport 8000 -j ACCEPT
#Thunder--deny,219.134.132.59 is Thunder login server!
#iptables -A FORWARD -d 219.134.132.59 -j DROP
iptables -A FORWARD -d 218.89.137.77 -j DROP
#BT--ipp2p###############deny all port##############################
iptables -A FORWARD -p tcp --dport 80 -j ACCEPT
#iptables -A FORWARD -p tcp --dport 21 -j ACCEPT
iptables -A FORWARD -p tcp --dport 1:65301 -j DROP
iptables -A FORWARD -p udp -j DROP
#DISBALE BT DOWN
for netIP in $IP ; do
iptables -A FORWARD -s 10.254.254.$netIP -j ACCEPT
done
#
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
#
#echo "1" > /proc/sys/net/ipv4/ip_dynaddr
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "255" > /proc/sys/net/ipv4/ip_default_ttl
echo "5000" > /proc/sys/net/ipv4/ip_conntrack_max
[[i] 本帖最后由 cexoyq 于 2006-8-26 23:06 编辑 [/i]] |
|