I am trying to do SNI proxying to a subnet on a router while keeping the src IP.
Background: I have a router doing DNAT to do port-forwarding for many application ports, and it is connected to a subnet (using a VPN actually) with different backends. For protocols that do NOT have something like HTTP Host or TLS SNI that can be routed to different IPs based on the request, I simply uses DNAT with TCP port filter, and they are working well.
For TLS, I am using SNIProxy to multiplex the incoming connections to different servers, based on TLS SNI. It works pretty well, but SINProxy sends the TLS packets from the router itself, discarding src addresses. This breaks some backend services that rely on the src IP.
Thus, I am wondering if it is possible for netfilter to filter the traffic using TLS SNI (optionally with external modules) and route them using DNAT (instead of just dropping). If that is not possible, are there any alternatives?
By the way, I do not want to deploy full HTTP (or any L5 servers) on my router because:
- I have to decrypt the traffic and proxy them to the backend. This is a huge overhead.
- I do not want to deploy TLS certificates on routers due to the complexity in management.
Thanks very much for any helpful response in advance.