Next | Prev | Up | Top | Contents | Index

Proxy-ARP Routing

If you have a small number of standalone hosts connecting to a SLIP or PPP server, you can use Proxy-ARP routing. In this system, each of the standalone hosts is assigned an Internet address from the server's network. Each client sets up a default route through the server, and the server advertises each of the client's addresses using the Address Resolution Protocol (ARP). To set up a default route through the server, you can use the route command after a SLIP connection is established:

route add net default server-address 1

You should add this command to the script you use to start SLIP. For a PPP link, you can accomplish the same thing by adding the "add-route" keyword to the ppp.conf file.

For each client, the server should issue an arp command:

arp -s client-hostname server--ethernet-address pub

Note that the server's Ethernet address is not the same as its IP address. To determine the server's Ethernet address, run the arp command from another system on the same Ethernet:

% arp dial-in.salad.com
dial-in.salad.com (192.26.79.7) at 8:0:69:9:4f:ef
The string of hexadecimal numbers separated by colons (8:0:69:9:4f:ef) is the server's Ethernet address.

The server can be set up to run the arp commands at boot time by placing the commands in a local network script. The following example shows a local network script that sets up ARP entries for a set of clients:

#!/bin/sh
#
# starting up local networking stuff
#

IS_ON=/etc/chkconfig
CONF=/etc/config
SERV_ADDR=8:0:69:9:4f:ef 

if $IS_ON verbose ; then
        ECHO=echo
        VERBOSE=-v
else            # For a quiet startup and shutdown
        ECHO=:
        VERBOSE=
fi

case "$1" in
  'start')
      # setup proxy ARP for the dialin hosts
      # if this host has more than one interface,
      # you will need to hard-code the Ethernet MAC address
      # instead of letting it be determined at run time.
      # note that 4DDN (among others) may change the MAC address from default!
      # and some AppleTalk packages change the output of `netstat -ian`!
      arp -s client1 $SERV_ADDR pub
      arp -s client2 $SERV_ADDR pub
      arp -s client3 $SERV_ADDR pub
      ;;
  'stop')
      # be nice and delete the ARP entries
      arp -d client1
      arp -d client2
      arp -d client3
      ;;
  *)
        echo "usage: $0 {start|stop}"
        ;;
esac
exit 0
#
Assume the preceding file was named /etc/init.d/network.local, and you want it to run just after networking started, then you would use the following commands to create the startup and shutdown links:

ln -s /etc/init.d/network.local /etc/rc2.d/S31netlocal
ln -s /etc/init.d/network.local /etc/rc0.d/K39netlocal

Next | Prev | Up | Top | Contents | Index