The version of istio I used is 1.45. I found the problem of ingressgate during the use, as follows.
My access form is simply as follows: client - > ingressgate - > service1
When the client initiates the access, the header carries "x-forward-for". After being forwarded by ingressgate, services1 cannot get "x-forward-for" content.
After testing, the ingressgate did not forward the header "x-forwarded-for" at all (bug no problem occurred in other customized headers).
According to your prompt, I modified it as follows:
1)exec command: kubectl edit svc istio-ingressgateway -n istio-system
2) change “Cluster” to “Local”
spec:
clusterIP: 10.245.163.159
externalTrafficPolicy: Local
healthCheckNodePort: 45748
Run the above envoyfilter, and we can get the real IP through request.headers [“x-custom-user-ip”] in the application or rule(mixer) or instance(mixer)
I have now seen my IP whitelisting work even with the Istio Ingress Gateway set to externalTrafficPolicy: Local and it seems like it was a misconfiguration on my part.
That is stil something which I have yet to see working. I might be digging into it in the next day or two though. It should work, it might be that case though that a person would need to get an ALB involved and use something to pass traffic from the ALB to the Istio Ingress but I’m just riffing now.