# DDoS and interface down?



## BernardoCR (May 18, 2012)

Every time my server get*s* a large DDoS attack, my network connection seems to hang, and only gets back if I login to the server through KVM and make an [cmd=]ifconfig ix0 down[/cmd] and [cmd=]ifconfig ix0 up[/cmd]

I don't know what is making the network interface freeze, or if it's another problem, but I wonder if someone has already experienced this and ha*s* a clue how to solve this.

Thank you.


----------



## jailed (May 18, 2012)

Hello,

I don't know the reason of this problem but I can suggest you a solution to make your job easier.

You can write a shell script to ping an outside host (for example google.com) and check that Internet is up or down, and then if it's down, restart the interface with ifconfig. Then add this script to cronjobs to run every minute. If you don't know how to write a script like that, I can do it for you. It takes 1-2 minutes. This will save you for connecting via KVM and restarting the interface manually when you aware of the DDoS.


----------



## BernardoCR (May 18, 2012)

That's a really good idea. 

It would be great if you could help writing the script.

Thank you jailed!


----------



## BernardoCR (May 18, 2012)

Actually, I found one on the net. Would that work?



> #!/bin/bash
> # Simple SHELL script for Linux and UNIX system monitoring with
> # ping command
> # -------------------------------------------------------------------------
> ...


----------



## BernardoCR (May 19, 2012)

I've tested, it works.

Thanks!


----------

