Index | Thread | Search

From:
Sebastian Benoit <benno@openbsd.org>
Subject:
Re: relayd.conf(5) - add "route to" example
To:
aisha <openbsd.tech@aisha.cc>
Cc:
tech@openbsd.org
Date:
Fri, 20 Sep 2024 20:58:44 +0200

Download raw body.

Thread
aisha(openbsd.tech@aisha.cc) on 2024.09.18 22:53:56 -0400:
> Hi,
> 
>   I was trying to figure out how to load balance using route-to with relayd and turns out it was complicated due to unhelpful error warnings (thanks yacc/lex) and lack of an example. I had to read the parse.y to figure out the problem. 
> While fixing yacc/lex errors is above my mortal soul, I can add an example for the route-to syntax.
> 
> OK?

i guess with the difficulty of using this, one example for each thing relayd
can do can't hurt.

ok benno@


> 
> Best,
> Aisha
> 
> --- relayd.conf.5.orig	Wed Sep 18 22:35:35 2024
> +++ relayd.conf.5	Wed Sep 18 22:48:05 2024
> @@ -1529,6 +1529,20 @@
>  }
>  .Ed
>  .Pp
> +To load balance an IP address over multiple backend servers using a
> +.Xr pf 4
> +.Cm route-to
> +directive:
> +.Bd -literal -offset indent
> +table <backends> { 10.100.42.71 10.100.42.72 10.100.42.73 }
> +
> +redirect "xmpp" {
> +	listen on 10.100.42.2 tcp port 5222
> +
> +	route to <backends> port 5222 check tcp interface em0
> +}
> +.Ed
> +.Pp
>  The following configuration would add a relay to forward
>  secure HTTPS connections to a pool of HTTP webservers
>  using the
>