Go backward to Leaf Example.
Go up to Configuration Examples.

Gateway Example

   Many organizations have several local machines which are connected by
UUCP, and a single machine which connects to the outside world.  This
single machine is often referred to as a "gateway" machine.

   For this example I will assume a fairly simple case.  It should still
provide a good general example.  There are three machines, `elmer',
`comton' and `bugs'.  `elmer' is the gateway machine for which I will
show the configuration file.  `elmer' calls out to `uupsi'.  As an
additional complication, `uupsi' knows `elmer' as `airs'; this will
show how a machine can have one name on an internal network but a
different name to the external world.  `elmer' has two modems.  It also
has an TCP connection to `uupsi', but since that is supposed to be
reserved for interactive work (it is, perhaps, only a 9600 baud SLIP
line) it will only use it if the modems are not available.

   A network this small would normally use a single `sys' file.
However, for pedagogical purposes I will show two separate `sys' files,
one for the local systems and one for `uupsi'.  This is done with the
`sysfile' command in the `config' file.  Here is the `config' file.

     # This is config
     # The local sys file
     sysfile /usr/local/lib/uucp/sys.local
     # The remote sys file
     sysfile /usr/local/lib/uucp/sys.remote

   Using the defaults feature of the `sys' file can greatly simplify
the listing of local systems.  Here is `sys.local'.  Note that this
assumes that the local systems are trusted; they are permited to request
any world readable file and to write files into any world writable

     # This is sys.local
     # Get the login name and password to use from the call-out file
     call-login *
     call-password *
     # The systems must use a particular login
     called-login Ulocal
     # Permit sending any world readable file
     local-send /
     remote-send /
     # Permit receiving into any world writable directory
     local-receive /
     remote-receive /
     # Call at any time
     time any
     # Use port1, then port2
     port port1
     port port2
     # Now define the systems themselves.  Because of all the defaults we
     # used, there is very little to specify for the systems themselves.
     system comton
     phone 5551212
     system bugs
     phone 5552424

   The `sys.remote' file describes the `uupsi' connection.  The
`myname' command is used to change the UUCP name to `airs' when talking
to `uupsi'.

     # This is sys.remote
     # Define uupsi
     system uupsi
     # The login name and password are in the call-out file
     call-login *
     call-password *
     # We can call out at any time
     time any
     # uupsi uses a special login name
     called-login Uuupsi
     # uuspi thinks of us as `airs'
     myname airs
     # The phone number
     phone 5554848
     # We use port2 first, then port1, then TCP
     port port2
     port port1
     # We don't bother to make a special entry in the port file for TCP, we
     # just describe the entire port right here.  We use a special chat
     # script over TCP because the usual one confuses some TCP servers.
     port type TCP
     address uu.psi.com
     chat ogin: \L word: \P

   The ports are defined in the file `port' (see port File.).  For
this example they are both connected to the same type of 2400 baud
Hayes-compatible modem.

     # This is port
     port port1
     type modem
     device /dev/ttyd0
     dialer hayes
     speed 2400
     port port2
     type modem
     device /dev/ttyd1
     dialer hayes
     speed 2400

   Dialers are described in the `dial' file (see dial File.).

     # This is dial
     dialer hayes
     # The chat script used to dial the phone.  \D is the phone number.
     chat "" ATZ\r\d\c OK ATDT\D CONNECT
     # If we get BUSY or NO CARRIER we abort the dial immediately
     chat-fail BUSY
     chat-fail NO\sCARRIER
     # When the call is over we make sure we hangup the modem.
     complete \d\d+++\d\dATH\r\c
     abort \d\d+++\d\dATH\r\c