# Ip-restriction not working through a NLB

**URL:** <https://discuss.konghq.com/t/ip-restriction-not-working-through-a-nlb/2589>\
**Category:** Questions\
**Created:** [January 10, 2019, 6:20pm UTC](https://discuss.konghq.com/t/ip-restriction-not-working-through-a-nlb/2589 "2019-01-10T18:20:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stupid48](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@stupid48](https://discuss.konghq.com/u/stupid48)\
**Post date:** [January 10, 2019, 6:20pm UTC](https://discuss.konghq.com/t/ip-restriction-not-working-through-a-nlb/2589/1 "2019-01-10T18:20:41Z")

</div>

For the life of me, I can’t seem to get ip-restriction to work since I’ve got an F5 in front. This is 0.13.1. In the kong.conf, I’ve got:

trusted\_ips = 0.0.0.0/0,::0  
real\_ip\_header = X-Forwarded-For  
real\_ip\_recursive = off

I’m 100% sure that the F5 is sending the X-Forwarded-For address to kong. The reason I know that is that I made a quick modification to the access\_log settings in nginx,lua as follows:

log\_format main '$remote\_addr - $remote\_user [$time\_local] “$request” ’  
'$status $body\_bytes\_sent “$http\_referer” ’  
‘“$http\_user\_agent” “$http\_x\_forwarded\_for”’;

$remote\_addr is the F5 and $http\_x\_forwarded\_for is the real client’s ip address.

I know this has been asked many times but I just can’t seem to figure it out.

---

<div class="post-metadata">

**Author:** ![stupid48](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@stupid48](https://discuss.konghq.com/u/stupid48)\
**Post date:** [January 10, 2019, 10:48pm UTC](https://discuss.konghq.com/t/ip-restriction-not-working-through-a-nlb/2589/3 "2019-01-10T22:48:49Z")

</div>

Nevermind. I had a typo in my config. Thanks anyway.

---

<div class="post-metadata">

**Author:** ![p0pr0ck5](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/p0pr0ck5/32/987_2.png) [@p0pr0ck5](https://discuss.konghq.com/u/p0pr0ck5)\
**Post date:** [January 10, 2019, 11:18pm UTC](https://discuss.konghq.com/t/ip-restriction-not-working-through-a-nlb/2589/4 "2019-01-10T23:18:35Z")

</div>

Thanks for the report! Mind marking this resolved?
