Hello,
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 : 192.68.1.150 GW : 192.68.1.21
- Wan ppp0 (modem 3G/4G) IP : 10.160.241.16 GW: 192.200.1.21
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 192.200.1.21 dev ppp0
10.160.241.16 dev ppp0 src 10.160.241.16
iproute list table main
default via 192.68.1.20 dev eth0
192.68.1.0/24 dev eth0 src 192.68.1.150
192.200.1.21 dev ppp0 src 10.160.241.16
Here is the configuration passed to HAProxy
frontend frt3078899856
mode tcp
bind 127.0.0.1:2525
default_backend bck3078899856
backend bck3078899856
mode tcp
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