Iptables and DDoS attacks
Hello iptables Team,
Is it possible to protect a server against DDoS attacks using iptables?
Thank you.
Am 10.08.23 um 09:16 schrieb [email protected]:
Quoted 2 lines
Hello iptables Team,
Is it possible to protect a server against DDoS attacks using iptables?
depends on the attack - if it's bandwith *nothing* on your side can do anything against it
for request-based attacks xt_recent for ratelimits works well
Quoted 11 lines
Am 10.08.23 um 09:16 schrieb [email protected]:
Quoted 2 lines
Hello iptables Team,
Is it possible to protect a server against DDoS attacks using iptables?depends on the attack - if it's bandwith *nothing* on your side can do anything against it
for request-based attacks
xt_recentfor ratelimits works well
Hello,
Thank you so much for your reply.
How do hardware firewalls that use Linux prevent these attacks?
Can you show me some iptables rules about limitation?
The first thing to do is:
iptables -t mangle -I 1 PREROUTING -m state --state INVALID -j DROP
This will drop all TCP packets that have an INVALID state (to wit, netfilter is unable to correlate these packets to an existing connection). Since they are INVALID, do not spend even a nanosecond more time processing them; just dump them in the bit bucket.
After that, add rules that drop all packets to and from internet hosts and networks that you already know you want no contact with (pron, sleaze, warez, et alia); ipset is good for this.
In order to reduce said traffic on your downlink, you would have to ask your upstream (ISP?) to implement some sort of rate limiting on your link to let more legitimate traffic through.
The only way to possibly thwart DDoS is to require all ISPs and other leaf providers to implement reverse path filtering. Packets that claim to arrive on their downstream links that have IP addresses that do not reside on their DS links are to be dropped. E.g., if a Comcrash customer started sending packets purporting to be from 8.8.8.8, Comcrash should silently drop those packets (well, unless Google is a customer), and warn the security team when a customer persists in spoofing SRC IP addresses. (Of course, this likely doesn't address all forms of DDoS; your mileage will vary.)
N
Quoted 18 lines · On Sun, 13 Aug 2023 15:34:32 -0400 [email protected] wrote:
Quoted 11 lines
Am 10.08.23 um 09:16 schrieb [email protected]:
Quoted 2 lines
Hello iptables Team,
Is it possible to protect a server against DDoS attacks using iptables?depends on the attack - if it's bandwith *nothing* on your side can do anything against it
for request-based attacks
xt_recentfor ratelimits works wellHello,
Thank you so much for your reply.
How do hardware firewalls that use Linux prevent these attacks?Can you show me some iptables rules about limitation?