DP - Routing

There are two ways, in general, that you will connect systems together with dp. The first is a single machine (typically at home) to a network of systems (the office network or maybe the Internet) and second to connect two networks (two sites for example, or an office network to the Internet).

In either case, the networking software has to know how to get to the "other" systems. This is done in the kernel by routing tables. There is at least one route to each interface, but the administrator (you) can add more.

Static Routing

Where there is a single machine and a remote network or two reasonably stable networks which are under your administrative control, then the simplest way of setting things up is to use static routes.

Again, in the Unix way there is always more than one way of doing things, and this is true for installing route into the kernel.

route

The most direct way to install a new route is the use the route(8) command. "route" will allow you, as superuser, to add and delete routes in the kernel. There are three (really two) types of route:
Route to a Host
This type of route effectively says: you can get to this host via this interface.
Route to a Network
This type says there is a network over there, past that interface on the left :-)
The Default Route
The is a special route that is used as a catch all. It is most useful for a single host (home) connecting to everything else and tells the networking software to route everything down a single line if the is no other explicit route for it.
As of dp-3.1.3, the ${DPCONFDIR}/routes file is read at the time that PPP is configured or unconfigured. This file contains arguments to the route As an example, let's say that a home system is connected to a work system via a PPP link. "home.com" has the PPP interface of 192.220.10.1 "work.com" has the PPP interface 192.220.10.2 and the ethernet interface 192.220.11.18. In order for another machine on the work ethernet to get to the home system, it would need the command
	route add 192.220.10.1 192.220.11.18 1
or an entry in ${DPCONFDIR}/routes as follows:
	192.220.10.1 192.220.11.18 1
In order for the home system to reach other hosts on the work ethernet, it would need the command:
	route add 192.220.11.0 192.220.10.2 1
or an entry in ${DPCONFDIR}/routes as follows:
	192.220.11.0 192.220.10.2 1
Assume now that the ethernet is connected to other networks or the Internet. Then, the best command for home.com would be:
	route add default 192.220.10.2 1
or an entry in ${DPCONFDIR}/routes as follows:
	default 192.220.10.2 1
This would route all remote packets through the PPP interface.

Proxy ARP

Proxy ARP is a possibility in simple configurations. A proxy ARP daemon called
parpd is available that will make the machine on the other end of the PPP interface look like it is on the local ethernet. In this case, an IP address on the local subnet must be used for the remote system, and the Proxy ARP daemon will respond to ARP request on the local ethernet as a proxy to the remote host. This is probably the simplest way to handle the easy case of one remote machine.

/etc/gateways

The other method is to create a file called /etc/gateways that lists static routes to be made available when the routing daemon is started during boot.

This file is read when in.routed is started in /etc/rc.local. For further information, see the routed(8c) manual page.

Dynamic Routing

In the case where two networks are connected, and these may have further connections added to them or taken away, then there must be a way for the routing information to be updated at regular intervals so that packets can get to their intended destinations.

Routed

Routed(8c) has been used extensively for adapting routes to changing network connectivity. It will work in this case of PPP links. Routed works by sending RIP packets (Routing Information Protocol) on every interface every 30 seconds. Clearly, if we wish to disconnect the phone when our interface is not in use, this will cause problems. For this reason, routed is probably not the best choice for routing on hosts with dialup PPP interfaces, unless the intent is to keep the phones connected all the time.

Gated

Gated is a program that knows about routing via several protocols. It can handle RIP (routed) packets, as well as other protocols such as EGP (External Gateway Protocol) and GGP (Gateway to Gateway Protocol). It also can be used to consider certain routes as static and to be always available. These routes can then be advertised using any of the available routing protocols, including RIP.

If you have RIP based routing, then gated can be easily set up on your hub machine up to use static routing for the PPP links and use RIP for the other (ethernet?) networks.

Here is an example gated configuration file for our campus hub that talks to 6 remote systems, each with a local ethernet at the other end:

    #
    #	Config file gated on phoenix.acn.purdue.edu
    #
    traceoptions internal external route rip update ;
    #tracefile "/tmp/gated.trace" ;

    interface all passive ;		# don't time out my interfaces!

    #
    # Do rip except on the PPP interfaces
    #
    rip supplier {
	interface dp0 noripout noripin ;
	interface dp1 noripout noripin ;
	interface dp2 noripout noripin ;
	interface dp3 noripout noripin ;
	interface dp4 noripout noripin ;
	interface dp5 noripout noripin ;
    } ;

    #
    # Set up static routes to remote ethernets at the end of PPP links
    # We are advertising ourself as a gateway to the subnetwork assigned
    # to the PPP links.  For each remote ethernet, the remote end of a PPP
    # link is being advertised as a gateway.
    #
    static {
	128.46.177.0 gateway 128.46.157.167 ;	# PPP Links
	128.46.34.0  gateway 128.46.177.34 ;	# Remote ethernet
	128.46.181.0 gateway 128.46.177.43 ;	# Remote ethernet
	128.46.176.0 gateway 128.46.177.49 ;	# Remote ethernet
	128.46.182.0 gateway 128.46.177.50 ;	# Remote ethernet
	128.46.84.0  gateway 128.46.177.84 ;	# Remote ethernet
    } ;

    #
    # Send out all sorts of interesting information in RIP packets
    #
    propagate proto rip {
	#
	# Propagate anything learned via RIP
	#
	proto rip ;
	#
	# Propagate static routes to county ethernets
	# Technically, the metric for remote ethernets should be 2,
	# but 1 works better in this scenario since there are no alternate
	# routes anyway, especially direct routes.
	#
	proto static metric 1 ;
	#
	# Propagate routes to all connected interfaces
	#
	# proto direct metric 1 ;
    } ;

    #
    # We don't have SNMP configured in
    #
    #snmp no ;
We are using gated 3.0.3. The latest information about gated is available at
http://www.gated.cornell.edu/. It is a very capable software package and is very useful on machines with non-trivial network configurations.

Kirk Smith / ks@acn.purdue.edu Last updated: 28 July 1995