Recently my FreeBSD 8.0 (GENERIC) box was hit with a large amount of requests from an IP in Taiwan, trying to guess passwords and all of that stuff. Anyway, long story short, I noticed at a certain point I couldn't ssh into the box. After logging in directly, I noticed a huge number of password guesses, and the message msk0: watchdog timeout
. msk0 referring to my wired ethernet connection.
I brought the interface back up with ifconfig msk0 up
, and was successfully able to ping the address of that interface. However, when trying to ping my main router, which the box is directly connected to, it hung. Attempting to ping my external IP address returned a whole bunch of sendto: no buffer space available
.
The problem was resolved with a reboot, but obviously this isn't the ideal way to go about it. In the case of something like this happening again, what steps should I take to restore connectivity? I've read that sometimes it can be prevented with watchdog -t 0
, but I'm not sure I want to go down that avenue.
When it comes to prophylaxis, is there a way to refuse connections from IPs that have a certain number of failed logins for a certain period of time? For example, 15 failed logons would result in refused connections for the next twelve hours?