BSRELAY(1)

NAME
bsrelay - TCP/UDP data relay.

SYNOPSIS
bsrelay [ -d ] [ -i ] [ -B ] [ -p ] [ -l buflen ] [ -f <client config file> ] [ -n ] [ -b <socket size> ] -- < connection specification > < connection specification >

DESCRIPTION
bsrelay is a simple data relay tool for TCP and UDP protocols. Connections may be active or passive and "wildcard" addresses with netmasks are supported. The tool may run as a one time bridge or a persistent server, though the latter may present an unacceptable security risk at some sites. It supports both active and passive connections. The author *purports* that it will support tcp <-> udp pipes.

OPTIONS

-d  Produce copious debugging output (privileged option)

-i  Go into interactive mode.

-B  Output full blocks (actually this is ttcp compatibility flag)

-p  Go in to server (persistent) mode. This option is subject to numerous conditions. See below.

-l  Set the default buffer length for relay.

-f  Filename of the client config file (/etc/bs.client.conf by default).

-b  Set the size of the socket send and receive buffers.

-n  Turn off logging (privileged option)

HALF CHANNEL SPECIFICATION
Following the `--' (double dash) on the command line, bsrelay expects two (2) `half channel specifications'. Each half channel represents one side of a full duplex pipe ( NB a half channel is not the same as a half duplex pipe). The syntax for a half channel specification is [ tcp | udp ] < connection expression >/< port | any >

The halfchannels do not both have to be the same protocol.

The connection expression determines both whether the half channel will be an active or passive connection and (if passive) whether the channel will permit connections from more than one IP address. The syntax of a connection expression follows:

  ACTIVE
< hostname | ip address >

  PASSIVE
(< hostname | ip address >[/< netmask >] [ ... ])

bsrelay never cares whether you specify and address with a hostname or an ip address (although using a hostname/netmask pair is peculiar). There can be only host (and no netmask) for an active specification, but a passive specification may contain a space-delimited list of address/netmask pairs. Specifying the netmask is optional, but if not stipulated the default is 255.255.255.255. The port specification is not optional (though the key word any may be used as a wildcard) and denotes the port to which bsrelay will either bind (passive connections) or connect (active connections). If the wildcard port is named for either (or both) halfchannel specifications, bsrelay will print the port actually assigned over stdout. The persistent option is only permitted if at least one halfchannel specification is passive.

bsrelay may be invoked from either the command line or from btelnet (via the fork subcommand). When called from btelnet , bsrelay will check the Brimstone ACL lists once a complete connection is determined to ensure that unauthorized use of restricted services does not occur through a bsrelay `endrun'. The username will passed from btelnet and privileged options will not be honored. If a wildcard port is specified, btelnet will report the assigned port just as if bsrelay were invoked from the command line.

EXAMPLES
The most common use of bsrelay is to bridge a tcp connection across a machine. Generally one halfchannel is passive and the other is active. The following command permits connections from all hosts on the 10.1.1 subnet as well as trusted.dom.ain and bridges them to service.other.domain. The relay will remain in existence (subject to the value of BSRELAY_PASSIVETIMEOUT (cf)).
bsrelay -p -- tcp ( 10.1.1.0/255.255.255.0 trusted.dom.ain )/9999 tcp     service.other.domain/9999

BUGS

Good taste prevents the author from opining on the syntax of the half channel specification.

Relays involving UDP do not die, which might not coincide with some users' expectations.

SEE ALSO

btelnet(1), tcp(4), udp(4)