xref: /openbsd/usr.sbin/relayd/relayd.8 (revision 3d8817e4)
1.\"	$OpenBSD: relayd.8,v 1.23 2010/05/24 19:44:23 jmc Exp $
2.\"
3.\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: May 24 2010 $
18.Dt RELAYD 8
19.Os
20.Sh NAME
21.Nm relayd
22.Nd relay daemon
23.Sh SYNOPSIS
24.Nm
25.Op Fl dnv
26.Op Fl D Ar macro Ns = Ns Ar value
27.Op Fl f Ar file
28.Sh DESCRIPTION
29.Nm
30is a daemon to relay and dynamically redirect incoming connections to
31a target host.
32Its main purposes are to run as a load-balancer, application layer
33gateway, or transparent proxy.
34The daemon is able to monitor groups of hosts for availability, which
35is determined by checking for a specific service common to a host
36group.
37When availability is confirmed,
38layer 3 and/or layer 7 forwarding services are set up by
39.Nm .
40.Pp
41Layer 3 redirection happens at the packet level; to configure
42it,
43.Nm
44communicates with
45.Xr pf 4 .
46To allow
47.Nm
48to properly set up
49.Xr pf 4
50rules, the following line is required in the filter section of
51.Xr pf.conf 5 :
52.Bd -literal -offset indent
53anchor "relayd/*"
54.Ed
55.Pp
56Layer 7 relaying happens at the application level and is
57handled by
58.Nm
59itself.
60Various application level filtering and protocol-specific
61load-balancing options are available for relays.
62.Pp
63.Nm
64works in terms of the following
65.Em entities :
66relays, protocols, redirections, and tables.
67A
68.Em relay
69represents a layer 7 load-balancing instance.
70Each instance translates to a listening TCP or UDP port.
71A
72.Em protocol
73defines which actions, if any, are taken on the
74packet payload as data crosses a relay.
75A
76.Em redirection
77represents a layer 3 load-balancing instance.
78Each instance translates to a
79.Xr pf 4
80rdr-to rule being added.
81A
82.Em table
83represents a group of hosts which can be checked for
84availability using the same method.
85Each table contains at least one host.
86If a table is used in a layer 3 load-balancing instance, it
87will be mapped to a
88.Xr pf 4
89table containing only those hosts which are up.
90.Pp
91All these entities can be configured in
92.Xr relayd.conf 5 ,
93and
94.Xr relayctl 8
95can be used to alter or report on the status of each entity.
96.Pp
97The options are as follows:
98.Bl -tag -width Ds
99.It Fl D Ar macro Ns = Ns Ar value
100Define
101.Ar macro
102to be set to
103.Ar value
104on the command line.
105Overrides the definition of
106.Ar macro
107in the configuration file.
108.It Fl d
109Do not daemonize.
110If this option is specified,
111.Nm
112will run in the foreground and log to
113.Em stderr .
114.It Fl f Ar file
115Specify an alternative configuration file.
116The default is
117.Pa /etc/relayd.conf .
118.It Fl n
119Configtest mode.
120Only check the configuration file for validity.
121.It Fl v
122Produce more verbose output.
123.El
124.Sh FILES
125.Bl -tag -width "/var/run/relayd.sockXX" -compact
126.It /etc/relayd.conf
127Default configuration file.
128.It /var/run/relayd.sock
129.Ux Ns -domain
130socket used for communication with
131.Xr relayctl 8 .
132.El
133.Sh SEE ALSO
134.Xr relayd.conf 5 ,
135.Xr relayctl 8
136.Sh HISTORY
137The
138.Nm
139program, formerly known as
140.Ic hoststated ,
141first appeared in
142.Ox 4.1 .
143It was renamed to
144.Nm
145in
146.Ox 4.3 .
147.Sh AUTHORS
148.An -nosplit
149The
150.Nm
151program was written by
152.An Pierre-Yves Ritschard Aq pyr@openbsd.org
153and
154.An Reyk Floeter Aq reyk@openbsd.org .
155