Date: Wed, 17 Jan 2007 13:31:16 -0800 From: "Michael K. Smith - Adhost" <mksmith@adhost.com> To: "freebsd" <freebsd@gorlani.net>, "FreeBSD Questions" <freebsd-questions@freebsd.org> Subject: RE: Load balancing outgoing mail relay Message-ID: <17838240D9A5544AAA5FF95F8D5203160187E79C@ad-exh01.adhost.lan> In-Reply-To: <000801c73a23$017bdeb0$6601880a@Enigma> References: <000801c73a23$017bdeb0$6601880a@Enigma>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello: > -----Original Message----- > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd- > questions@freebsd.org] On Behalf Of freebsd > Sent: Wednesday, January 17, 2007 2:34 AM > To: FreeBSD Questions > Subject: Load balancing outgoing mail relay >=20 > Hi > I have a simple question but googling does not lead to a valid/usable > answer. > I need to load balance OUTGOING emails. I have serveral smart hosts. I > need > my internal SMTP server to send mail using ALL of the smart hosts > together, > making some kind of load balancing (no need for wheighted one). > Someone pointed out to use a name for the smart host, and have DNS to > resolve that name to the IP of all the relays (multiple A records) but > this > turned out in doing failover, not load balancing. > Anyone has a *working* idea for solving this apparently simple problem? > Thanks >=20 PF will definitely do what you want via its round-robin and redirect features. You would redirect all inbound traffic on port 25 to your smart host group/table which would then load balance across all of your servers. In pf.conf, something like the following, with the understanding that there are other things you may need to do first before a pf config will work: $int_if=3D"em1" # replace with the interface name from your machine $ext_if=3D"em0" # replace with the interface name from your machine $smart_host_01=3D"192.168.1.1" $smart_host_02=3D"192.168.1.2" $smart_host_03=3D"192.168.1.3" $mail_server_01=3D"10.1.1.1" table <smtp_roundrobin> persist { \ $smart_host_01, \ $smart_host_02, \ $smart_host_03 \ } rdr on $int_if proto tcp from $mail_server_01 to any port 25 -> <smtp_roundrobin> round-robin=20 The configuration can become more granular (complex) by including NAT and ALTQ if you want to do rate-shaping. Regards, Mike
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?17838240D9A5544AAA5FF95F8D5203160187E79C>