I use HAProxy 1.8.8 as reverse-proxy in product with Linux 4.14 from scratch.
HAProxy brings the SSL dimension to make HTTPS, FTPS (Implicit) and SMTPS (Implicit) based on HTTP, FTP and SMTP.
On this product there are 2 IP interfaces:
- Lan eth0 IP : 184.108.40.206 GW : 220.127.116.11
- Wan ppp0 (modem 3G/4G) IP : 10.160.241.16 GW: 18.104.22.168
The system integrates a web server, and the ability to send mails.
As a server, everything works perfectly, in Lan and Wan.
As a customer, everything works perfectly in Lan.
The problem occurs in client mode by the Wan, for example for the SMTP.
here are my routing rules:
iproute list table modem3G
default via 22.214.171.124 dev ppp0
10.160.241.16 dev ppp0 src 10.160.241.16
iproute list table main
default via 126.96.36.199 dev eth0
188.8.131.52/24 dev eth0 src 184.108.40.206
220.127.116.11 dev ppp0 src 10.160.241.16
Here is the configuration passed to HAProxy
server srv3078899856 smtp.orange.fr:465 ssl verify none
The SMTP connection uses the address 127.0.0.1:2525 as the recipient. (HAProxy)
Without HAProxy, the connection works.
After many hours of research and testing, here is my question:
- How can HAProxy know to use the Wan gateway ?
Last point: If I add the following command, it works.
#route add default ppp0
But I don’t think that is the solution, because it will hide the Lan gateway.
Thank you for your help