Can iptables really stop a DoS or DDos attack? I'm asking this because I've heard that there really isn't a way to stop a viscious DoS attack. If you find out the IP address of the attacker, you could add a rule such as:
iptables -I INPUT -s ipaddress -j DROP
Is it that easy to stop a "packet kiddie"? Or what about a ddos attack that comes from multiple IPs. I guess in that case you could drop an entire class b / class c IP address.
Also, I heard there is a way to re route those packets so the attacker would be essentially attacking himself. How is this done?
DoS and DDoS can be stopped, but not super easily. lets say they are DDoS'ing you just by sending you massive amounts of data. even if you drop the packets you're still getting that massive amount of data, and you're bandwidth is too small to handle it. the solution is to have someone upstream stop it, like your isp.
DoS if the ip had enough bandwidth could do the same.
sometimes DoS aren't done with bandwidth. let's say there is a bug in apache that lets a user throw the server into an infinite loop of new requests, the server is so busy processing those that other (real) users are denied.