Portal Home > Knowledgebase > Articles Database > Can iptables be used to protect against DDoS?


Can iptables be used to protect against DDoS?




Posted by ttgt, 03-15-2016, 08:27 PM
Hi, is it possible to use iptables protect ddos, block the attack and only let clean connection to servers ?

Posted by nitha, 03-15-2016, 08:49 PM
iptables is only a firewall, you need to add some other softwares to block the connections. Go with csf and configure DDOS prevention settings , it will help to prevent ddos to an extent. If it is more, you need go for an external service like cloudfare or external firewall.

Posted by madRoosterTony, 03-15-2016, 08:51 PM
There is also DDos Deflate that works really well with IP Tables, but recommended you use it with APF / BFD or CSF

Posted by ttgt, 03-15-2016, 08:53 PM
Hi, because i look for http://routerboard.com/ and the support tell me it is builded with linux/iptables with some software,and people can use it for ddos with rules. can csf used for ddos protection ?

Posted by net, 03-15-2016, 09:26 PM
No, iptables will not protect you from ddos..

Posted by SkunkEyes, 03-15-2016, 09:35 PM
Assuming you are referring to this: http://wiki.mikrotik.com/wiki/DDoS_D...n_and_Blocking Or http://wiki.mikrotik.com/wiki/DoS_attack_protection It will filter by firewall rules, but I don't think it will stop what's already in the pipes. Hope this helps...

Posted by Bbnuse, 03-19-2016, 01:13 AM
You can use it through CSF to stop a small DDoS, but it won't protect you against a medium sized attack or a big one. You'll need a special protection for that, like an anti-DDoS service or even a hardware firewall.

Posted by ttgt, 03-19-2016, 04:20 AM
do you suggest any hardware firewall ?

Posted by Srv24x7, 03-19-2016, 09:27 AM
Hi, There is limitation in the Software Firewall. Huge DDoS are not mitigated through it. Hardware firewall is last choice if there is high DDoS. You got to check how much strength the incoming DDOS is having and then decide..

Posted by ttgt, 03-19-2016, 01:29 PM
Hi, The main difference between software and hardware firewall, Is it performance ? Or ?

Posted by vanmorrison, 03-19-2016, 02:05 PM
a complex set of iptables rules can be used to protect your server from a DDoS attack, as long as you have enough CPU power and the attack does not congest you network port capacity. this is a software firewall. a hardware firewall consists in one or more dedicated hardware devices which filter the network traffic before it hits your server and delivers only clean traffic. among other advantages, your CPU is not overloaded.

Posted by copahost, 03-19-2016, 07:45 PM
Iptables is mostly for port blocking. You can use APF or CSF for that (they are easier to configure). We strongly recommend using PFsense firewall (in a dedicated server, runs over FreeBSD). Blocking effectively a DDoS is a complex task. Depends on your link size, your hardware, etc. Big DDoS can be only blocked in BGP level (nullrouting the traffic).

Posted by ttgt, 03-19-2016, 11:59 PM
Hi, I know big ddos I need ask idc to null the ip, I just wonder if the ddos less than 1gb, Can I use server with iptable or other software to protect my servers ? Do you mean I install PFsense firewall on a dedicated server and setup other servers behind it ?

Posted by ttgt, 03-20-2016, 12:01 AM
Hi, Do you mean setup a separate server for firewall purpose will be fine ?

Posted by copahost, 03-20-2016, 06:03 AM
It depends. DDoS is a non-exact science. Remember: the bigger your uplink is, the safer you are, in general terms. You can ask your ISP if they have a similar firewall "before" your servers. This can make the job to automatically nullroute the attacker IPs in case. Most of the ISPs will block it before arriving to your server, transparently. Our advice is: you should only consider getting your own hardware firewall box (like pfsense, or others) if you have many servers hosted, or if your ISP doesn't provide such a thing.

Posted by ttgt, 03-20-2016, 08:02 AM
Hi, My isp do not offer such service and only null ip time later manually when they get un-normal bandwidth usage ,that is why I think to add a firewall.

Posted by HelpOps, 03-20-2016, 09:40 AM
Since your ISP null routes it's customers you will need to have protection that stops the attack before it reaches your datacenter network so you do not get null routed. You can use services like Akamai, CloudFlare that will act as a proxy for all of your traffic and you can deny all traffic in your firewall that is not from your DDoS/CDN provider's nodes, yourself and any other servers you want to have direct access to you origin server.

Posted by nitha, 03-20-2016, 08:47 PM
Hardware/external firewall will clean the traffic and pass it to the server. In case of software firewall the traffic is reached at server and need to handle by the server itself, even if it is blocked by software firewall. I suggest to go with cloudfare, since there is no external firewall offered by the DC.

Posted by ttgt, 03-20-2016, 08:53 PM
Hi, i offer shared hosting, i think i can not set all my sites to use cloudfare.

Posted by Layer03, 03-20-2016, 08:58 PM
You have cpanel server or an reseller account? Cloudflare offer a module to install on the main cpanel/whm server.

Posted by ttgt, 03-20-2016, 09:05 PM
Hi,yes,i have a cpanel server but i do not hope to use their nameserver.

Posted by SneakySysadmin, 03-21-2016, 03:18 PM
You can rate limit with iptables, which will help mitigate a DDoS, but the nature of a real distributed attack is that there are (usually) tens of thousands of IPs involved in the attack and blocking them individually becomes more effort than it's worth. Worse, using iptables means your network is still getting hammered with all those requests, you're just dropping them at the actual server. You're still paying for that bandwidth and those server resources - so iptables will help in that it might make your site usable again for "real" users, but it is not a permanent solution. For that you'll need DDoS protection services, or a provider willing to drop ACLs on their border routers to stop the DDoS traffic for you - which few are going to be willing to do.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
digitalxweb.net (Views: 712)
hostnine.com (Views: 727)


Language: