# IP address being blocked, that isn't on the blocked list

**URL:** <https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833>\
**Category:** Product Support\
**Created:** [May 18, 2018, 2:00pm UTC](https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833 "2018-05-18T14:00:19Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

[tim.smith](/t/-/87833/1) reports an issue where a user is blocked from logging in with the error "You can't log in as _username_ from that IP address," despite the user's IP (148.64.2.45) falling within the whitelisted range of `148.64.0.0/21`. [codinghorror](/t/-/87833/2) suggests that the IP addresses may not be correctly sent to the application due to unusual proxy or routing configurations and advises testing by adding a known IP to the block list to verify functionality. [tim.smith](/t/-/87833/3) confirms the root cause: because the site uses AWS CloudFront, Discourse sees all users as having an IP address belonging to AWS CloudFront rather than their actual public IPs, which explains why the specific IP whitelist is not working as intended.

<div class="post-metadata">

**Author:** ![tim.smith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tim.smith/32/119954_2.png) [@tim.smith](https://meta.discourse.org/u/tim.smith)\
**Post date:** [May 18, 2018, 2:00pm UTC](https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833/1 "2018-05-18T14:00:19Z")

</div>

One of my users is unable to log in. He’s getting the error “You can’t log in as _username_ from that IP address” (where _username_ is his actual username). I’ve whitelisted `148.64.0.0/21`, which should match his public IP. It’s 148.64.2.45, according to google. Here’s my Screened IPs config:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/a/eadca775948721f136b05e618ace6a5055a9e27e.png)

Any ideas why this person is being blocked? What else can I do to troubleshoot this?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [May 18, 2018, 11:25pm UTC](https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833/2 "2018-05-18T23:25:02Z")

</div>

Looks correct to me.. are IP addresses not correctly sent to the app via unusual proxy/routing config? What happens when you test this by adding a test IP to the block list, then logging in from that IP?

---

<div class="post-metadata">

**Author:** ![tim.smith](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tim.smith/32/119954_2.png) [@tim.smith](https://meta.discourse.org/u/tim.smith)\
**Post date:** [May 21, 2018, 2:02pm UTC](https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833/3 "2018-05-21T14:02:49Z")

</div>

It turns out that due to using AWS CloudFront, discourse sees all users as having an IP address belonging to AWS CF.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [May 21, 2018, 6:49pm UTC](https://meta.discourse.org/t/ip-address-being-blocked-that-isnt-on-the-blocked-list/87833/4 "2018-05-21T18:49:47Z")

</div>

Closed on May 21, 2018, 6:49pm UTC


