<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Load Balancing on OpenBSD Handbook</title><link>https://www.openbsdhandbook.com/load-balancing/</link><description>Recent content in Load Balancing on OpenBSD Handbook</description><generator>Hugo</generator><language>en</language><atom:link href="https://www.openbsdhandbook.com/load-balancing/index.xml" rel="self" type="application/rss+xml"/><item><title>Build Redundant Load-Balanced Gateways</title><link>https://www.openbsdhandbook.com/load-balanced-gateways/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.openbsdhandbook.com/load-balanced-gateways/</guid><description>&lt;h2 id="synopsis"&gt;
 Synopsis
 &lt;a class="anchor" href="#synopsis"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Configure two IPv4 gateways with shared addresses on the client and backend networks. Start with one active gateway and one standby. After routing and failover work, add CARP IP balancing if both gateways need to carry traffic.&lt;/p&gt;
&lt;p&gt;CARP IP balancing distributes traffic across gateways based on the source and destination IP addresses. It leaves the destination server unchanged. To select servers from a backend pool, use &lt;a href="https://www.openbsdhandbook.com/load-balance-nat-dsr/"&gt;NAT or DSR&lt;/a&gt;

. To route by HTTP hostname or path, use &lt;a href="https://www.openbsdhandbook.com/relayd-ha/"&gt;relayd proxying&lt;/a&gt;

.&lt;/p&gt;</description></item><item><title>Load Balance Services with NAT or DSR</title><link>https://www.openbsdhandbook.com/load-balance-nat-dsr/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.openbsdhandbook.com/load-balance-nat-dsr/</guid><description>&lt;h2 id="synopsis"&gt;
 Synopsis
 &lt;a class="anchor" href="#synopsis"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Use &lt;a href="https://man.openbsdhandbook.com/relayd.8/" target="_blank" rel="noopener noreferrer"&gt;relayd(8)&lt;/a&gt;

 to check backend health and configure PF to distribute service connections across healthy servers. Begin with destination NAT, where replies cross the frontend, then change to direct server return (DSR), where replies bypass it.&lt;/p&gt;
&lt;p&gt;The examples use IPv4 and a TCP web service so responses are easy to identify. PF forwards packets between the client and the selected server without terminating TLS or inspecting their HTTP requests. HTTP health checks are separate connections made by relayd.&lt;/p&gt;</description></item><item><title>Build an HA HTTPS Load Balancer</title><link>https://www.openbsdhandbook.com/relayd-ha/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://www.openbsdhandbook.com/relayd-ha/</guid><description>&lt;h2 id="synopsis"&gt;
 Synopsis
 &lt;a class="anchor" href="#synopsis"&gt;#&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;Configure two OpenBSD frontends to terminate HTTPS and distribute requests to healthy application servers. CARP moves the shared service IP to the standby if the active frontend fails. Unlike &lt;a href="https://www.openbsdhandbook.com/load-balance-nat-dsr/"&gt;PF NAT or DSR&lt;/a&gt;

, relayd accepts the client connection and opens a separate connection to the backend.&lt;/p&gt;
&lt;p&gt;The example uses TLS from the client to relayd and plain HTTP on an isolated backend network. If the backend network is not trusted, protect it or configure TLS between relayd and the backends. Client TLS protects only the connection to relayd.&lt;/p&gt;</description></item></channel></rss>