My server is behind OpenWrt but for some reason i cannot get on my servers the client's real ip address

everything seems ok

basically in the nginx log it shows the router/the gateway ip address. which is weird. why it not shows the real ip address?

another weird is that in the error, you can see the valid client ip address:
2021/05/27 21:16:45 [error] 69414#69414: *313005 access forbidden by rule, client: 35.233.23.228, server: webhook.patrikx3.com, request: "GET /wp-login.php HTTP/1.1", host: "webhook.patrikx3.com", referrer: "http://webhook.patrikx3.com/wp-login.php

Did you upgrade or install anything? Did you have any config backups (via the System part of config UI) that you can check against?

nope, do not know exactly when it started going bad.

reference, similar problem:

Source address masquerading can be the result of a firewall SNAT rule:

  • LuCI > Network > Firewall > NAT Rules

what does it mean?

empty, no nat rule at all

iptables-save -c -t nat
Also run the opkg update; opkg install tcpdump; tcpdump -i any -evn tcp port 443 or tcp port 80 to capture some packets, stop with Ctrl-c after you have captured some.

1 Like

Detach the LAN network from the zone sygnusvpn and/or disable masquerading on that zone.

same result, it still thinks it is my router is the client ip, and because of this it always thinks i am in my local network and my domain that are secured by network/ip now all open because of this, given the client ip is 192.168.78.1 instead of the real, so all domains open, so crazy.

ok, if i disable the sysgnusvpn zone it works, but the problem is i need to access that sygnusvpn on my lan.
how can i access the sygnusvpn on my lan and make it works with the remote_addr variable?

it was working both at once, why is it bad now?

Try this:

uci set firewall.@zone[3].masq_dest="!192.168.78.20/32"
uci commit firewall
/etc/init.d/firewall restart
5 Likes

thanks so much!
it works now!
perfect!
take care!
you are a GOD @vgaetera !

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.