Original Source
This filter should be configured with the name envoy.filters.http.original_src.
The original source http filter replicates the downstream remote address of the connection on the upstream side of Envoy. For example, if a downstream connection connects to Envoy with IP address , then Envoy will connect to the upstream with source IP 10.1.2.3
. The downstream remote address is determined based on the logic for the “trusted client address” outlined in XFF.
Note
This filter is not supported on Windows.
The downstream remote address used will likely be globally routable. By default, packets returning from the upstream host to that address will not route through Envoy. The network must be configured to forcefully route any traffic whose IP was replicated by Envoy back through the Envoy host.
If Envoy and the upstream are on the same host – e.g. in an sidecar deployment –, then iptables and routing rules can be used to ensure correct behaviour. The filter has an unsigned integer configuration, . Setting this to X causes Envoy to mark all upstream packets originating from this http with value X. Note that if mark is set to 0, Envoy will not mark upstream packets.
The following example configures Envoy to use the original source for all connections made on port 8888. All upstream packets are marked with 123.
- name: envoy.filters.http.original_src
"@type": type.googleapis.com/envoy.extensions.filters.listener.original_src.v3.OriginalSrc
- name: envoy.filters.http.router