Apache/2.4.6 - block a large ip range with Require not ipApache shows “Forbidden” error with...
Was there a Viking Exchange as well as a Columbian one?
How can I practically buy stocks?
Pulling the rope with one hand is as heavy as with two hands?
Do I have an "anti-research" personality?
Size of electromagnet needed to replicate Earth's magnetic field
How to make a pipeline wait for end-of-file or stop after an error?
Unexpected email from Yorkshire Bank
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
In order to check if a field is required or not, is the result of isNillable method sufficient?
Please, smoke with good manners
Is there an official tutorial for installing Ubuntu 18.04+ on a device with an SSD and an additional internal hard drive?
What does it mean to express a gate in Dirac notation?
Examples of subgroups where it's nontrivial to show closure under multiplication?
Normal Map bad shading in Rendered display
How to stop co-workers from teasing me because I know Russian?
How come there are so many candidates for the 2020 Democratic party presidential nomination?
Exchange,swap or switch
Is the claim "Employers won't employ people with no 'social media presence'" realistic?
How to have a sharp product image?
What are the potential pitfalls when using metals as a currency?
How to reduce LED flash rate (frequency)
Does Gita support doctrine of eternal cycle of birth and death for evil people?
Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?
Does holding a wand and speaking its command word count as V/S/M spell components?
Apache/2.4.6 - block a large ip range with Require not ip
Apache shows “Forbidden” error with “FollowSymLinks”Apache - block requests to my IP addressUploadify with apache authenticationSetting up an apache virtual host with working overrideRate-limit Apache with Blacklist and Whitelisthow to set up a deny rule (e.g. Apache) to block a IP if it connects more than e.g. 5 times per second?Folder password with Apache and Nginx for external connectionsAuthentication against LDAP on Apache fails with password mismatchHow to prevent people from rewriting my .htaccess fileApache 2.4 'require host not' works but gives repeated AH01753 [authz_host:error] in apache error log
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm using Require not ip in .htaccess for some time now and it works well for me. I need to block a large range of IPs such as 18.128.0.0-18.255.255.255.
Should i do it line by line
Require not ip 18.128
Require not ip 18.129
Require not ip 18.130
.
.
Require not ip 18.255
or is it possible to do it all in one line?
apache-http-server
New contributor
add a comment |
I'm using Require not ip in .htaccess for some time now and it works well for me. I need to block a large range of IPs such as 18.128.0.0-18.255.255.255.
Should i do it line by line
Require not ip 18.128
Require not ip 18.129
Require not ip 18.130
.
.
Require not ip 18.255
or is it possible to do it all in one line?
apache-http-server
New contributor
add a comment |
I'm using Require not ip in .htaccess for some time now and it works well for me. I need to block a large range of IPs such as 18.128.0.0-18.255.255.255.
Should i do it line by line
Require not ip 18.128
Require not ip 18.129
Require not ip 18.130
.
.
Require not ip 18.255
or is it possible to do it all in one line?
apache-http-server
New contributor
I'm using Require not ip in .htaccess for some time now and it works well for me. I need to block a large range of IPs such as 18.128.0.0-18.255.255.255.
Should i do it line by line
Require not ip 18.128
Require not ip 18.129
Require not ip 18.130
.
.
Require not ip 18.255
or is it possible to do it all in one line?
apache-http-server
apache-http-server
New contributor
New contributor
New contributor
asked yesterday
Boaz YahavBoaz Yahav
31
31
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Require ip
accepts CIDR "prefix length" notation (address/plen, where plen is the number of '1' bits in the netmask). The range you show is written as 18.128.0.0/9.
This is also usually the preferred notation even for networks which exactly fit octet bounaries: that is, instead of Require ip 192.168
you should write Require ip 192.168.0.0/16
(similarly /8, /24).
If you have Python installed, you can use a script to convert start & end addresses into a prefix mask (or a list of masks):
#!/usr/bin/env python3
import ipaddress, sys
a = ipaddress.ip_address(sys.argv[1])
b = ipaddress.ip_address(sys.argv[2])
n = ipaddress.summarize_address_range(a, b)
for net in n:
print(net)
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Boaz Yahav is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429864%2fapache-2-4-6-block-a-large-ip-range-with-require-not-ip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Require ip
accepts CIDR "prefix length" notation (address/plen, where plen is the number of '1' bits in the netmask). The range you show is written as 18.128.0.0/9.
This is also usually the preferred notation even for networks which exactly fit octet bounaries: that is, instead of Require ip 192.168
you should write Require ip 192.168.0.0/16
(similarly /8, /24).
If you have Python installed, you can use a script to convert start & end addresses into a prefix mask (or a list of masks):
#!/usr/bin/env python3
import ipaddress, sys
a = ipaddress.ip_address(sys.argv[1])
b = ipaddress.ip_address(sys.argv[2])
n = ipaddress.summarize_address_range(a, b)
for net in n:
print(net)
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
add a comment |
Require ip
accepts CIDR "prefix length" notation (address/plen, where plen is the number of '1' bits in the netmask). The range you show is written as 18.128.0.0/9.
This is also usually the preferred notation even for networks which exactly fit octet bounaries: that is, instead of Require ip 192.168
you should write Require ip 192.168.0.0/16
(similarly /8, /24).
If you have Python installed, you can use a script to convert start & end addresses into a prefix mask (or a list of masks):
#!/usr/bin/env python3
import ipaddress, sys
a = ipaddress.ip_address(sys.argv[1])
b = ipaddress.ip_address(sys.argv[2])
n = ipaddress.summarize_address_range(a, b)
for net in n:
print(net)
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
add a comment |
Require ip
accepts CIDR "prefix length" notation (address/plen, where plen is the number of '1' bits in the netmask). The range you show is written as 18.128.0.0/9.
This is also usually the preferred notation even for networks which exactly fit octet bounaries: that is, instead of Require ip 192.168
you should write Require ip 192.168.0.0/16
(similarly /8, /24).
If you have Python installed, you can use a script to convert start & end addresses into a prefix mask (or a list of masks):
#!/usr/bin/env python3
import ipaddress, sys
a = ipaddress.ip_address(sys.argv[1])
b = ipaddress.ip_address(sys.argv[2])
n = ipaddress.summarize_address_range(a, b)
for net in n:
print(net)
Require ip
accepts CIDR "prefix length" notation (address/plen, where plen is the number of '1' bits in the netmask). The range you show is written as 18.128.0.0/9.
This is also usually the preferred notation even for networks which exactly fit octet bounaries: that is, instead of Require ip 192.168
you should write Require ip 192.168.0.0/16
(similarly /8, /24).
If you have Python installed, you can use a script to convert start & end addresses into a prefix mask (or a list of masks):
#!/usr/bin/env python3
import ipaddress, sys
a = ipaddress.ip_address(sys.argv[1])
b = ipaddress.ip_address(sys.argv[2])
n = ipaddress.summarize_address_range(a, b)
for net in n:
print(net)
edited yesterday
answered yesterday
grawitygrawity
245k37517578
245k37517578
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
add a comment |
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
Wow, that was fast. Added it and will monitor to make sure it does the job. Thanks!
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
I found this site that does the job : ipaddressguide.com/cidr Thanks again for the great help
– Boaz Yahav
yesterday
add a comment |
Boaz Yahav is a new contributor. Be nice, and check out our Code of Conduct.
Boaz Yahav is a new contributor. Be nice, and check out our Code of Conduct.
Boaz Yahav is a new contributor. Be nice, and check out our Code of Conduct.
Boaz Yahav is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429864%2fapache-2-4-6-block-a-large-ip-range-with-require-not-ip%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown