FlexHub Forum

Solution attacers Flexhub vps firewall

Solution attacers Flexhub vps firewall
« on: December 11, 2013, 01:32:40 »
The reason that my hub stops somtimes could be attackers who try to break in..
Ip tabels firewall for protecting hub..

In debian >> apt-get install iptables

# Refuse forward accept output rules
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# incoming traffic
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

# localhost accept
iptables -A INPUT -i lo -j ACCEPT

# acces from your own ip (whatsmyip.org to get external ip)
iptables -A INPUT -p tcp --dport 22 -s xx.xxx.xxx.xxx -j ACCEPT

# Port 80 For webserver
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

# Port 411 for the hub
iptables -A INPUT -p tcp --dport 411 -j ACCEPT

# Allow pingflood only for you own adress
iptables -A INPUT -p icmp -s xx.xxx.xxx.xxx -j ACCEPT (your own extern ipadres)

# Drop the attackers
iptables -I INPUT -s 218.28.116.227 -j DROP
iptables -I INPUT -s 128.134.37.58 -j DROP
iptables -I INPUT -s 195.191.25.41 -j DROP
iptables -I INPUT -s 222.172.220.30 -j DROP
iptables -I INPUT -s 88.198.218.156 -j DROP

# The last step deny all other traffic Do This at the end!..
iptables -P INPUT DROP

# Save rules for ip tables
mkdir /etc/iptables/ iptables-save > /etc/iptables/myrules
nano /etc/network/if-up.d/iptables

# make executeble
chmod +x /etc/network/if-up.d/iptables

Test it >>
iptables -L

Working for me ;)

Re: Solution attacers Flexhub vps firewall
« Reply #1 on: December 11, 2013, 01:43:21 »
Little correction    ;D

nano /etc/network/if-up.d/iptables

#!/bin/sh iptables-restore < /etc/iptables/myrules

save it wot crtl o

Have found it here ( In dutch)  ;D
http://debian.weijers.net/index.php?artikel=Firewall+instellen