pyed / ipfilter

ipfilter is a middleware for Caddy that blocks or allows requests based on the client's IP
https://caddyserver.com/docs/ipfilter
Apache License 2.0
83 stars 19 forks source link

Range and Single IP's don't work together. #7

Closed dragon2611 closed 8 years ago

dragon2611 commented 8 years ago

Orginally posted on the caddy Github but was pointed to here,

if you are filing a bug report, please answer these questions. If your issue is not a bug report, you do not need to use this template. Either way, please consider donating if we've helped you. Thanks!

  1. What version of Caddy are you running (caddy -version)?

0.82

  1. What are you trying to do?

Add both single IP's and ranges to IP filter as per documentation.

  1. What is your entire Caddyfile?

Do not wish to provide.

However to reproduce create an IP filter and list multiple IP's with some ranges e.g

ipfilter /mydirectory { rule allow ip 192.168.1.1 10.0.0.3 10.0.17.0-254 10.0.24.0-255 }

  1. How did you run Caddy (give the full command and describe the execution environment)?

N/A

  1. What did you expect to see?

All traffic from listed IP's allowed

  1. What did you see instead (give full error messages and/or log)?

Traffic sourced from an IP within the defined Ranges appears to be allowed, however traffic sourced from one of the individual IP's listed is NOT allowed, If you remove the Ranges from the config then the single IP's are then granted access.

pyed commented 8 years ago

will look into it when i get home, which will take ~5 days.

pyed commented 8 years ago

sorry about the late response, this issue actually doesn't exist with ipfilter, but caddyserver.com is providing an old version of ipfilter that has it, @mholt will probably fix it soon.

pyed commented 8 years ago

it is fixed now, you can download a new version from caddyserver.com with ipfilter, and it should work as expected.