-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for dynamic "ProxySourceAddress" depending on the backend #272
Comments
Hmm. Interesting situation. Currently, there isn't a way to configure a per-backend Would it be possible to get the output from |
On the proxy (those are not the real IPs but i kept the same netmasks) :
And the network routes on that system :
Some of the backends will be on the 10.252.0.0 network (for example 10.252.3.19/19) and some backends will be on the 10.250.225.0 network (for example 10.250.17.35/15). If there is no other solution than determining the route using your own code, you could parse /proc/net/route to determine the right interface for a destination. |
I'm researching this, and in how exactly the Linux kernel will choose the source address to use for a given TCP connection, when the source address is not explicitly provided (which is the most common case). And this in turn makes me wonder why the kernel, in your case, appears to not be choosing the correct (well, expected) source address/interface. Would it possible to provide the (You can send this info to my personal email address, if you'd rather not post it here.) |
Recording this here for my future reference: this particular issue hinges on the value of Hopefully the provided logs/messages can help inform how and when to leave |
…ss to use when connecting to backend servers.
As an experiment, here's a PR/branch you might try, which allows for this |
I haven't had time to try your patched version yet but i got the logs you asked initially.
And on the tracelog :
So it's clearly binding on the wrong interface. |
…ss to use when connecting to backend servers.
@jb-boin Thanks for the info! Based on the IP addresses, we can indeed see that the wrong interface is being used. The "Transport endpoint is not connected" is a somewhat arcane error code/message to use for this situation, but it is not wrong. I've just refined my PR in order to address some regressions discovered by the regression tests, mostly related to handling cases where frontend address is IPv6 and backend address is IPv4 (or vice versa); I think the PR is ready to be tried in your situation. |
@jb-boin Any chance you've been able to try out the patch in your environment? |
Issue #272: Let the kernel automatically select the best source addre…
I am currently trying to set up a reverse proxy on Debian 12, the FTP server incoming connections are on a public interface while the backends are on two different VLANs, each intrerface has it's own IP on the server so it can connect directly to the backends not using a gateway.
If i don't set a
ProxySourceAddress
on the configuration, i can only connect to backends that are accessible from the public IP via the default gateway (which is not what i need), if i set theProxySourceAddress
on one of the internal network interface (or IP), it will then only work for the backends that are also on this network.Is there a way for the proxy to "detect" the right source address by itself if there's a local route on the system to the backend IP address?
If not, is there a way to set a different
ProxySourceAddress
depending on the backend name or it's IP/network?The text was updated successfully, but these errors were encountered: