xref: /openbsd-src/usr.sbin/tftp-proxy/tftp-proxy.8 (revision 41ce3b17e73f6b7d2d9e1a3d961e4bab2d895cb5)
1*41ce3b17Snaddy.\"	$OpenBSD: tftp-proxy.8,v 1.10 2022/03/31 17:27:32 naddy Exp $
20e189be2Sdlg.\"
30e189be2Sdlg.\" Copyright (c) 2005 joshua stein <jcs@openbsd.org>
40e189be2Sdlg.\"
50e189be2Sdlg.\" Redistribution and use in source and binary forms, with or without
60e189be2Sdlg.\" modification, are permitted provided that the following conditions
70e189be2Sdlg.\" are met:
80e189be2Sdlg.\"
90e189be2Sdlg.\" 1. Redistributions of source code must retain the above copyright
100e189be2Sdlg.\"    notice, this list of conditions and the following disclaimer.
110e189be2Sdlg.\" 2. Redistributions in binary form must reproduce the above copyright
120e189be2Sdlg.\"    notice, this list of conditions and the following disclaimer in the
130e189be2Sdlg.\"    documentation and/or other materials provided with the distribution.
140e189be2Sdlg.\" 3. The name of the author may not be used to endorse or promote products
150e189be2Sdlg.\"    derived from this software without specific prior written permission.
160e189be2Sdlg.\"
170e189be2Sdlg.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
180e189be2Sdlg.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
190e189be2Sdlg.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
200e189be2Sdlg.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
210e189be2Sdlg.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
220e189be2Sdlg.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
230e189be2Sdlg.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
240e189be2Sdlg.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
250e189be2Sdlg.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
260e189be2Sdlg.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
270e189be2Sdlg.\"
28*41ce3b17Snaddy.Dd $Mdocdate: March 31 2022 $
290e189be2Sdlg.Dt TFTP-PROXY 8
300e189be2Sdlg.Os
310e189be2Sdlg.Sh NAME
320e189be2Sdlg.Nm tftp-proxy
330e189be2Sdlg.Nd Internet Trivial File Transfer Protocol proxy
340e189be2Sdlg.Sh SYNOPSIS
350e189be2Sdlg.Nm tftp-proxy
360e189be2Sdlg.Op Fl 46dv
3719875b15Sflorian.Op Fl a Ar address
380e189be2Sdlg.Op Fl l Ar address
390e189be2Sdlg.Op Fl p Ar port
400e189be2Sdlg.Op Fl w Ar transwait
410e189be2Sdlg.Sh DESCRIPTION
420e189be2Sdlg.Nm
430e189be2Sdlgis a proxy for the Internet Trivial File Transfer Protocol.
440e189be2SdlgTFTP connections should be redirected to the proxy using a
450e189be2Sdlg.Xr pf 4
460e189be2Sdlgrule using the
470e189be2Sdlg.Ar divert-to
480e189be2Sdlgoption, after which the proxy connects to the server on behalf of
490e189be2Sdlgthe client.
500e189be2SdlgThe connection from the proxy to the server needs to be passed by
510e189be2Sdlga rule with divert-reply set.
520e189be2Sdlg.Pp
530e189be2SdlgThe proxy inserts
540e189be2Sdlg.Xr pf 4
5519875b15Sflorianpass and/or rdr rules using the
560e189be2Sdlg.Ar anchor
570e189be2Sdlgfacility to allow payload packets between the client and the server.
580e189be2SdlgOnce the rules are inserted,
590e189be2Sdlg.Nm
600e189be2Sdlgforwards the initial request from the client to the server to begin the
610e189be2Sdlgtransfer.
620e189be2SdlgAfter
630e189be2Sdlg.Ar transwait
640e189be2Sdlgseconds, the states are assumed to have been established and the
650e189be2Sdlg.Xr pf 4
660e189be2Sdlgrules are deleted and the program exits.
67*41ce3b17SnaddyOnce the transfer between the client and the server is completed, the
680e189be2Sdlgstates will naturally expire.
690e189be2Sdlg.Pp
700e189be2SdlgThe options are as follows:
710e189be2Sdlg.Bl -tag -width Ds
720e189be2Sdlg.It Fl 4
730e189be2SdlgForces
740e189be2Sdlg.Nm
750e189be2Sdlgto use IPv4 addresses only.
760e189be2Sdlg.It Fl 6
770e189be2SdlgForces
780e189be2Sdlg.Nm
790e189be2Sdlgto use IPv6 addresses only.
8019875b15Sflorian.It Fl a Ar address
8119875b15SflorianThe proxy will use
8219875b15Sflorian.Ar address
8319875b15Sflorianas the source address for the initial request from the client to the server for
8419875b15SflorianNAT traversal.
8519875b15SflorianInstead of a
8619875b15Sflorian.Dq pass in
8719875b15Sflorianrule an
8819875b15Sflorian.Dq rdr
8919875b15Sflorianrule will be generated.
90a4dc3638SflorianIt is possible to have two
91a4dc3638Sflorian.Fl a
92a4dc3638Sflorianoptions to specify both an IPv4 and an IPv6 address.
930e189be2Sdlg.It Fl d
940e189be2SdlgDo not daemonize.
950e189be2SdlgIf this option is specified,
960e189be2Sdlg.Nm
970e189be2Sdlgwill run in the foreground and log
980e189be2Sdlgthe client IP, type of request, and filename to stderr.
990e189be2Sdlg.It Fl l Ar address
1000e189be2SdlgListen on the specified address.
1010e189be2SdlgBy default
1020e189be2Sdlg.Nm
1031afffc2cSflorianlistens on localhost addresses.
1040e189be2Sdlg.It Fl p Ar port
1050e189be2SdlgListen on the specified port.
1060e189be2SdlgBy default
1070e189be2Sdlg.Nm
1080e189be2Sdlglistens on port 6969.
1090e189be2Sdlg.It Fl v
1100e189be2SdlgLog the connection and request information to
1110e189be2Sdlg.Xr syslogd 8 .
1120e189be2Sdlg.It Fl w Ar transwait
1130e189be2SdlgNumber of seconds to wait for the data transmission to begin before
1140e189be2Sdlgremoving the
1150e189be2Sdlg.Xr pf 4
1160e189be2Sdlgrule.
1170e189be2SdlgThe default is 2 seconds.
1180e189be2Sdlg.El
1190e189be2Sdlg.Sh CONFIGURATION
1200e189be2SdlgTo make use of the proxy,
1210e189be2Sdlg.Xr pf.conf 5
1220e189be2Sdlgneeds the following rules.
1230e189be2SdlgThe anchor is mandatory.
1240e189be2SdlgAdjust the rule as needed for your configuration.
1250e189be2Sdlg.Bd -literal -offset indent
1260e189be2Sdlganchor "tftp-proxy/*"
1270e189be2Sdlgpass in quick on $int_if inet proto udp from $lan to port tftp \e
1280e189be2Sdlg    divert-to 127.0.0.1 port 6969
1290e189be2Sdlgpass out quick on $ext_if inet proto udp from $lan to port tftp \e
1308bf962c0Sjmc    group _tftp_proxy divert-reply
1310e189be2Sdlg.Ed
1320e189be2Sdlg.Sh SEE ALSO
1330e189be2Sdlg.Xr tftp 1 ,
1340e189be2Sdlg.Xr pf 4 ,
1350e189be2Sdlg.Xr pf.conf 5 ,
1360e189be2Sdlg.Xr ftp-proxy 8 ,
1370e189be2Sdlg.Xr syslogd 8 ,
1380e189be2Sdlg.Xr tftpd 8
139f273b081Sschwarze.Sh HISTORY
140f273b081SschwarzeThe current stand-alone implementation first appeared in
141f273b081Sschwarze.Ox 5.3 .
142f273b081Sschwarze.Sh AUTHORS
1430c7a1797Sjmc.An David Gwynne Aq Mt dlg@openbsd.org
144