The 1000th time: NO, you can’t protect your website by IP restrictions.
Attackers could use use proxies or spoof their IP’s.
If you really encounter some sort of heavy traffic from one single IP, you could temporarily block this IP using a system-wide firewall rule (check iptables
). Temporary because this IP will likely change frequently. Doing so would prevent hackers from exhausting the TCP connection table, but the traffic would still stress your network card, and the router you’re behind + your bandwith.
If you encounter such situations, report this immediately to your web hoster.
5
solved Ip Restriction with .httacces [closed]