I tried quite a few different setups but for some reason traefik can't get the real IP address of the client.
As a result GeoBlock is not able to block any incoming requests because all requests are treated as local traffic.
Here's an excerpt from traefik's log:
INFO: GeoBlock: 2023/04/29 18:23:32 Local ip allowed: 172.18.0.1
I'd be really thankful for indicating how to make treafik to get the real client IP so GeoBlock can do its job :)
Discovering Client IP
To check the client IP address on the host (rpi) I ran tcpdump with simple filter and the client IP was correct, e.g: 76.121.115.131:
portainer@portainer:~ $ sudo tcpdump -i eth0 -n 'port 80 or port 443'
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
18:24:57.534844 IP 76.121.115.131.25587 > 192.168.2.100.443: Flags [S], ...
18:24:57.534966 IP 192.168.2.100.443 > 76.121.115.131.25587: Flags [S.], ...
...
When I ran the same tcpdump filter inside the traefik container,
then the IP address of the client was set to the proxy network gateway 172.18.0.1:
/ # apk add tcpdump
/ # tcpdump -i eth0 -n 'port 80 or port 443'
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
18:23:32.228121 IP 172.18.0.1.39766 > 172.18.0.2.443: Flags [S], ...
18:23:32.228271 IP 172.18.0.2.443 > 172.18.0.1.39766: Flags [S.], ...
...
The proxy netwok was created with docker network create proxy.
proxy network details:
Hi,
I tried quite a few different setups but for some reason
traefik
can't get the real IP address of the client. As a resultGeoBlock
is not able to block any incoming requests because all requests are treated as local traffic. Here's an excerpt from traefik's log:I'd be really thankful for indicating how to make
treafik
to get the real client IP soGeoBlock
can do its job :)Discovering Client IP
To check the client IP address on the host (rpi) I ran
tcpdump
with simple filter and the client IP was correct, e.g:76.121.115.131
:When I ran the same
tcpdump
filter inside thetraefik
container, then the IP address of the client was set to theproxy
network gateway172.18.0.1
:The
proxy
netwok was created withdocker network create proxy
.proxy
network details:Setup
Config files
docker-compose.yml
traefik.yml
config.yml
Thanks