Page 1 of 1

IP banning - only a specific IP

Posted: Wed Sep 17, 2014 3:56 pm
by Aycliffe
Hi all, and please forgive me if in the incorrect place.

I wish to ban an IP address, but not a full one. How can I do this?
The one I wish to ban starts in 88.150 and this is all I want to block. Is there a way to do this?

Kindest,

Tom

Re: IP banning - only a specific IP

Posted: Wed Sep 17, 2014 4:04 pm
by cleverwise
If you are comfortable editing your htaccess file:

Code: Select all

order allow,deny
deny from 88.150.
allow from all
Note: If you already have deny from entries, then just add the deny from 88.150. line.

Many control panels like cPanel, Plesk, etc have ways to block IPs too. If you use .htaccess you'll block the IPs from your whole website and not just phpBB, which is what happens if you use phpBB banning.

Re: IP banning - only a specific IP

Posted: Wed Sep 17, 2014 4:19 pm
by stevemaury
You can use wildcards in the IP ban settings in phpBB. It's a waste of time, though

Re: IP banning - only a specific IP

Posted: Thu Sep 18, 2014 6:56 pm
by cleverwise
Well if someone is getting slammed by a specific A block or B block IP range that would be easy to stop. However listing individual IPs can get very annoying.

As for doing it at phpBB or web server levels both have advantages and disadvantages.

phpBB level is easier as it is in the admin panel of the software and requires no editing of files. However this still puts load on your database since phpBB must fire on each load. Plus it only protects phpBB, although not an issue if that is all a site runs.

The .htaccess (or web server) level can be a bit more complex but is faster and doesn't require phpBB. It saves on database load as the database isn't used. Plus it will work for any software on the site.

If these are the two options available, which is most people, then those are the main options. However if you have access to a firewall (software or hardware based) I suggest that route. Firewalls are the better approach at stopping access to sites and devices.

Re: IP banning - only a specific IP

Posted: Mon Sep 22, 2014 12:00 am
by mack the knife
Hiya,

Re: .htaccess

I've been getting hammered with requests visiting my website and used the Stop Forum Spam website to block them from slowing my web forum down. I made a note of the IP addresses and put them in the .htaccess file. This seems to work using .htaccess

I'm on shared hosting.

The spammers never got to my site but the IP's were creating a considerable load on the server.

Order Deny,Allow
Deny from ***.58.100.0/24
Deny from ***.244.93.115
Deny from ***.201.224.32
Deny from ***.201.224.34
Deny from ***.204.239.115
Deny from ***.91.24.203
Deny from ***.151.144.242

I didn't add "allow from all" in it though below the list. Should I add it?

Website running much faster after doing this.

Did I do right?

Mack

Re: IP banning - only a specific IP

Posted: Mon Sep 22, 2014 12:06 am
by mack the knife
Just to add I partially blanked off posting the IP's blocked in my previous post with ***

Cheers,

Mack

Re: IP banning - only a specific IP

Posted: Mon Sep 22, 2014 3:14 pm
by cleverwise
That should work. If you want to test add your IP to the list and see if you are blocked. Then remove your IP. :)

Re: IP banning - only a specific IP

Posted: Mon Sep 22, 2014 11:49 pm
by mack the knife
Cheers cleverwise :)

Mack

Re: IP banning - only a specific IP

Posted: Mon Sep 29, 2014 2:08 am
by MontanaBighorn
I utilize command line in my Linux based firewall. I run the IP through http://whois.arin.net which then gives you the CIDR for the IP address. I take that information and enter it in the command tab of my router:

iptables -I INPUT -s xx.xx.xx.0/24 -j DROP

Let your router do the work; its much faster than utilizing server resources.

Re: IP banning - only a specific IP

Posted: Sat Apr 18, 2015 12:46 pm
by Mikado14
I realize that this is a partially dead if not dead thread but I am having an issue'

I am operating PHPBB version 3.0.11

I am having an issue of someone coming on the forum from a specific IP provided by At&t Wi-fi Services (wayport public access). I have repeatedly blocked the IP but it is still coming into the forum which is validated by StatCounter. I have tried erasing the IP and reentering it. I have used a wildcard and still it enters.

How is it still getting into the forum even though blocked? I don't want to go into the cpanel if not necessary and write into .htaaccess if I don't have to.

Any help or explanation would be and is greatly appreciated.

Mikado

Re: IP banning - only a specific IP

Posted: Sat Apr 18, 2015 2:38 pm
by stevemaury
"Enter" in what way? Register, post, what?

Re: IP banning - only a specific IP

Posted: Sat Apr 18, 2015 3:05 pm
by Mikado14
When I say "reentering", I am referring to the ability to come to the site and navigate around to the various threads.

When I block IP's, they get a message informing them that they are blocked from viewing. That message shows up on the StatCounter as an information page.

When I block this particular IP, they still can enter the site and navigate even though their IP is banned.

Hope I made myself clear. This is the only IP that even though banned, can still enter the site. The IP is recorded on the StatCounter.

Thanks,

Mikado

Re: IP banning - only a specific IP

Posted: Sat Apr 18, 2015 9:19 pm
by Oyabun1
If you are banning the IP through phpBB that only stops whatever is using that IP from registering or logging in. It does not prevent it viewing the site as a guest.

Re: IP banning - only a specific IP

Posted: Sat Apr 18, 2015 10:02 pm
by Mikado14
I disagree with you. I know from experience when I inadvertently blocked the IP of someone I knew and when they went to the site, they immediately got a dialog box when they attempted to view any of the threads as a guest. They called me and I unblocked their IP.

StatCounter also shows a blocked IP when they enter on the Index page but if they go to a forum thread, a dialog box comes up informing them of being banned and that dialog box shows up in the StatCounter.

Mikado