summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relayd.conf.5
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2009-08-13 13:51:22 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2009-08-13 13:51:22 +0000
commiteedcbaee459596630d9ae1cbc0f0a169b0424116 (patch)
treeb41eb581ebc41d4770640a753f2916a0bd032af9 /usr.sbin/relayd/relayd.conf.5
parent74a6604beb400e6cc433d7fda8960ce8bb0ca9ba (diff)
add new 'router' functionality to dynamically add or remove routes
based on health check results, using the existing table syntax. this allows to maintain multiple (uplink) gateways to implement link balancing or WAN link failover if no routing protocol or other keepalive method is available. works fine with or without net.inet.ip.multipath enabled. ok pyr@, jmc@ for manpages
Diffstat (limited to 'usr.sbin/relayd/relayd.conf.5')
-rw-r--r--usr.sbin/relayd/relayd.conf.579
1 files changed, 75 insertions, 4 deletions
diff --git a/usr.sbin/relayd/relayd.conf.5 b/usr.sbin/relayd/relayd.conf.5
index b053c8b8cfa..30288391e2f 100644
--- a/usr.sbin/relayd/relayd.conf.5
+++ b/usr.sbin/relayd/relayd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: relayd.conf.5,v 1.108 2009/08/07 11:10:23 reyk Exp $
+.\" $OpenBSD: relayd.conf.5,v 1.109 2009/08/13 13:51:21 reyk Exp $
.\"
.\" Copyright (c) 2006, 2007 Reyk Floeter <reyk@openbsd.org>
.\" Copyright (c) 2006, 2007 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 7 2009 $
+.Dd $Mdocdate: August 13 2009 $
.Dt RELAYD.CONF 5
.Os
.Sh NAME
@@ -43,8 +43,8 @@ Table definitions describe a list of hosts,
in a similar fashion to
.Xr pf 4
tables.
-They are used for relay and redirection target selection with the
-described options and health checking on the host they contain.
+They are used for relay, redirection, and router target selection with
+the described options and health checking on the host they contain.
.It Sy Redirections
Redirections are translated to
.Xr pf 4
@@ -55,6 +55,9 @@ Relays allow application layer load balancing, SSL acceleration, and
general purpose TCP proxying on layer 7.
.It Sy Protocols
Protocols are predefined protocol handlers and settings for relays.
+.It Sy Routers
+Routers are used to insert routes with health-checked gateways for
+(WAN) link balancing.
.El
.Pp
Within the sections,
@@ -1035,6 +1038,64 @@ connection.
This will affect the TCP window size.
.El
.El
+.Sh ROUTERS
+Routers represent routing table entries in the kernel forwarding
+database, see
+.Xr route 4 ,
+and a table of associated gateways.
+They are used to dynamically insert or remove routes with gateways
+based on their availability and health-check results.
+A router can include multiple network statements and a single forward
+statement with a table of one or more gateways.
+All entries in a single router directive must match the same address
+family, either IPv4 or IPv6.
+.Pp
+The kernel supports multipath routing when multiple gateways exist to
+the same destination address.
+The multipath routing behaviour can be changed globally using the
+.Xr sysctl 8
+variables
+.Va net.inet.ip.multipath
+and
+.Va net.inet6.ip6.multipath .
+With the default setting of 0,
+the first route selected will be used for subsequent packets to that
+destination regardless of source.
+Setting it to 1 will enable load balancing based on the packet source
+address across gateways; multiple routes with the same priority are
+used equally.
+The kernel will also check the link state of the related network
+interface and try a different route if it is not active.
+.Pp
+The configuration directives that are valid in the
+.Ic routers
+context are described below:
+.Bl -tag -width Ds
+.It Xo
+.Ic forward to
+.Aq Ar table
+.Ic port Ar number
+.Ar options ...
+.Xc
+Specify the table of target gateways to be used; see the
+.Sx TABLES
+section above for information about table options.
+This entry is mandatory and must be specified once.
+.It Xo
+.Ic route
+.Ar address Ns Li / Ns Ar prefix
+.Xc
+Specify the network address and prefix length of a route destination
+that is reachable via the active gateways.
+This entry must be specified at least once in a router directive.
+.It Ic rtable Ar id
+Add the routes to the kernel routing table with the specified
+.Ar id .
+.It Ic rtlabel Ar label
+Add the routes with the specified
+.Ar label
+to the kernel routing table.
+.El
.Sh FILES
.Bl -tag -width "/etc/ssl/private/address.keyXX" -compact
.It Pa /etc/relayd.conf
@@ -1143,6 +1204,16 @@ relay "sshforward" {
forward to shell.example.com port 22
}
.Ed
+.Pp
+The next simple router configuration example can be used to run
+redundant, health-checked WAN links:
+.Bd -literal -offset indent
+table \*(Ltgateways\*(Gt { $gw1 ip ttl 1, $gw2 ip ttl 1 }
+router "uplinks" {
+ route 0.0.0.0/0
+ forward to \*(Ltgateways\*(Gt check icmp
+}
+.Ed
.Sh SEE ALSO
.Xr relayctl 8 ,
.Xr relayd 8 ,