Blocking ips from access
Hello all , i am in need of help....i am needing to block certain ip address from accessing my web server. how do i block the ip ...also i want to blook google bot as well
|
Blocking IP addresses is easy. You might want to read up (howto, man page etc.) on iptables so you generally understand what is going on, but basically the rules you want to add (one per IP address) would look like one of the following:
Code:
iptables -A INPUT -s <IP address> -j DROP But do read up some first -- it does matter where you put these rules wrt the rest of the firewall rules. I've never run a web server, but I thought you asked web crawlers such as Google's to stay out with a robots file. Other than that, the only thing I would know to do would be to block the IP addresses at the firewall ... if you can find out the IP addresses. |
Do you have a separate firewall?
Is your web server in a DMZ? For instance, if I wanted a web server in a DMZ, my SmoothWall Express box could add those blocking rules through its web interface. |
To expand on blackhole54's reply, if your web server is on the same machine as your firewall, you should insert the iptables rule in the INPUT chain; if your firewall is on some other machine between the web server and the Internet, insert the blocking rule in the FORWARD chain.
It is also correct to note that all you can do wrt the Google robots is to ask them to leave your server alone. Most web crawlers will do this, but not all. To complicate things considerably, most of the big crawlers operate from many IP addresses, and share info among themselves, so the IP address that looks at the robots.txt file may not be the same one that actually sends a query to your server. More info than you probably want to know can be found at the robots.txt FAQ |
Well, what did you do, how did it work out?
|
thanks
well....i learned how to set up the ip filter...also i learned about the google bot and how it works. also learned how to modify and use robots.txt. so all in all i am pretty satisfied i had sevral emails from member from this forum, so i wanted to thank everyone for their help.
|
All times are GMT -5. The time now is 02:38 PM. |