Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- IPT="/sbin/iptables"
- $IPT -F
- $IPT -X
- $IPT -Z
- $IPT -P INPUT ACCEPT
- $IPT -P OUTPUT ACCEPT
- $IPT -P FORWARD DROP
- $IPT -F INPUT
- $IPT -F OUTPUT
- $IPT -F FORWARD
- # l2top
- L2TOP=91.121.37.31
- #SITE
- $IPT -A INPUT -p tcp -i eth0 --dport 80 -m connlimit --connlimit-above 3 -j DROP
- $IPT -A INPUT -p tcp -i eth0 --dport 80 -j ACCEPT
- # Stat
- WEBCMS=127.0.0.1
- $IPT -A INPUT -s 127.0.0.1/255.0.0.0 ! -i lo -j DROP
- $IPT -A INPUT -i lo -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate INVALID -j DROP
- $IPT -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
- #Panel
- iptables -I INPUT -p tcp -i eth0 -s 109.254.0.0/16 --dport 10000 -j ACCEPT
- ###L2top
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $L2TOP --dport 2106 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $L2TOP --dport 7777 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $L2TOP --dport 2107 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $L2TOP --dport 8888 -j ACCEPT
- ###Stat
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $WEBCMS --dport 2106 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $WEBCMS --dport 7777 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $WEBCMS --dport 2107 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s $WEBCMS --dport 8888 -j ACCEPT
- ###MySQL
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s 127.0.0.1 --dport 3306 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s 109.254.0.0/16 --dport 3306 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s 176.31.1.176 --dport 3306 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s 178.158.130.55 --dport 3306 -j ACCEPT
- ###SSH
- ###$IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 -s 109.254.0.0/16 --dport 22 -j ACCEPT
- $IPT -A INPUT -m conntrack --ctstate NEW -p tcp -i eth0 --dport 15914 -j ACCEPT
- ###Users
- $IPT -A INPUT -p tcp -i eth0 --dport 2106 -m connlimit --connlimit-above 3 -j DROP
- $IPT -A INPUT -p tcp -i eth0 --dport 2106 -j ACCEPT
- $IPT -A INPUT -p tcp -i eth0 --dport 7777 -m connlimit --connlimit-above 3 -j DROP
- $IPT -A INPUT -p tcp -i eth0 --dport 7777 -j ACCEPT
- $IPT -A INPUT -j DROP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement