[SOLVED] Blocking class A IP Ranges with htaccess, some help please!
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Thanks a lot, in case anyone has same issue this is explained bellow
Quote:
Valid IP Addresses
IP addresses are in the form xxx.xxx.xxx.xxx and each of these four numbers is from 0-255.
You can enter partial addresses to restrict larger blocks of addresses:
1.2.3.4 Blocks one specific IP address
1.2.3. Blocks IP address in the range 1.2.3.0 to 1.2.3.255 (ie.. 1.2.3.xxx)
1.2. Blocks IP address in the range 1.2.xxx.xxx
1.2 Blocks IP address in the range 1.2xx.
So for B Classes here is an example how to do it to block B Class IP 101.3.55.66:
RewriteEngine On
order allow,deny
deny from 103.3.
allow from all
Thanks again!! Just one last favor jlinkels can you just confirm me that I understand it correctly please?
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195
Rep:
Quote:
Originally Posted by codeman1234
So for B Classes here is an example how to do it to block B Class IP 101.3.55.66:
RewriteEngine On
order allow,deny
deny from 103.3.
allow from all
Thanks again!! Just one last favor jlinkels can you just confirm me that I understand it correctly please?
This blocks 103.3.0.0 until 103.3.255.255. Not 101.3.55.66, but that might be a type. And addresses are nowadays classless, so the range is correct but it is not called class B anymore.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.