<?xml version="1.0" encoding="UTF-8"?>
<refentry id="macipgw.8">
  <refmeta>
    <refentrytitle>macipgw</refentrytitle>

    <manvolnum>8</manvolnum>

    <refmiscinfo class="date">25 July 1997</refmiscinfo>

    <refmiscinfo class="source">Netatalk</refmiscinfo>

    <refmiscinfo class="manual">Netatalk AFP Fileserver Manual</refmiscinfo>

    <refmiscinfo class="version">@netatalk_version@</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>macipgw</refname>

    <refpurpose>MacIP Gateway Daemon</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>macipgw</command>

      <arg>-d <replaceable>debugclass</replaceable></arg>

      <arg>-f <replaceable>configfile</replaceable></arg>

      <arg>-n <replaceable>nameserver</replaceable></arg>

      <arg>-u <replaceable>unprivileged-user</replaceable></arg>

      <arg>-z <replaceable>zone</replaceable></arg>

      <arg><replaceable>network</replaceable></arg>

      <arg><replaceable>netmask</replaceable></arg>
    </cmdsynopsis>

    <cmdsynopsis>
      <command>macipgw</command>

      <group>
        <arg choice="plain">-v</arg>

        <arg choice="plain">-V</arg>
      </group>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para><command>macipgw</command> provides IP connectivity for devices
    connected through an AppleTalk-only network, i.e. LocalTalk or Apple
    Remote Access (ARA). <command>macipgw</command> is normally started out of
    <filename>/etc/rc</filename>.</para>

    <para>MacIP (formerly known as KIP) is a protocol that allows the
    encapsulation of IP packets in AppleTalk packets.
    <command>macipgw</command> registers itself as a MacIP gateway on the
    AppleTalk network and configures and brings up a tunnel interface (see
    <citerefentry>
        <refentrytitle>tun</refentrytitle>

        <manvolnum>4</manvolnum>
      </citerefentry>). It then forwards IP packets received from the
    AppleTalk network to the kernel through the tunnel interface. Likewise, IP
    packets received through the tunnel are forwarded to the AppleTalk device
    registered for the destination IP address.</para>

    <para>Unlike other MacIP gateways, <command>macipgw</command> needs its
    own IP (sub-)net to operate, and does not use proxy-ARP for the addresses
    registered. The gateway will always use the first address in the network
    for the local address, i.e. 192.168.1.1 for the network
    192.168.1.0/24.</para>

    <para>If present, <command>macipgw</command> reads configuration options
    from <filename>/usr/etc/macipgw.conf</filename> (or equivalent pkgconf
    path.) Command line options will take precedence over configuration file
    options. See below for an example.</para>

    <para><command>macipgw</command> will log operational messages through
    <citerefentry>
        <refentrytitle>syslog</refentrytitle>

        <manvolnum>3</manvolnum>
      </citerefentry> under the facility <emphasis
    remap="B">LOG_DAEMON</emphasis>.</para>
  </refsect1>

  <refsect1>
    <title>Options</title>

    <variablelist>
      <varlistentry>
        <term>-d <replaceable>debugclass</replaceable></term>

        <listitem>
          <para>Specifies that the daemon should not fork, and that a trace of
          all actions be written to <emphasis remap="B">stdout</emphasis>. See
          the source code for useful values of debugclass.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-f <replaceable>configfile</replaceable></term>

        <listitem>
          <para>Consult <replaceable>configfile</replaceable> instead of
          <filename>macipgw.conf</filename> for the configuration
          information.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-n <replaceable>nameserver</replaceable></term>

        <listitem>
          <para>Specifies the IP address of a DNS name server the AppleTalk
          devices connected through the gateway should use.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-u <replaceable>unprivileged-user</replaceable></term>

        <listitem>
          <para>Drop root privileges and change to user unprivileged-user
          after the server has started.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-z <replaceable>zone</replaceable></term>

        <listitem>
          <para>Specifies that <command>macipgw</command> should register in
          zone instead of the default zone.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>-v | -V</term>

        <listitem>
          <para>Show version information and exit.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><replaceable>network</replaceable></term>

        <listitem>
          <para>Specifies the network number to use for the clients.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><replaceable>netmask</replaceable></term>

        <listitem>
          <para>Specifies the netmask for the network.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Example</title>

    <example>
      <title>Example <command>macipgw</command> invocation.</title>

      <screen><userinput>/usr/local/libexec/macipgw -n 192.168.1.1 -z "Remote Users" 192.168.1.0 255.255.255.0</userinput>
</screen>

      <para>Starts <command>macipgw</command>, assigning the Class C network
      192.168.1.0 for devices connected through the gateway, specifying that
      the system <command>macipgw</command> is running on can be used as a
      name server, and that it should register in the zone Remote
      Users.</para>
    </example>

    <example>
      <title>Example <filename>macipgw.conf</filename> configuration
      file.</title>

      <programlisting>[Global]
network = 192.168.151.0
netmask = 255.255.255.0
nameserver = 8.8.8.8
zone = My Zone
unprivileged user = foobar</programlisting>
    </example>
  </refsect1>

  <refsect1>
    <title>Files</title>

    <para><filename>/usr/local/libexec/macipgw</filename></para>
  </refsect1>

  <refsect1>
    <title>See Also</title>

    <para><citerefentry>
        <refentrytitle>tun</refentrytitle>

        <manvolnum>4</manvolnum>
      </citerefentry></para>

    <para><citerefentry>
        <refentrytitle>ip</refentrytitle>

        <manvolnum>4</manvolnum>
      </citerefentry></para>

    <para><citerefentry>
        <refentrytitle>atalkd</refentrytitle>

        <manvolnum>8</manvolnum>
      </citerefentry></para>

    <para><citerefentry>
        <refentrytitle>syslog</refentrytitle>

        <manvolnum>3</manvolnum>
      </citerefentry></para>

    <para><citerefentry>
        <refentrytitle>syslogd</refentrytitle>

        <manvolnum>8</manvolnum>
      </citerefentry></para>
  </refsect1>

  <refsect1>
    <title>Bugs</title>

    <para>No information besides the log messages is available on which
    AppleTalk devices are using the gateway.</para>
  </refsect1>

  <refsect1>
    <title>Author</title>

    <para>Stefan Bethke &lt;Stefan.Bethke@Hanse.DE&gt;</para>
  </refsect1>
</refentry>
